stash icon indicating copy to clipboard operation
stash copied to clipboard

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

Open phantasy36 opened this issue 1 year ago • 13 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

phantasy36 avatar Jun 14 '24 11:06 phantasy36

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

Alextocode avatar Jun 15 '24 23:06 Alextocode

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

d3f3n avatar Jun 19 '24 19:06 d3f3n

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";

lukeh990 avatar Jun 21 '24 20:06 lukeh990

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.

Alextocode avatar Jun 21 '24 20:06 Alextocode

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.

G2G2G2G avatar Jul 04 '24 08:07 G2G2G2G

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.

electronicron avatar Jul 04 '24 20:07 electronicron

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!

electronicron avatar Jul 04 '24 20:07 electronicron

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.

kumpelblase97 avatar Jul 10 '24 15:07 kumpelblase97

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

electronicron avatar Jul 10 '24 15:07 electronicron

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";

Sorry for the perhaps stupid question, but where do I have to insert this? In the Advanced settings directly in NGINX or where?

unLieb avatar Aug 21 '24 06:08 unLieb

It's a pity that nobody here can or wants to help.

unLieb avatar Oct 19 '24 13:10 unLieb

I walked a user through the steps in discord ~1mo ago https://mlohr.com/websockets-for-synology-dsm/

feederbox826 avatar Oct 20 '24 02:10 feederbox826

I walked a user through the steps in discord ~1mo ago https://mlohr.com/websockets-for-synology-dsm/

Updated Stash today, got the error, this was a very quick fix in DSM. Thank you!

h0m3b0y avatar Oct 20 '24 17:10 h0m3b0y