dendrite icon indicating copy to clipboard operation
dendrite copied to clipboard

Can't leave a room that re-appeared because of "storage: state NIDs missing from the database (0 != 1)"

Open PureTryOut opened this issue 2 years ago • 6 comments

Background information

  • Dendrite version or git SHA: 0.6.4
  • Monolith or Polylith?: Monolith
  • SQLite3 or Postgres?: PostgreSQL
  • Running in Docker?: No
  • go version: 1.17.7
  • Client used (if applicable): Element web in Firefox

Description

  • What is the problem: A room I left before suddenly re-appeared and now I'm unable to leave it because of storage: state NIDs missing from the database (0 != 1)
  • Who is affected: Myself, only user of my server
  • How is this bug manifesting: As I said, the room re-appeared out of nothing after I already left it before and now I'm just trying to leave it again
  • When did this first appear: Like 2 or so weeks ago, it doesn't seem to be related to a specific version upgrade

Steps to reproduce

I'm not sure how to best reproduce this to be honest. It happened after a room I had left before suddenly re-appeared and I'm unsure how that happened in the first place.

PureTryOut avatar Feb 27 '22 07:02 PureTryOut

Have you deleted your database in the past? It's likely that another server has told you that you're in the room and Dendrite is trying to reconcile that. It's probably failing to do this such that you now cannot leave that room. I'll see if I can make a Complement test for this.

kegsay avatar Feb 28 '22 10:02 kegsay

Also, just to check, this is a federated room right?

kegsay avatar Feb 28 '22 10:02 kegsay

It is a federated room yes. I have not deleted a Dendrite database in the past but I have switched from Synapse to Dendrite without transferring the database, although that was like 1 to 2 years ago.

PureTryOut avatar Feb 28 '22 15:02 PureTryOut

The failure mode will most likely be that one server thinks you're in the room via your old Synapse, but Dendrite knows nothing about this. Either way, we should be handling this case a lot better.

kegsay avatar Feb 28 '22 18:02 kegsay

Well I used to be in this room with Dendrite too but I left most rooms a while ago in an effort to get incoming federation performant again. It didn't help sadly but I'd assume that particular server would have seen the leave event.

PureTryOut avatar Feb 28 '22 20:02 PureTryOut

Same here. I'm getting the same issue even though I joined with dendrite server before.

nakoo avatar Apr 27 '22 19:04 nakoo