Skip to content

FATAL: Sing-box service crashes on version 1.13.0+ due to legacy sniff fields in inbounds #5

@MixxxGit

Description

@MixxxGit

Description:
The script currently hardcodes "sniff": true and "sniff_override_destination": true inside the inbounds objects across multiple configuration generator functions (e.g., generate_naive_config, generate_vless_config, generate_vmess_config, etc.).

According to the official sing-box migration guide, legacy inbound fields were completely removed in sing-box 1.13.0. Because the script installs the latest version of sing-box by default, the generated config.json is invalid, causing the sing-box service to immediately crash with the following error:
FATAL decode config at ...: inbounds[0]: legacy inbound fields are deprecated in sing-box 1.11.0 and removed in sing-box 1.13.0, checkout migration...

Steps to Reproduce:

  1. Run the script and choose [1] Download and install sing-box (Latest version).
  2. Generate any proxy node (for example, [12] NaiveProxy).
  3. Check the service status: systemctl status sing-box.
  4. Observe the Result: exit-code and the FATAL decode config error in the logs.

Expected Behavior:
The script should generate a config.json compatible with sing-box 1.13.0+, where sniffing is configured as a routing rule rather than an inbound property.

Proposed Solution:
In all awk blocks within generate_*_config functions:

  1. Remove the print statements for sniff and sniff_override_destination inside the inbounds generation.
  2. Add a new rule with "action": "sniff" in the rules array.

Example fix for generate_naive_config:

        found_rules && /"rules": \[/{
        print "      {";
        print "        \"inbound\": [\"" tag_label "\"],";
        print "        \"action\": \"sniff\""; print "      },";
        print "      {";
        print "        \"inbound\": [\"" tag_label "\"],";
        print "        \"outbound\": \"direct\""; print "      },";
        found_rules=0}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions