matrix bridge crashes on start due to empty bridge_state.json #124

Closed
opened 2026-10-04 23:01:28 +02:00 by adam · 0 comments
Owner

When you first start matrix bridge (in docker in my case) the state file gets created empty, bridge tries to load it and crashes during json parsing.

matrix-bridge-1  | 2026-01-04T16:21:51.307705Z  INFO potatomesh_matrix_bridge: Loaded config: Config { potatomesh: PotatomeshConfig { base_url: "https://[HIDDEN]/", poll_interval_secs: 10 }, matrix: MatrixConfig { homeserver: "https://[HIDDEN]", as_token: "[HIDDEN]", server_name: "[HIDDEN]", room_id: "![HIDDEN]" }, state: StateConfig { state_file: "bridge_state.json" } }
matrix-bridge-1  | 2026-01-04T16:21:51.783754Z DEBUG hyper_util::client::legacy::connect::http: connecting to [HIDDEN]:443
matrix-bridge-1  | 2026-01-04T16:21:51.784122Z DEBUG hyper_util::client::legacy::connect::http: connected to [HIDDEN]:443
matrix-bridge-1  | 2026-01-04T16:21:51.788812Z DEBUG hyper_util::client::legacy::pool: pooling idle connection for ("https", [HIDDEN])
matrix-bridge-1  | 2026-01-04T16:21:51.788861Z  INFO potatomesh_matrix_bridge::potatomesh: PotatoMesh API healthy at https://[HIDDEN]/
matrix-bridge-1  | 2026-01-04T16:21:51.789462Z DEBUG hyper_util::client::legacy::connect::http: connecting to [HIDDEN]:443
matrix-bridge-1  | 2026-01-04T16:21:51.792154Z DEBUG hyper_util::client::legacy::connect::http: connected to [HIDDEN]:443
matrix-bridge-1  | 2026-01-04T16:21:51.800321Z  INFO potatomesh_matrix_bridge::matrix: Matrix homeserver healthy at https://[HIDDEN]
matrix-bridge-1  | 2026-01-04T16:21:51.800355Z DEBUG hyper_util::client::legacy::pool: pooling idle connection for ("https", [HIDDEN])
matrix-bridge-1  | Error: EOF while parsing a value at line 1 column 0
matrix-bridge-1 exited with code 1 (restarting)

The workaround is to put "{}" manually into bridge_state.json and restart the bridge.

When you first start matrix bridge (in docker in my case) the state file gets created empty, bridge tries to load it and crashes during json parsing. ``` matrix-bridge-1 | 2026-01-04T16:21:51.307705Z INFO potatomesh_matrix_bridge: Loaded config: Config { potatomesh: PotatomeshConfig { base_url: "https://[HIDDEN]/", poll_interval_secs: 10 }, matrix: MatrixConfig { homeserver: "https://[HIDDEN]", as_token: "[HIDDEN]", server_name: "[HIDDEN]", room_id: "![HIDDEN]" }, state: StateConfig { state_file: "bridge_state.json" } } matrix-bridge-1 | 2026-01-04T16:21:51.783754Z DEBUG hyper_util::client::legacy::connect::http: connecting to [HIDDEN]:443 matrix-bridge-1 | 2026-01-04T16:21:51.784122Z DEBUG hyper_util::client::legacy::connect::http: connected to [HIDDEN]:443 matrix-bridge-1 | 2026-01-04T16:21:51.788812Z DEBUG hyper_util::client::legacy::pool: pooling idle connection for ("https", [HIDDEN]) matrix-bridge-1 | 2026-01-04T16:21:51.788861Z INFO potatomesh_matrix_bridge::potatomesh: PotatoMesh API healthy at https://[HIDDEN]/ matrix-bridge-1 | 2026-01-04T16:21:51.789462Z DEBUG hyper_util::client::legacy::connect::http: connecting to [HIDDEN]:443 matrix-bridge-1 | 2026-01-04T16:21:51.792154Z DEBUG hyper_util::client::legacy::connect::http: connected to [HIDDEN]:443 matrix-bridge-1 | 2026-01-04T16:21:51.800321Z INFO potatomesh_matrix_bridge::matrix: Matrix homeserver healthy at https://[HIDDEN] matrix-bridge-1 | 2026-01-04T16:21:51.800355Z DEBUG hyper_util::client::legacy::pool: pooling idle connection for ("https", [HIDDEN]) matrix-bridge-1 | Error: EOF while parsing a value at line 1 column 0 matrix-bridge-1 exited with code 1 (restarting) ``` The workaround is to put "{}" manually into bridge_state.json and restart the bridge. <!-- github-sync-id:3780825058 -->
adam closed this issue 2026-10-04 23:01:28 +02:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/potato-mesh#124