stashapp/stash

[Bug Report] Unable to make websocket connection: see browser console for details

phantasy36 opened this issue · 9 comments

Describe the bug
An error occurred while accessing the web page :Unable to make websocket connection: see browser console for details

To Reproduce
Steps to reproduce the behavior:

  1. Delete the 0.26.0 docker image
  2. Docker compose install 0.26.1
  3. Use the original 0.26.0 version docker image configuration
  4. An error occurred while accessing the web page 192.168.8.60:9999

Screenshots
image

**Stash Version: (from Settings -> About):0.26.1

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser [e.g. chrome, safari] edge
  • Version [e.g. 22] 24h2

Hi there,
I upgraded from 0.25.1 to 0.26.1 and I am seeing the same issue.
I am also using Docker-Compose on an Ubuntu 22.04.3 VM.

Not sure if it is relevant but my Stash currently is proxied via Apache HTTPD 2.4 - also on (another) Ubuntu 22.04.3 VM
This is my Virtual Host config (that worked without any issues for more than 1.5 years):

ServerAdmin webmaster@localhost
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
ServerAlias XXXXX.de
ServerName XXXXX.de

ProxyPass / http://192.168.XX.XX/
ProxyPassReverse / http://192.168.XX.XX/
RequestHeader setIfEmpty X-Forwarded-Prefix /
ProxyPreserveHost on

RewriteEngine on
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule ^/?stash/(.*) "ws://192.168.XX.XX/$1" [P,L]

SSLEngine on
SSLProtocol +TLSv1.2 +TLSv1.3
SSLCertificateFile /etc/apache2/certs/star_XXXX_de_chained.crt
SSLCertificateKeyFile /etc/apache2/certs/star_XXXX_de.key

The general apache2.conf is not modified and has its defaults set.
Client side I am using Windows 10 and Firefox latest version. There must be something wrong I guess.

We see errors in console like this:
grafik
The error happens more or less randomly while browsing in Stash.

Hope my information help to resolve it.

Let me know in case you will need further information and keep up the great work :)

Cheers!

Alex

I am using it as docker image on a synology. I have the same error after the update

I was using a NGINX reverse proxy and the reason is without specifically allowing it NGINX doesn't allow the client to upgrade to the WS protocol. Adding these lines to my config worked:

proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";

I was using a NGINX reverse proxy and the reason is without specifically allowing it NGINX doesn't allow the client to upgrade to the WS protocol. Adding these lines to my config worked:

proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";

Excellent reply. This was spot on for me after some try and error.
For me it got fixed to after altering my Apache HTTPD Virtual Host:

Just change:
ProxyPass / http://192.168.XX.XX/

to
ProxyPass / http://192.168.XX.XX/ upgrade=websocket

and restart Apache HTTPD. It is not necessary to activate modules like proxy_wstunnel or so.

Yea this isn't a bug unless it is happening without behind behind any reverse proxy.
There used to be no socket, now there is, so it requires new config for reverse proxy.
Docker maybe requires something too. but the program itself runs and does the socket fine.

I am using it as docker image on a synology. I have the same error after the update

Did you find a solution to this? I'm having the same issue.

Yea this isn't a bug unless it is happening without behind behind any reverse proxy. There used to be no socket, now there is, so it requires new config for reverse proxy. Docker maybe requires something too. but the program itself runs and does the socket fine.

I'm not sure I understand. Is there a solution to this error? I'm implementing it in a container on a synology nas and getting the same error.

Thanks!

Yea this isn't a bug unless it is happening without behind behind any reverse proxy. There used to be no socket, now there is, so it requires new config for reverse proxy. Docker maybe requires something too. but the program itself runs and does the socket fine.

I'm not sure I understand. Is there a solution to this error? I'm implementing it in a container on a synology nas and getting the same error.

Thanks!

If you are using the Synology Reverse Proxy, then you have to enable the custom header --> create a websocket and then hit save.
You can use the default values.
Hope that will solve your problems.

Yes, I have done this and the error persists. Could there be any other solution? Thx.