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

mastodon-streaming: ERR! Error: Unknown authentication #15101

Closed
danieljakots opened this issue Nov 7, 2020 · 11 comments
Closed

mastodon-streaming: ERR! Error: Unknown authentication #15101

danieljakots opened this issue Nov 7, 2020 · 11 comments

Comments

@danieljakots
Copy link
Contributor

Hi,

I'm trying to find a problem I have with notifications on my iPhone with amaroq.
I run mastodon v3.2.1 in docker. I looked at mastodon-streaming logs and I have:

yarn run v1.22.10
$ node ./streaming/index.js
info Starting streaming API server master with 1 workers 
info Starting worker 1 
info Worker 1 now listening on 0.0.0.0:4000 
ERR! Error: Unknown authenticationOk message typeMessage { name: 'authenticationOk', length: 23 } 
info Worker 1 exiting, bye bye 
info Starting worker 2 
info Worker 2 now listening on 0.0.0.0:4000 
ERR! Error: Unknown authenticationOk message typeMessage { name: 'authenticationOk', length: 23 } 
info Worker 2 exiting, bye bye 
info Starting worker 3 
info Worker 3 now listening on 0.0.0.0:4000 

(yes it seems a newline is missing after the error message).

Any idea what causes that and how to fix it?
I tried to grep the source code for the error message, but I haven't found anything.

@Gargron
Copy link
Member

Gargron commented Nov 7, 2020

Unknown authenticationOk message type

Something is sending the server a message with an unrecognized type which reads authenticationOk. It’s got nothing to do with actual authentication. That’s not a message type we use. However, it shouldn’t be an error that causes the worker to quit, normally. I need to look into it.

@Gargron
Copy link
Member

Gargron commented Nov 7, 2020

It doesn’t seem to be from where I thought it was, I don’t recognize the log message structure. It must be some library throwing it, but which?

@Gargron
Copy link
Member

Gargron commented Nov 7, 2020

@danieljakots
Copy link
Contributor Author

Oh thanks! It seems, according to https://github.com/brianc/node-postgres/releases and yarn.lock we're quite far behind.
But given I've been using SCRAM-SHA-256 for a long time, I doubt it's the cause of the problem I'm trying to pinpoint.

@dalehenries
Copy link
Contributor

I'm running into a very similar issue with the docker image v3.3.0.

I'm also seeing the following in the streaming container's logs:

ERR! Error: Unknown authenticationOk message typeMessage { name: 'authenticationOk', length: 23 }

I noticed that node.js pg module is using version "^6.4.0" and hasn't been updated in 4 years. I updated that to "^8.5.0", built my own docker image, and redeployed. This fixed my issue and worked with Postgresql 9 and Postgresql 13.

@Gargron Would it cause problems to update this pg package and push out a new docker image? I can run with my own docker image for now if necessary, but my team and I would prefer staying up to date with the official source if at all possible.

@dalehenries
Copy link
Contributor

I'm running into a very similar issue with the docker image v3.3.0.

I'm also seeing the following in the streaming container's logs:

ERR! Error: Unknown authenticationOk message typeMessage { name: 'authenticationOk', length: 23 }

I noticed that node.js pg module is using version "^6.4.0" and hasn't been updated in 4 years. I updated that to "^8.5.0", built my own docker image, and redeployed. This fixed my issue and worked with Postgresql 9 and Postgresql 13.

@Gargron Would it cause problems to update this pg package and push out a new docker image? I can run with my own docker image for now if necessary, but my team and I would prefer staying up to date with the official source if at all possible.

On second thought, I guess it makes more sense to include this in the next release. Is there a roadmap for the next release, or an estimated timeline?

@danieljakots
Copy link
Contributor Author

Can you make a pull request? That's probably the best way to push things forward.

Also, do you know what the streaming api is for? I think mine has always been broken and yet I can't see any problem with my mastodon use :o

@dalehenries
Copy link
Contributor

Can you make a pull request? That's probably the best way to push things forward.

Also, do you know what the streaming api is for? I think mine has always been broken and yet I can't see any problem with my mastodon use :o

@danieljakots The streaming api seems to be what handles websockets. If websockets are working, you should see immediate updates in the UI when a new toot is made or deleted.

The streaming api uses a node.js module for connections to the database, but the main web uses a ruby gem. The ruby gem is up to date, but the node.js package hasn't been updated here in mastodon in 4 years.

Thanks for the suggestion to make a PR. I'll do that shortly and post it here.

@dalehenries
Copy link
Contributor

dalehenries commented Feb 24, 2021

Here's the PR #15793

@danieljakots
Copy link
Contributor Author

Thanks for the explanation!

I'm testing your PR right now, I'll report back there. Thanks for handling it!

@danieljakots
Copy link
Contributor Author

Closing this since the PR is merged

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

3 participants