Skip to content

Troubleshooting Muffin

Source files: 22 · checked against muffin v0.3.0
  • muffin/crates/muffin-ipc/src/paths.rs
  • muffin/crates/muffin-service/src/paths.rs
  • muffin/crates/muffin-service/src/logs.rs
  • muffin/crates/muffin-service/src/api.rs
  • muffin/crates/muffin-service/src/listener.rs
  • muffin/crates/muffin-service/src/error.rs
  • muffin/crates/muffin-service/src/profiles.rs
  • muffin/crates/muffin-service/src/convert.rs
  • muffin/crates/muffin-service/src/probe.rs
  • muffin/crates/muffin-service/src/routing.rs
  • muffin/crates/muffin-service/src/daemon.rs
  • muffin/crates/muffin-service/src/geo.rs
  • muffin/crates/muffin/src/pages/diagnostics.rs
  • muffin/crates/muffin/src/doctor.rs
  • muffin/crates/muffin/src/bundle.rs
  • muffin/crates/muffin/src/pages/logs.rs
  • muffin/crates/muffin/src/pages/connections.rs
  • muffin/crates/muffin/src/pages/rules.rs
  • muffin/crates/muffin/src/pages/settings.rs
  • muffin/crates/muffin/src/shell.rs
  • muffin/crates/muffin/src/service_manager/mod.rs
  • muffin/crates/muffin/locales/app.yml

Start with the Diagnostics page: its connection doctor checks, in order, every step from the kernel to a request through your node, and names the first one that fails. The Logs page shows what the service and the kernel report; set Settings › Advanced › Log level to Debug for more detail. When the window cannot reach the service, read the service’s own log, listed below.

The page has four parts: the connection doctor, the exit address, reachability, and the diagnostic bundle.

The doctor runs the first time you open the page, and again with Run All Checks (Stop ends a run). It runs eight checks in turn, each reading the state as it is when its turn comes:

Check Passes when When it fails
Kernel running The kernel runs; it shows the uptime The kernel isn’t running: start it from the Overview, and read Logs if it stops again. Without the service, this check fails and the rest are skipped.
Profile loaded A profile is in use; it shows the name and node count No profile in use: import or use a profile
Traffic reaches Muffin The system proxy or TUN mode is on A note, not a failure: only programs set to use 127.0.0.1:<port> reach Muffin
DNS resolves The system resolver finds www.gstatic.com Names don’t resolve: check this computer’s network connection
Node reachable The Default route’s node accepts a TCP connection The node doesn’t answer: test the nodes in Proxies and switch, or update the profile. Skipped when Default goes direct or no node is picked; fails when it rejects everything.
Request through Muffin https://www.gstatic.com/generate_204 answers 204 through Muffin’s HTTP proxy Requests don’t get through: the node answers but requests fail, for example because the plan ran out or the profile is out of date. Any other answer, such as a login page, fails with answered <status> instead of 204.
IPv6 This network reaches a public IPv6 address directly A note: IPv6-only sites will not open
TUN TUN mode is off (skipped), or its device runs TUN isn’t running: switch TUN off and on in Settings; it fails with Needs administrator permission without the permission

Node reachable and Request through Muffin are skipped while the kernel does not run. Node reachable measures only TCP, so with a Hysteria 2 or WireGuard node as Default it fails with <node> · udp; Request through Muffin still tests such a node.

Exit IP shows the address websites see, twice: Through Muffin and Direct. When the two differ, sites see the node’s address and place, not your own connection; when they match, the lookups went direct, by the rules or the mode. Muffin looks the address up at ipinfo.io, through its proxy and directly; the lookup through Muffin needs the kernel running.

Reachability measures, through Muffin, how long Google, YouTube, GitHub, ChatGPT, Telegram, Cloudflare, Apple and Bilibili take to answer, whatever the answer is, with a 6-second timeout. It needs the kernel running. The Overview shows the same card.

Save Bundle… writes a text file, muffin-diagnostics-<date>-<time>.txt in your Downloads folder by default, to read and attach to a bug report; Copy Summary copies its first part. Nothing is uploaded. The bundle is built from a fixed list of fields, in English whatever the interface language:

  • the versions of Muffin and the service, and the operating system;
  • the state: the kernel, the mode, the system proxy, TUN, and the service’s memory;
  • the doctor’s results;
  • the settings, with the geodata URLs cut down to their host;
  • the profiles: name, source host, update time and interval, the last error, and whether a profile has custom request headers, never the headers themselves;
  • the nodes: name, protocol, transport and TLS, without addresses or credentials;
  • the route groups and what each one goes to;
  • the log lines the window holds, up to 2000.

Settings › About › Report a Problem… and Diagnostic Bundle… on the Logs page open this page.

Check Contacts Path
Exit IP https://ipinfo.io/json Through Muffin and directly
Reachability The eight sites above Through Muffin
DNS resolves The system resolver, for www.gstatic.com Directly
Node reachable The Default node’s server and port Directly, a TCP connection only
Request through Muffin https://www.gstatic.com/generate_204 Through Muffin
IPv6 [2606:4700:4700::1111]:443 and [2001:4860:4860::8888]:443 Directly, a TCP connection only

“Directly” means the service’s own connection, outside Muffin’s proxies. In TUN mode the system routes such connections into the TUN interface like any other program’s, so they follow the rules too; only the node test keeps to the physical network, as the kernel’s own connections do. The Overview runs the exit lookup through Muffin and the reachability check by itself while the kernel runs.

The Logs page replays the service’s last 1000 log lines, then shows new ones as they arrive; the window keeps up to 2000. A strip above the list counts the warnings and errors of the last hour, and clicking one filters to it. It also shows the service’s log level, with a link to change it in Settings.

Control What it does
All, Debug, Info, Warn, Error Shows that level and the ones above it
Search logs Filters by text
Pause / Resume Freezes the list; new lines wait
Clear Empties the window’s copy of the log
Export… Saves the lines shown to a file, muffin-<date>-<time>.log in your Downloads folder by default
Diagnostic Bundle… Opens Diagnostics

The list follows the newest line while it is scrolled to the bottom; Jump to Latest brings it back there. Click a line to see it in full, with Copy.

The service also writes its log to the system:

The service runs as the systemd user unit muffin-service.service, so its log is in the journal:

Terminal window
journalctl --user -u muffin-service -e

The Connections page lists every connection through the kernel. While the page is open, Muffin asks the kernel for the list every second.

  • Active and Closed switch between open connections and those that ended while the page was open. A closed connection stays listed for 10 minutes, 500 at most.
  • Filter by route (Proxy, Direct, Reject), by network (TCP, UDP), by inbound (HTTP, SOCKS, TUN), and by text in the host, group or node. Group by app is marked Needs engine: the kernel does not report which program opened a connection.
  • Each row shows the host and the source, the route group that matched (Default when no rule did) and where it went, the network, the current speed (or, once closed, the bytes received and the time it ended), and how long it has lasted. Connections of a rejecting group show Blocked.
  • Click a row for its details: the destination, the sniffed host, the source, the matched group, the network, when it started, its duration, its traffic, and its download speed over the last 30 seconds. Close Connection closes it.
  • Pause freezes the list. Close All closes every open connection, as Close All Connections in the tray menu does.

The Rules page lists the rules of the active profile in the order the kernel tries them: one row per value of each route group’s matchers, with its kind, such as domain_suffix or geoip, the group it belongs to and where that group goes now. The first match wins, and the last row, Default, catches everything no rule above matches. Filter the rows by text, or by group with the chips above the list.

Rules apply in Rule mode only, so the page is empty in Global and Direct mode. The side column holds Geo data, with Update Now (see Geodata), and a reference of the rule kinds. Where does it go?, a tester for a domain or address, is marked Needs engine and is not available in 0.3.0.

Linux macOS Windows
Service data ~/.local/share/muffin ~/Library/Application Support/muffin %APPDATA%\muffin
gui.toml ~/.config/muffin The service data directory The service data directory
Local socket $XDG_RUNTIME_DIR/muffin/service.sock service.sock in the service data directory, or /var/run/muffin-service.<uid>.sock with the TUN permission The named pipe \\.\pipe\muffin-service-<your SID>

The service data directory holds:

File Contents
settings.toml Your settings; see Settings
profiles.toml The list of profiles: names, URLs, request headers, update intervals, picks, and which one is active
profiles/<id>.toml Each profile’s subscribe file, after conversion for a subscription in another format
geo/geoip.dat, geo/geosite.dat Downloaded geodata
runtime/config.toml, runtime/subscribe.toml The kernel configuration and subscribe file Muffin last applied

The directories are readable by your user only. Settings › Data › Data folder › Open opens the service data directory. Runtime Config, in Settings › Data and in the Profiles page’s More menu, opens runtime/config.toml, which shows exactly what the kernel runs: the inbounds, the DNS setup in TUN mode, the geodata paths and the route picks.

While the window cannot reach the service, a banner says Muffin service is not reachable, with the reason and a Retry button that starts the service again, and the sidebar says Service unavailable.

Message Cause What to do
Muffin service is not reachable The service is not running, or failed to start. Click Retry, then read the service log above. On Linux, systemctl --user status muffin-service shows why it stopped.
muffin-service binary not found next to muffin muffin-service is not in the same directory as muffin. Reinstall, or keep both files of the tarball together.
Kernel stopped, with an error, on the Overview The service runs, but the kernel could not start with the current configuration. Fix what the error names: use another profile, update the profile, or change the setting. Then click Restart Kernel, on the Overview or in Settings › Advanced.
kernel not running A request to the kernel’s API while the kernel is stopped. As above.
Message Cause What to do
invalid URL: only http and https are supported The link is not an http or https URL, or not a URL at all. Copy the subscription link again.
the subscription is larger than 10 MiB The answer is not a subscription, or a very large one. Check the link with your provider.
A TOML parse error, or another error from the kernel The answer is in none of the formats Muffin converts, or the kernel refuses the result. Import File takes subscribe files only. Ask your provider for a link in a format Muffin reads; see Profiles. To import from disk, use an Etemenanki subscribe file.
converting the subscription: … Muffin recognised the format but could not convert it, usually because none of its nodes can run on the kernel. The service log names each node left out and says why: proxy "<name>" left out: …. Ask your provider for nodes of a protocol Etemenanki supports.
downloading geo data: … The profile’s route groups match by geosite or geoip, as a converted profile’s do, and Muffin could not download a missing geodata file from the URL in [geo]. Make sure the URL in the message is reachable, change it in Settings › Data, or put geoip.dat and geosite.dat in the geo directory of the service data directory yourself.
A profile’s provider sends a different format, or fewer nodes, than expected Some providers choose by the User-Agent. Clear the profile’s User-Agent in Edit Info to send Muffin’s own, or set the one the provider expects; see Request headers.
Cannot delete the active profile The profile is the one in use. Use another profile first.

A failed update keeps the old file; the profile shows the error until the next successful update. In error messages, a subscription URL appears with its scheme, host and port only, and request headers never appear.

Message Cause What to do
TUN needs the permission to create a network device; grant it in Settings The permission was never granted, or Muffin was upgraded since. Settings › TUN › Grant Permission….
Granting the TUN permission failed The administrator prompt failed or was cancelled. On Windows: the administrator prompt was declined. Try again. On Linux, run the sudo command Muffin shows.
TUN mode cannot use the "system" DNS server in this profile's [dns] The profile’s [dns] uses the system resolver. Use another profile, or the system proxy instead.
no default route to bind the kernel's sockets to: connect to a network first macOS or Windows, with no network connected. Connect, then turn TUN mode on.
Nothing loads after moving to another network macOS or Windows: the proxy’s sockets are still bound to the old network. Turn TUN mode off and on.
Turned on, but not running in Settings › TUN TUN mode is switched on, but the device did not come up. Read the Logs page; switch TUN mode off and on.
Symptom Cause What to do
The switch is disabled: System proxy is not supported on this desktop A Linux desktop other than GNOME, Unity, Cinnamon, Budgie, MATE or KDE, or GNOME without gsettings. Use TUN mode, or point programs at 127.0.0.1:7890 yourself.
System Proxy Off: Kernel Not Running on the Overview The switch is on, but the kernel does not run, so Muffin leaves the system proxy unset. Fix the kernel; see above.
A program ignores the system proxy Not every program follows it; terminal programs read environment variables instead. Settings › Network › Terminal for terminals, or TUN mode.
The proxy is still set after Muffin is gone Muffin was killed, or the computer lost power, before it could clear the setting. Start Muffin and stop it with Stop Proxy and Quit, or clear the proxy in the system settings.

The window talks to the service over HTTP on the local socket above, which only your user can open; on Linux and macOS it is a Unix socket with mode 0600 in a private directory. GET /muffin/v1/status returns the service’s state. Every path outside /muffin/v1/ goes to the running kernel’s REST API, the same API etemenanki-app serves, so tools written for it can read the routes, traffic and connections:

Terminal window
curl --unix-socket "$XDG_RUNTIME_DIR/muffin/service.sock" http://muffin/v1/connections

Without a running kernel, those paths answer 503 with kernel not running.