question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inviting a user from a server with allow_profile_lookup_over_federation false gives a confusing error message

See original GitHub issue

We tried inviting a user from a server with allow_profile_lookup_over_federation: false and include_profile_data_on_invite: false (not sure which of those settings is actually relevant here) to an invite-only room. This causes Element to say (I can’t remember the exact error message, sorry) that the profile might be invalid and won’t let us inviting that user. The error on the inviting user’s home server is:

May 11 22:00:12 matrix matrix-synapse-synchrotron9100[3783]: synapse.http.matrixfederationclient - 612 - WARNING - GET-67720 - {GET-O-51} [other.home.server] Request failed: GET matrix://other.home.server/_matrix/federation/v1/query/profile?user_id=%40some.user%3Aother.home.server&field=displayname: HttpResponseException('403: Forbidden‘)

Disabling the “warn before sending invites to invalid Matrix IDs” setting in the Element settings allows inviting the user and the invited user can join the room.

This is a least somewhat inconsistent in the wording as the Matrix ID is not invalid and it is not clear that it is possible to switch off that setting.

It also seems prior Element versions did not hinder inviting users from home servers with the above settings, some other user tried to reproduce this issue on Element 1.7.24 and did not see the above error message.

Element version of the inviting user: 1.7.27 macOS Desktop client Synapse version of the inviting user: 1.33.2 Synapse version of the invited user: 1.31.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:13
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
johannes-krudecommented, Apr 3, 2022

The message displayed by element-web when inviting over the GUI seems to have changed, but the result is still the same.

screenshot_2022-04-01_17:04:51

In the Preferences there is the option Prompt before sending invites to potentially invalid matrix IDs. Disabling this option only changes the behavior of \invite, but not when inviting through the GUI. This option also does not really solve the problem, since I can not control this option for the element-web of the user who wants to invite me over federation.

1reaction
DMRobertsoncommented, Nov 19, 2021

Inviting someone using the “Invite to this room” button yields:

Failed to invite users to the room:

You do not have permission to invite people to this room.

Screenshot from 2021-11-19 12-26-20

I only have the option to press OK.

My client made a request to https://matrix-client.matrix.org/_matrix/client/r0/profile/<MXID> which returned 403. I’m guessing that Element Web doesn’t have logic to handle a 403 or otherwise doesn’t expect it? The surprising thing is that we don’t seem to have tried to make an /invite/ request at all.

In fairness to Element-Web, the spec says the only response codes are 200 and 404. Spec deficiency? https://spec.matrix.org/v1.1/client-server-api/#get_matrixclientv3profileuserid

Read more comments on GitHub >

github_iconTop Results From Across the Web

allow_profile_lookup_over_feder...
A user which is on a server with allow_profile_lookup_over_federation=false can not be invited over federation to a room.
Read more >
"Something went wrong" when trying to add a new user
I went to add an account on my computer for her using settings -> accounts ... store with the error "The Server Stumbled"...
Read more >
Unable to add a team member, getting error
Unable to add [EMAIL ID]. We couldn't send your invitation. try inviting that user again. Every time getting this error. Failed to load...
Read more >
The User is not able to invite a new user to their Process ...
'We are sorry, but we could not create an invitation for the given address. The server responded with the following message. Cannot create...
Read more >
[User Management] Need Help Fixing SMTP Error - Questions
SMTP on my server operates on port 587 so I set N8_SMTP_SSL to false which fails with the error " Could not invite...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found