Skip to content

LiveQuery server error: Can not fetch userId for sessionToken #4124

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

Closed
ndominati-luna opened this issue Aug 30, 2017 · 6 comments
Closed

LiveQuery server error: Can not fetch userId for sessionToken #4124

ndominati-luna opened this issue Aug 30, 2017 · 6 comments
Labels
type:question Support or code-level question

Comments

@ndominati-luna
Copy link

ndominati-luna commented Aug 30, 2017

Issue Description

We are using a live query server with our parse server.
We don't understand what's happening, but only for 1 out of 5 classes for which we activated the live queries in the server configuration all is working well.
For the other classes, we are getting this error instead of being reached on mobile side by the websocket events:

error: Can not fetch userId for sessionToken "r:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", error {"message":"unauthorized"}

We're not able to find anything on the Internet explaining us why this error is raised.

Environment Setup

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : 2.3.1
    • Operating System: Linux Ubuntu 16.04
    • Hardware: online.net Dedibox® XC 2016
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): online.net
  • Database

    • MongoDB version: 3.2.11
    • Storage engine: ?
    • Hardware: online.net Dedibox® XC 2016
    • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): Same server as the parse server. Installed via apt-get.

Logs/Trace

error: Can not fetch userId for sessionToken "r:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", error {"message":"unauthorized"}

Our application is currently in production and the chat mechanism is broken because of this.
Do you have an idea about the reason making the error raised?

Many thanks in advance.

@natanrolnik
Copy link
Contributor

natanrolnik commented Aug 30, 2017

A few questions that might help understanding the issue:

Did it use to work and stopped?
Have you tried with the latest parse-server version?
What's the setup of the livequery server and the parse-server? Are both on the same server? Different instances? Do you have a redis instance setup?

@ndominati-luna
Copy link
Author

I have 2 configurations for the application: a dev and a prod environment.
All working on the same machine, but being separate servers in terms of NodeJS process.

I have a Parse Server instance, a LiveQuery Server instance and a redis server instance for the dev environment and the same configuration again for the prod environment.

This is not the first time I'm doing this and all my other apps configured like this are working well.

I tried something this morning: I stopped the prod LiveQuery Server, and updated the dev LiveQuery server configuration to work for the prod environment.
--> This made the prod environment working and now I don't have the error anymore.

But if I use the prod LiveQuery server that I stopped, for the dev environment (with its configuration updated to work in the dev environment), the error that I got is now appearing in the dev environment.

So my feeling is that there is something wrong in this specific LiveQuery server but I don't know what because it is exactly the same code as the other one, except for the parse keys and server/redis urls.

Another thing that I observed is that this error is happening for classes being secured.
But again, in one of our environments all is working well with exactly the same Parse configuration and data model.

@ndominati-luna
Copy link
Author

I will continue to investigate and let you know what I find.
Thanks.

@flovilmart
Copy link
Contributor

@ndominati-luna any update?

@ogtfaber
Copy link

See #411

@stale
Copy link

stale bot commented Sep 18, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Sep 18, 2018
@stale stale bot closed this as completed Sep 25, 2018
@mtrezza mtrezza added type:question Support or code-level question and removed 🔧 troubleshooting labels Jul 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:question Support or code-level question
Projects
None yet
Development

No branches or pull requests

5 participants