debug mode panic over double serialization #1079

Open
opened 2025-09-25 13:11:13 +00:00 by nex · 1 comment
Owner
2025-09-25T13:10:11.973794Z DEBUG router{method=POST path=/_matrix/client/v3/rooms}:request:handle{active=5 handled=717}:invite{client=79.127.145.84}:pdu{room_id=!nx4lB9bnxegmEXVaAN:timedout.uk event_id=$678tz9DfYAFeh2U3QewYbvTTtYq1HAYne76bolwntyY}: conduwuit_service::rooms::event_handler::upgrade_outlier_pdu: Forcing new room state
thread 'conduwuit:worker' panicked at /home/nex/RustroverProjects/continuwuity/src/database/ser.rs:253:3:
serializing string at the top-level; you can skip serialization instead
  2025-09-25T13:10:11.978523Z ERROR conduwuit_router::layers: serializing string at the top-level; you can skip serialization instead
    at src/router/layers.rs:190 on conduwuit:worker ThreadId(2)
    in conduwuit_router::layers::panic
    in conduwuit_router::request::handle with active=5 handled=717
    in conduwuit_router::request::request
    in conduwuit_router::layers::router with method=POST path=/_matrix/client/v3/rooms
  2025-09-25T13:10:11.980330Z ERROR conduwuit_router::request: 500 Internal Server Error, method: POST, uri: /_matrix/client/v3/rooms/!nx4lB9bnxegmEXVaAN%3Atimedout.uk/invite
    at src/router/request.rs:105 on conduwuit:worker ThreadId(2)
    in conduwuit_router::request::request
    in conduwuit_router::layers::router with method=POST path=/_matrix/client/v3/rooms
  2025-09-25T13:10:11.980883Z ERROR tower_http::trace::on_failure: response failed, classification: Status code: 500 Internal Server Error, latency: 272 ms
    at /home/nex/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tower-http-0.6.6/src/trace/on_failure.rs:93 on conduwuit:worker ThreadId(2)
    in conduwuit_router::layers::router with method=POST path=/_matrix/client/v3/rooms
``` 2025-09-25T13:10:11.973794Z DEBUG router{method=POST path=/_matrix/client/v3/rooms}:request:handle{active=5 handled=717}:invite{client=79.127.145.84}:pdu{room_id=!nx4lB9bnxegmEXVaAN:timedout.uk event_id=$678tz9DfYAFeh2U3QewYbvTTtYq1HAYne76bolwntyY}: conduwuit_service::rooms::event_handler::upgrade_outlier_pdu: Forcing new room state thread 'conduwuit:worker' panicked at /home/nex/RustroverProjects/continuwuity/src/database/ser.rs:253:3: serializing string at the top-level; you can skip serialization instead 2025-09-25T13:10:11.978523Z ERROR conduwuit_router::layers: serializing string at the top-level; you can skip serialization instead at src/router/layers.rs:190 on conduwuit:worker ThreadId(2) in conduwuit_router::layers::panic in conduwuit_router::request::handle with active=5 handled=717 in conduwuit_router::request::request in conduwuit_router::layers::router with method=POST path=/_matrix/client/v3/rooms 2025-09-25T13:10:11.980330Z ERROR conduwuit_router::request: 500 Internal Server Error, method: POST, uri: /_matrix/client/v3/rooms/!nx4lB9bnxegmEXVaAN%3Atimedout.uk/invite at src/router/request.rs:105 on conduwuit:worker ThreadId(2) in conduwuit_router::request::request in conduwuit_router::layers::router with method=POST path=/_matrix/client/v3/rooms 2025-09-25T13:10:11.980883Z ERROR tower_http::trace::on_failure: response failed, classification: Status code: 500 Internal Server Error, latency: 272 ms at /home/nex/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tower-http-0.6.6/src/trace/on_failure.rs:93 on conduwuit:worker ThreadId(2) in conduwuit_router::layers::router with method=POST path=/_matrix/client/v3/rooms ```
nex changed title from debug mode panic over double serialization while processing transaction to debug mode panic over double serialization 2025-09-25 13:13:55 +00:00
Author
Owner

Narrowed it down to this routine

let roomuser_id = (room_id, user_id);
let roomuser_id = serialize_key(roomuser_id).expect("failed to serialize roomuser_id");
let userroom_id = (user_id, room_id);
let userroom_id = serialize_key(userroom_id).expect("failed to serialize userroom_id");
self.db
.userroomid_invitestate
.raw_put(&userroom_id, Json(last_state.unwrap_or_default()));
self.db
.roomuserid_invitecount
.raw_aput::<8, _, _>(&roomuser_id, self.services.globals.next_count().unwrap());
self.db
.userroomid_invitesender
.raw_put(&userroom_id, sender_user);

Narrowed it down to this routine https://forgejo.ellis.link/continuwuation/continuwuity/src/commit/13b7538785596f9686e2c7206ec6379d11dc9635/src/service/rooms/state_cache/update.rs#L355-L369
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
continuwuation/continuwuity#1079
No description provided.