broken pt config can create a broken state, preventing from bootstaping after fixing the issue
When trying to connect to a broken bridge (in this case, PT kind not registered), arti store something in its state directory, which causes it to not try to run PTs on subsequent restarts.
How to reproduce:
- run the snowflake example (not yet merged, in !1216 (merged)), it works
- comment one bridge line, break the other, for instance change the PT kind from
snowflake
tosnowflak
- run the example, it fails as expected
- restore the file
- run the example, it fails again. Interestingly, no line from
tor_ptmgr
ever get logged.
shell logs
trinity@zenby ~/d/t/c/a/c/arti-client (pt-snowflake) [SIGINT]> cargo run --example snowflake --features pt-client
Finished dev [unoptimized + debuginfo] target(s) in 0.23s
Running `/home/trinity/dev/tor/core/arti/target/debug/examples/snowflake`
connecting to Tor...
2023-06-07T21:22:31.966319Z INFO tor_dirmgr: Marked consensus usable.
2023-06-07T21:22:31.971166Z INFO tor_dirmgr: Loaded a good directory from cache.
connecting to example.com...
2023-06-07T21:22:32.263816Z INFO tor_ptmgr: Got a request for transport snowflake, which is not currently running. Launching it.
2023-06-07T21:22:32.264050Z INFO tor_ptmgr::ipc: Launching pluggable transport at /sbin/snowflake-pt-client for [PtTransportName("snowflake")]
2023-06-07T21:22:32.268040Z INFO tor_ptmgr::ipc: Transport 'snowflake' uses method PtClientMethod { kind: V5, endpoint: 127.0.0.1:36513 }
2023-06-07T21:22:32.268074Z INFO tor_ptmgr::ipc: PT binary initialisation done
2023-06-07T21:22:32.268150Z INFO tor_ptmgr: Successfully launched PT for snowflake at PtClientMethod { kind: V5, endpoint: 127.0.0.1:36513 }.
2023-06-07T21:22:32.416115Z INFO tor_ptmgr::ipc: [pt snowflake-pt-client] offer created
2023-06-07T21:22:32.993817Z INFO tor_ptmgr::ipc: [pt snowflake-pt-client] broker rendezvous peer received
2023-06-07T21:22:33.192347Z INFO tor_dirmgr: Marked consensus usable.
2023-06-07T21:22:33.196673Z INFO tor_dirmgr: Directory is complete. attempt=1
2023-06-07T21:22:33.345261Z INFO tor_ptmgr::ipc: [pt snowflake-pt-client] connected
2023-06-07T21:22:34.774159Z INFO tor_guardmgr::guard: We have found that guard [192.x.x.x:80 via snowflake 1z…] is usable.
sending request...
reading response...
HTTP/1.1 200 OK
<redacted for conciseness>
trinity@zenby ~/d/t/c/a/c/arti-client (pt-snowflake)> vim examples/snowflake.rs # comment one bridge, change to pt kind to `snowflak` on the other
trinity@zenby ~/d/t/c/a/c/arti-client (pt-snowflake)> cargo run --example snowflake --features pt-client
Compiling arti-client v0.9.1 (/home/trinity/dev/tor/core/arti/crates/arti-client)
warning: unused variable: `bridge_1`
--> crates/arti-client/examples/snowflake.rs:30:9
|
30 | let bridge_1: BridgeConfigBuilder = BRIDGE1_LINE.parse()?;
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_bridge_1`
|
= note: `#[warn(unused_variables)]` on by default
warning: `arti-client` (example "snowflake") generated 1 warning
Finished dev [unoptimized + debuginfo] target(s) in 1.68s
Running `/home/trinity/dev/tor/core/arti/target/debug/examples/snowflake`
connecting to Tor...
2023-06-07T21:22:44.695698Z INFO tor_dirmgr: Marked consensus usable.
2023-06-07T21:22:44.696135Z WARN tor_circmgr: Problem launching a timeout testing circuit: error: Unable to select a guard relay: No usable guards. Rejected 2/2 as down, then 0/0 as pending, then 0/0 as unsuitable to purpose, then 0/0 with filter.
2023-06-07T21:22:44.700623Z INFO tor_dirmgr: Loaded a good directory from cache.
connecting to example.com...
2023-06-07T21:22:45.927859Z INFO tor_dirmgr: Marked consensus usable.
2023-06-07T21:22:45.932017Z INFO tor_dirmgr: Directory is complete. attempt=1
^C⏎
trinity@zenby ~/d/t/c/a/c/arti-client (pt-snowflake)> vim examples/snowflake.rs # restore the file
trinity@zenby ~/d/t/c/a/c/arti-client (pt-snowflake) [SIGINT]> cargo run --example snowflake --features pt-client
Compiling arti-client v0.9.1 (/home/trinity/dev/tor/core/arti/crates/arti-client)
Finished dev [unoptimized + debuginfo] target(s) in 2.77s
Running `/home/trinity/dev/tor/core/arti/target/debug/examples/snowflake`
connecting to Tor...
2023-06-07T21:23:03.295584Z INFO tor_dirmgr: Marked consensus usable.
2023-06-07T21:23:03.297077Z WARN tor_circmgr: Problem launching a timeout testing circuit: error: Unable to select a guard relay: No usable guards. Rejected 2/2 as down, then 0/0 as pending, then 0/0 as unsuitable to purpose, then 0/0 with filter.
2023-06-07T21:23:03.300749Z INFO tor_dirmgr: Loaded a good directory from cache.
connecting to example.com...
2023-06-07T21:23:04.516865Z INFO tor_dirmgr: Marked consensus usable.
2023-06-07T21:23:04.521279Z INFO tor_dirmgr: Directory is complete. attempt=1
^C⏎
trinity@zenby ~/d/t/c/a/c/arti-client (pt-snowflake) [SIGINT]>
loosely related to #177