Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Element fails to set up keys upon registration of new user #692

Open
nomelif opened this issue Mar 2, 2025 · 1 comment
Open

Element fails to set up keys upon registration of new user #692

nomelif opened this issue Mar 2, 2025 · 1 comment

Comments

@nomelif
Copy link

nomelif commented Mar 2, 2025

Hi!

I have a freshly installed conduwuit instance and am attempting to create an account for it using Element desktop. Upon registration, element makes a request to /_matrix/client/v3/keys/device_signing/upload with the following payload (of which I have redacted keys and my server's domain for privacy reasons):

{
  "master_key": {
    "keys": {
      "ed25519:<snip>": "<snip>"
    },
    "signatures": {
      "@demotili2:<snip>": {
        "ed25519:<snip>": "<snip>",
        "ed25519:<snip>": "<snip>"
      }
    },
    "usage": [
      "master"
    ],
    "user_id": "@demotili2:<snip my server>"
  },
  "self_signing_key": {
    "keys": {
      "ed25519:<snip>": "<snip>"
    },
    "signatures": {
      "@demotili2:<snip>": {
        "ed25519:<snip>": "<snip>"
      }
    },
    "usage": [
      "self_signing"
    ],
    "user_id": "@demotili2:<snip>"
  },
  "user_signing_key": {
    "keys": {
      "ed25519:<snip>": "<snip>"
    },
    "signatures": {
      "@demotili2:<snip>": {
        "ed25519:<snip>": "<snip>"
      }
    },
    "usage": [
      "user_signing"
    ],
    "user_id": "@demotili2:<snip>"
  },
  "auth": {}
}

I receive the following response:

{
    "errcode": "M_BAD_JSON",
    "error": "M_BAD_JSON: deserialization failed: missing field `session` at line 1 column 2"
}

Element throws up this error:

Image

I am reasonably confident this is the same issue that has been litigated here on Element's side: element-hq/element-web#27501 and here in upstream conduit: https://gitlab.com/famedly/conduit/-/issues/488 Conduit mentions it is transient, and Element seems to set itself up without complaining upon clicking on retry. I am not well enough versed in this to say, whether this was a clean setup upon retry or not.

As I understand it, the crux of the issue is that element sends an empty auth attribute, which conduwuit doesn't like. According to people in the Element bug report, the spec doesn't explicitly forbid sending an empty auth attribute as opposed to sending none at all.

Would it be difficult for conduwuit to accept and silently drop an empty auth response?

PS: I am running inside podman, but I am reasonably confident this is not podman-related. The exact container version I am using is https://hub.docker.com/layers/girlbossceo/conduwuit/latest/images/sha256-104ecefe731e4417128735dd6356cead491ef3a8c827e683467ebd1c70488485

@nomelif
Copy link
Author

nomelif commented Mar 2, 2025

It would seem that this is fixed in https://github.com/girlbossceo/conduwuit/tree/msc3967. I'll leave this issue up until that is merged if that's ok by you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant