Connection settings can save overrides that prevent the next startup #1074

Open
opened 2026-11-05 14:50:21 +00:00 by jarolrod · 3 comments
jarolrod commented 2026-11-05 14:50:21 +00:00 (Migrated from github.com)

The Connection settings pages allow changes that conflict with existing startup options. The change is saved with a restart notice, but the resulting configuration prevents the node from starting on subsequent launches.

Core correctly rejects these combinations. QML should detect the conflict before persisting the override and provide a way to recover if startup fails.

Disabling listening while another option requires it

  1. Start a disposable regtest profile with bind=127.0.0.1 in its bitcoin.conf network section.
  2. Open Settings → Connection.
  3. Switch Enable listening off.
  4. Restart the application.

QML writes "listen": false to settings.json. The next startup fails with:

Cannot set -bind or -whitebind together with -listen=0

The page recognizes that listening was adjusted by related startup options, but still permits the incompatible override.

The same problem occurs with whitebind. With explicit listenonion=1, disabling listening instead produces:

Cannot set -listen=0 together with -listenonion=1

Disabling the Tor proxy in a Tor-only configuration

  1. Start a disposable regtest profile with these settings under [regtest]:
    • onion=127.0.0.1:9050
    • onlynet=onion
  2. Open Settings → Connection → Proxy settings.
  3. Switch the Tor proxy off and save.
  4. Restart the application.

QML writes "onion": false, which Core interprets as -onion=0. Startup then fails because outbound connections are restricted to Tor while reaching Tor has been explicitly disabled.

There is also a default-proxy variant: with proxy=127.0.0.1:9050, onlynet=onion, and listenonion=0, disabling the default proxy leaves no configured Tor route and prevents startup. This condition matters: the control with listening and listenonion enabled started successfully.

The same controls are available during onboarding, where they can persist an incompatible override before the first node startup.

Expected behavior and responsibility

Before saving, QML should check the resulting effective configuration, including related options from bitcoin.conf. It should explain the conflict and prevent saving a combination Core cannot start with.

The proxy controls should also distinguish disabling a dedicated Tor proxy from disabling Tor connectivity, particularly when Tor is the only permitted network.

If a saved GUI override prevents startup, the error flow should offer a way to undo that override and retry. In the reproductions, manually removing the offending key from settings.json restored startup.

The defect is in QML’s settings checks and recovery flow. Core’s rejection of the incompatible configuration is expected behavior.

Reproduced on qt6 at d567e3eb2497, macOS arm64, Qt 6.9.0, offscreen and in the native GUI, using disposable regtest profiles.

The Connection settings pages allow changes that conflict with existing startup options. The change is saved with a restart notice, but the resulting configuration prevents the node from starting on subsequent launches. Core correctly rejects these combinations. QML should detect the conflict before persisting the override and provide a way to recover if startup fails. **Disabling listening while another option requires it** 1. Start a disposable regtest profile with `bind=127.0.0.1` in its `bitcoin.conf` network section. 2. Open **Settings → Connection**. 3. Switch **Enable listening** off. 4. Restart the application. QML writes `"listen": false` to `settings.json`. The next startup fails with: `Cannot set -bind or -whitebind together with -listen=0` The page recognizes that listening was adjusted by related startup options, but still permits the incompatible override. The same problem occurs with `whitebind`. With explicit `listenonion=1`, disabling listening instead produces: `Cannot set -listen=0 together with -listenonion=1` **Disabling the Tor proxy in a Tor-only configuration** 1. Start a disposable regtest profile with these settings under `[regtest]`: - `onion=127.0.0.1:9050` - `onlynet=onion` 2. Open **Settings → Connection → Proxy settings**. 3. Switch the Tor proxy off and save. 4. Restart the application. QML writes `"onion": false`, which Core interprets as `-onion=0`. Startup then fails because outbound connections are restricted to Tor while reaching Tor has been explicitly disabled. There is also a default-proxy variant: with `proxy=127.0.0.1:9050`, `onlynet=onion`, and `listenonion=0`, disabling the default proxy leaves no configured Tor route and prevents startup. This condition matters: the control with listening and `listenonion` enabled started successfully. The same controls are available during onboarding, where they can persist an incompatible override before the first node startup. **Expected behavior and responsibility** Before saving, QML should check the resulting effective configuration, including related options from `bitcoin.conf`. It should explain the conflict and prevent saving a combination Core cannot start with. The proxy controls should also distinguish disabling a dedicated Tor proxy from disabling Tor connectivity, particularly when Tor is the only permitted network. If a saved GUI override prevents startup, the error flow should offer a way to undo that override and retry. In the reproductions, manually removing the offending key from `settings.json` restored startup. The defect is in QML’s settings checks and recovery flow. Core’s rejection of the incompatible configuration is expected behavior. Reproduced on `qt6` at `d567e3eb2497`, macOS arm64, Qt 6.9.0, offscreen and in the native GUI, using disposable regtest profiles.
jarolrod commented 2026-11-06 19:56:24 +00:00 (Migrated from github.com)

The startup-recovery work here should also cover a saved proxy hostname that cannot resolve. This case can occur without a conflicting option combination.

On qt6 at 6e54a48ab571, using a disposable regtest profile:

  1. Open Settings → Connection → Proxy settings.
  2. Enable the default proxy, enter nosuchhost.invalid:9050, and save.
  3. Restart the application.

The saved value produces:

Invalid -proxy address or hostname: 'nosuchhost.invalid:9050'

The error dialog offers only OK. Acknowledging it shuts the application down, leaving the saved value in place and no GUI route back to edit it. Removing that test profile's proxy setting manually restores startup. The control using localhost:9050 starts normally and resolves the proxy to 127.0.0.1:9050.

Hostname support is intentional, and Core's refusal to use an unresolved proxy is expected. The missing piece is a GUI recovery path: let the user correct the saved address or retry after resolution becomes available, while preserving the configured routing until they explicitly change it. Checking DNS when saving cannot guarantee it will resolve at a later startup.

#883 handles earlier configuration and settings-file failures; its current changes do not add recovery for this later proxy-resolution failure. This fits the recovery work already requested here rather than needing a separate issue.

The startup-recovery work here should also cover a saved proxy hostname that cannot resolve. This case can occur without a conflicting option combination. On `qt6` at `6e54a48ab571`, using a disposable regtest profile: 1. Open Settings → Connection → Proxy settings. 2. Enable the default proxy, enter `nosuchhost.invalid:9050`, and save. 3. Restart the application. The saved value produces: ```text Invalid -proxy address or hostname: 'nosuchhost.invalid:9050' ``` The error dialog offers only OK. Acknowledging it shuts the application down, leaving the saved value in place and no GUI route back to edit it. Removing that test profile's `proxy` setting manually restores startup. The control using `localhost:9050` starts normally and resolves the proxy to `127.0.0.1:9050`. Hostname support is intentional, and Core's refusal to use an unresolved proxy is expected. The missing piece is a GUI recovery path: let the user correct the saved address or retry after resolution becomes available, while preserving the configured routing until they explicitly change it. Checking DNS when saving cannot guarantee it will resolve at a later startup. #883 handles earlier configuration and settings-file failures; its current changes do not add recovery for this later proxy-resolution failure. This fits the recovery work already requested here rather than needing a separate issue.
jarolrod commented 2026-11-10 13:05:57 +00:00 (Migrated from github.com)

The effective-configuration checks here should also cover the Mempool size limit. With the nondefault debug option limitclustersize=250, the GUI accepts and saves 9 MB, but the next startup requires at least 10 MB.

To reproduce:

  1. Start a disposable regtest profile with limitclustersize=250 in its network configuration and no maxmempool override. The node starts with the usual 300 MB limit.
  2. Open Settings → Mempool information, enter 9 for Mempool size limit (MB), and press Return.
  3. The edit is accepted, a restart notice appears, and regtest/settings.json contains "maxmempool": 9.
  4. Restart the same profile.

Startup fails with:

-maxmempool must be at least 10 MB

With the same cluster policy, 10 MB saves and restarts successfully. With the default policy, 9 MB saves and restarts successfully, while the editor correctly refuses 4 MB. The failure depends on the nondefault cluster-size setting.

Core correctly checks the minimum against the effective cluster size. QML derives its lower bound from the compiled default, so its validator and commit handler accept a value that the configured node cannot use.

The editor should use the effective minimum before saving. This also belongs in the startup-recovery work requested here, so an invalid GUI override can be corrected without manually editing the settings file.

Reproduced on qt6 at 6e54a48ab571, macOS / Qt 6.9, using the full offscreen app and isolated regtest profiles. Current merged eed1f426fcb6 still has the same mismatch between QML's static bound and Core's effective-policy check; that later revision was checked in source, not rerun for this case.

The effective-configuration checks here should also cover the Mempool size limit. With the nondefault debug option `limitclustersize=250`, the GUI accepts and saves **9 MB**, but the next startup requires at least **10 MB**. To reproduce: 1. Start a disposable regtest profile with `limitclustersize=250` in its network configuration and no `maxmempool` override. The node starts with the usual **300 MB** limit. 2. Open Settings → Mempool information, enter **9** for **Mempool size limit (MB)**, and press Return. 3. The edit is accepted, a restart notice appears, and `regtest/settings.json` contains `"maxmempool": 9`. 4. Restart the same profile. Startup fails with: ```text -maxmempool must be at least 10 MB ``` With the same cluster policy, **10 MB** saves and restarts successfully. With the default policy, **9 MB** saves and restarts successfully, while the editor correctly refuses **4 MB**. The failure depends on the nondefault cluster-size setting. Core correctly checks the minimum against the effective cluster size. QML derives its lower bound from the compiled default, so its validator and commit handler accept a value that the configured node cannot use. The editor should use the effective minimum before saving. This also belongs in the startup-recovery work requested here, so an invalid GUI override can be corrected without manually editing the settings file. Reproduced on `qt6` at `6e54a48ab571`, macOS / Qt 6.9, using the full offscreen app and isolated regtest profiles. Current merged `eed1f426fcb6` still has the same mismatch between QML's static bound and Core's effective-policy check; that later revision was checked in source, not rerun for this case.
jarolrod commented 2026-11-13 19:10:39 +00:00 (Migrated from github.com)

The recovery work here should also cover a start that fails at the end of onboarding. The wizard cannot be resumed, and the choices made in it are lost.

To reproduce on a regtest profile:

  1. Make the network sub-folder of the data directory unwritable (chmod 0555 <datadir>/regtest).
  2. Walk the first-run wizard, choose Reduce storage, and click Start.

An alert in the wizard says "There was an issue starting up." with "Unable to open settings file …/regtest/settings.json.tmp for writing" and a single Close, which exits with status 1. (At 2bd5a61e8304, before #1052, there was no message: the wizard stayed a black screen with a spinner, and the process was still alive 10 s later.) Nothing is written: there is no settings.json, and the chosen folder is not remembered. After quitting, restoring the permission and starting again, the wizard begins at its cover with Default and Store all data selected, and has to be walked again. 3 of 3, and the same at eed1f426fcb6.

A failed start shows the error in the wizard and then exits, with no way back to the wizard:

github.com/bitcoin-core/gui-qml@efc4a2c754/qml/bitcoin.cpp (L537-L545)

Reach is small. A chosen folder that is itself read-only is refused on the location page, so on mainnet this is caught before Start; only a network sub-folder slips through. When the folder is held by another node, the choices are written before the failure and the next start goes straight to the main window. #883 at 976e00e4826c and #1050 at f68f5bf24c50 do not add a way back to the wizard, by their diffs.

Reproduced on qt6 at 2bd5a61e8304, macOS arm64 / Qt 6.9.0, isolated regtest, offscreen only. At efc4a2c754eb I read the alert and clicked Close through the test bridge (one run); at 2bd5a61e8304 I read the error from stderr only. Clicks went through the test bridge, and the custom folder was passed with the call the folder dialog makes.

The recovery work here should also cover a start that fails at the end of onboarding. The wizard cannot be resumed, and the choices made in it are lost. To reproduce on a regtest profile: 1. Make the network sub-folder of the data directory unwritable (`chmod 0555 <datadir>/regtest`). 2. Walk the first-run wizard, choose **Reduce storage**, and click **Start**. An alert in the wizard says "There was an issue starting up." with "Unable to open settings file …/regtest/settings.json.tmp for writing" and a single **Close**, which exits with status 1. (At `2bd5a61e8304`, before #1052, there was no message: the wizard stayed a black screen with a spinner, and the process was still alive 10 s later.) Nothing is written: there is no `settings.json`, and the chosen folder is not remembered. After quitting, restoring the permission and starting again, the wizard begins at its cover with Default and **Store all data** selected, and has to be walked again. 3 of 3, and the same at `eed1f426fcb6`. A failed start shows the error in the wizard and then exits, with no way back to the wizard: https://github.com/bitcoin-core/gui-qml/blob/efc4a2c754eb74b1d370e4bf2313ed8d22988a36/qml/bitcoin.cpp#L537-L545 Reach is small. A chosen folder that is itself read-only is refused on the location page, so on mainnet this is caught before **Start**; only a network sub-folder slips through. When the folder is held by another node, the choices are written before the failure and the next start goes straight to the main window. #883 at `976e00e4826c` and #1050 at `f68f5bf24c50` do not add a way back to the wizard, by their diffs. Reproduced on `qt6` at `2bd5a61e8304`, macOS arm64 / Qt 6.9.0, isolated regtest, offscreen only. At `efc4a2c754eb` I read the alert and clicked **Close** through the test bridge (one run); at `2bd5a61e8304` I read the error from stderr only. Clicks went through the test bridge, and the custom folder was passed with the call the folder dialog makes.
Sign in to join this conversation.
No description provided.