I recently migrated my instance to Ubuntu 20.04, using the official server setup/migration instructions. Everything works fine except for websockets.
In the browser I notice that websocket connections are failing, with a message
Firefox can’t establish a connection to the server at wss://ausglam.space/api/v1/streaming/?. and similar message in Chrome. Note that there is no authentication param here, unlike other troubleshooting reports I’ve seen. This turns out to be a
401 error i.e. can’t authenticate to the streaming service.
When I manually run a websockets connection request using a nodejs server on my local machine (i.e. not my server), including an authentication token param in the
user scope, I still get a 401 error. Looking at my server logs I realised these requests are all hitting a node error on the server:
node: ERR! error: password authentication failed for user "mastodon". I’m guessing this is because my
mastodon user doesn’t have a password, as per the instructions. This required me to amend the standard install instructions to not pass through a
DB_PASS value because the empty string caused postgres to fail for the web service, but this seems to be causing issues on the streaming service. I’m not sure whether this is because the streaming service wants a (blank) password value, or if there is some unreconcilable difference in how the two services handle postres authentication.
I’m fairly out of my depth here, knowing not much about postgres (which I assume is where the authentication error is coming from), so if anyone has any suggestions I’d be grateful.