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

No valid session was found matching that sid and client secret #141

Closed
dev4223 opened this issue Mar 6, 2019 · 10 comments
Closed

No valid session was found matching that sid and client secret #141

dev4223 opened this issue Mar 6, 2019 · 10 comments
Assignees
Labels
support User support (repo no-op)

Comments

@dev4223
Copy link

dev4223 commented Mar 6, 2019

I have a matrix synapse and mxisd installation on debian stretch working.
Only thing is, that I can't validate any email address. Email is sent but after clicking on the link i get the backend page with this message:

{"errcode":"M_NO_VALID_SESSION","error":"No valid session was found matching that sid and client secret","success":false}

This is the log output from mxisd:

Mar 06 23:22:26 debian-server mxisd[20704]: [XNIO-1 task-3] INFO io.kamax.mxisd.session.SessionManager - Server 127.0.0.1 is asking to create session for io.kamax.matrix.ThreePid@3e5a164e (Attempt #1) - Next link: null
Mar 06 23:22:26 debian-server mxisd[20704]: [XNIO-1 task-3] INFO io.kamax.mxisd.session.SessionManager - No existing session for io.kamax.matrix.ThreePid@3e5a164e
Mar 06 23:22:26 debian-server mxisd[20704]: [XNIO-1 task-3] INFO io.kamax.mxisd.session.SessionManager - Generated new session 1551910946043 to validate io.kamax.matrix.ThreePid@3e5a164e from server 127.0.0.1
Mar 06 23:22:26 debian-server mxisd[20704]: [XNIO-1 task-3] INFO io.kamax.mxisd.session.SessionManager - Stored session 1551910946043
Mar 06 23:22:26 debian-server mxisd[20704]: [XNIO-1 task-3] INFO io.kamax.mxisd.session.SessionManager - Session 1551910946043 for io.kamax.matrix.ThreePid@3e5a164e: sending validation notification
Mar 06 23:22:26 debian-server mxisd[20704]: [XNIO-1 task-3] INFO io.kamax.mxisd.threepid.generator.GenericTemplateNotificationGenerator - Generating notification content for 3PID Session validation
Mar 06 23:22:26 debian-server mxisd[20704]: [XNIO-1 task-3] INFO io.kamax.mxisd.threepid.connector.email.EmailSmtpConnector - Sending invite to [email protected] via SMTP using v078727.kasserver.com:587
Mar 06 23:22:26 debian-server mxisd[20704]: [XNIO-1 task-3] INFO io.kamax.mxisd.threepid.connector.email.EmailSmtpConnector - Connecting to mx.emailserver.com:587
Mar 06 23:22:26 debian-server mxisd[20704]: [XNIO-1 task-3] INFO io.kamax.mxisd.threepid.connector.email.EmailSmtpConnector - Using SMTP authentication
Mar 06 23:22:26 debian-server mxisd[20704]: [XNIO-1 task-3] INFO io.kamax.mxisd.threepid.connector.email.EmailSmtpConnector - Invite to [email protected] was sent
Mar 06 23:22:44 debian-server mxisd[20704]: [XNIO-1 task-4] INFO io.kamax.mxisd.http.undertow.handler.identity.v1.SessionValidateHandler - Validating session null for medium email
Mar 06 23:22:44 debian-server mxisd[20704]: [XNIO-1 task-4] INFO io.kamax.mxisd.http.undertow.handler.BasicHttpHandler - Request GET http://my.matrixserver.de/_matrix/identity/api/v1/validate/email/submitToken - Error M_NO_VALID_SESSION: No valid session was found matching that sid and client secret

Do you have any ideas about this error message?

@maxidorius maxidorius self-assigned this Mar 6, 2019
@maxidorius maxidorius added the support User support (repo no-op) label Mar 6, 2019
@maxidorius
Copy link
Member

I've fix the log so it shows as codeblock, easier to read!

Could you give us the following info:

  • Which version of mxisd are you using and how did you install it
  • Which version of synapse are you using

@dev4223
Copy link
Author

dev4223 commented Mar 6, 2019

I've installed the lates matrix synapse package for debian stretch yesterday:
Package: matrix-synapse-py3
Version: 0.99.2+stretch1

and installed the latest stable mxisd package for debain today:
mxisd_1.3.1_all.deb

@maxidorius
Copy link
Member

Could you please provide the link here, changing your domain if needed, but putting the rest of the URL verbatim? I would like to make sure the info in the email sent is right first. If you would rather not post it publicly, you can send it to me via email (see my github profile) or on Matrix (@max:kamax.io)

@maxidorius
Copy link
Member

Thanks for sending it - I can confirm it looks good. I'll investigate for a regression and let you know ASAP, but will update this in a few days either way.

@dev4223
Copy link
Author

dev4223 commented Mar 7, 2019

Thanks, thats good news and I'll wait.
Could it be, that the BasicHttpHandler sends his request per GET to http://my.matrixserver.de/_matrix/identity/api/v1/validate/email/submitToken (via HTTP) but the web server as a redirect directive and so sending this request to HTTPS, and this is another, a new session?

@maxidorius
Copy link
Member

Everything is HTTPS by default in mxisd. it would only be HTTP if you changed the config, in which case your setup is not supported.

@dev4223
Copy link
Author

dev4223 commented Mar 7, 2019

Mh, but the "GET http://my.server...." is in the logs of mxisd. So something requests via HTTP. Or do I oversee something?

@maxidorius
Copy link
Member

The reverse proxy is doing the HTTPS, not mxisd. mxisd would see everything at HTTP.
It's not of concern here and has nothing to do with your issue - the log is totally expected.

The potential problem is a variable not being initialized properly potentially, as seen by

Validating session null for medium email

@dev4223
Copy link
Author

dev4223 commented Mar 7, 2019

Ah, ok. Thank you for explaining.

@dev4223
Copy link
Author

dev4223 commented Mar 8, 2019

@pexus in #142 brought me to the Idea:
My apache config was

ProxyPreserveHost On
ProxyPass /_matrix/identity http://127.0.0.1:8090/_matrix/identity
ProxyPassReverse /_matrix/identity http://127.0.0.1:8090/_matrix/identity
<Location /_matrix>
  ProxyPass http://127.0.0.1:8008/_matrix nocanon
  ProxyPassReverse http://127.0.0.1:8008/_matrix
</Location>

Now I have changed it to

ProxyPreserveHost On
ProxyPass /_matrix/identity http://127.0.0.1:8090/_matrix/identity
ProxyPassReverse /_matrix/identity http://127.0.0.1:8090/_matrix/identity
ProxyPass /_matrix http://127.0.0.1:8008/_matrix nocanon
ProxyPassReverse /_matrix http://127.0.0.1:8008/_matrix

This solved the problem. This Location-syntax for synapse comes frome here https://github.com/matrix-org/synapse/blob/master/docs/reverse_proxy.rst
And after the description here https://httpd.apache.org/docs/2.4/mod/core.html#location it seems not a good idea to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support User support (repo no-op)
Projects
None yet
Development

No branches or pull requests

2 participants