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

New 4.0 does not work when accessing HA through reverse proxy #371

Closed
DanDon opened this issue Jan 13, 2022 · 22 comments
Closed

New 4.0 does not work when accessing HA through reverse proxy #371

DanDon opened this issue Jan 13, 2022 · 22 comments

Comments

@DanDon
Copy link

DanDon commented Jan 13, 2022

Problem/Motivation

New 4.0 update has stopped access to the add-on

Expected behavior

When opening the Web-UI for the add-on, it should just display and work correctly

Actual behavior

After a few seconds of a blank page an error box is shown with "An unexpected error occurred that requires a reload of this page."
"The workbench failed to connect to the server (Error: Time limit reached)"

Steps to reproduce

Visit the Visual Studio Code add-on Web-UI using a reverse proxy on an HTTPS connection

Proposed changes

This worked correctly on previous versions but has now stopped working ... the add-on is accessible when browsing HA directly on the local network using the local IP address without HTTPS.

@bakerkj
Copy link

bakerkj commented Jan 13, 2022

As I noted in my ticket #372 I saw this exact same problem when upgrading from 3.7 to 4.0.

@bakerkj
Copy link

bakerkj commented Jan 16, 2022

@frenck is there any additional information we could provide you to help get to the bottom of this?

@sinclairpaul
Copy link
Member

I would suggest, test it under a different proxy (I'm going to assume both reports are Apache), and also look upstream for issues. The addon wraps Code-Server, the major changes were in that release.

@bakerkj
Copy link

bakerkj commented Jan 16, 2022

This looks like it could be related coder/code-server#4723.

@frenck
Copy link
Member

frenck commented Jan 17, 2022

@bakerkj not sure why you tagged me. I don't know if I need extra information as I haven't looked into it 🤷

If I need something I would post that.

@zechnkaas
Copy link

Hi, i'm using caddy and I have no issues with 4.0.0 or 4.1.0

@nmsousa76
Copy link

I have teh same issue on 4.1. I have reverted to 3.7 to continue to work. my Hass box is running behind a Apache Reverse Proxy, and this is the only addon that is not working.

@krkeegan
Copy link

krkeegan commented Feb 7, 2022

Same issue running Apache.

I think the issue may be with the websocket for:
wss://[OMITTED]/api/hassio_ingress/y4rwC26P07DpoptstoiaiyLRiYo2Nd8GIxJruCNcLV8/?type=Management&reconnectionToken=[OMITTED]&reconnection=false&skipWebSocketFrames=false

Inspecting it in chrome, I don't see any response to the initial auth message when accessing through the proxy, while without a proxy I see a near immediate response.

EDIT: It looks like the bakerkj is exaclty right, this is an error upstream coder/code-server#4723. They seem to be aware of it ... and I think working on it?

@github-actions
Copy link

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues.
Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

@github-actions github-actions bot added the stale There has not been activity on this issue or PR for quite some time. label Mar 10, 2022
@bakerkj
Copy link

bakerkj commented Mar 10, 2022

This is still broken and clearly impacting many users. Please don't close the issue.

@github-actions github-actions bot removed the stale There has not been activity on this issue or PR for quite some time. label Mar 11, 2022
@magnogabri
Copy link

I can confirm the problem with Studio Code Server 4.1.0 and Home Assistant 2022.3.3.
Below is my apache configuration:

ProxyPreserveHost On
ProxyRequests Off
ProxyPass /api/websocket ws://192.168.100.184:8123/api/websocket
ProxyPassReverse /api/websocket ws://192.168.100.184:8123/api/websocket
ProxyPass / http://192.168.100.184:8123/
ProxyPassReverse / http://192.168.100.184:8123/

RewriteEngine on
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.) ws://192.168.100.184:8123/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /(.
) http://192.168.100.184:8123/$1 [P,L]

@DanDon
Copy link
Author

DanDon commented Mar 11, 2022

Also having the same issue since the 4.0 update where Studio Code cannot be accessed using an apache reverse proxy.

@demolitionfabi

This comment was marked as abuse.

@krazos
Copy link

krazos commented Mar 11, 2022

This was the push I needed to migrate my reverse proxy server from Apache to NGINX, which had been on my long term to do list for years. I set up NGINX Proxy Manager via Docker Compose, and recreating the proxy hosts was much less painful than I had feared. If migrating is feasible for anyone, I would highly recommend it.

@jyavenard
Copy link

This was the push I needed to migrate my reverse proxy server from Apache to NGINX, which had been on my long term to do list for years. I set up NGINX Proxy Manager via Docker Compose, and recreating the proxy hosts was much less painful than I had feared. If migrating is feasible for anyone, I would highly recommend it.

moving to nginx won't help you resolving this issue.

@krazos
Copy link

krazos commented Mar 16, 2022

YMMV, I suppose, but the default configuration in NGINX Proxy Manager works flawlessly with my Home Assistant instance, including the Studio Code Server 4.1.0 add-on, without the errors that I had encountered using Apache reverse proxy.

@demolitionfabi
Copy link

To circumvent the issue, I'm ussing the private IP address of my server (http://192.168.x.x:8123) to access Home Assistant + Stuio Server when I'm at home.
When I'm not at home, I normally don't want to change the configuration anyway, but if I still need to do that and connect through Apache (https://homeassistant.mydomain.com) to my Home Assistant, I use the File Editor Add-on that also works through Apache.

@github-actions
Copy link

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues.
Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

@github-actions github-actions bot added the stale There has not been activity on this issue or PR for quite some time. label Apr 23, 2022
@pcuser42
Copy link

Still happens for me on Home Assistant 2022.4.6

@krkeegan
Copy link

The issue is solved if you follow the solution and upgrade Apache as noted here:

coder/code-server#4723

@github-actions github-actions bot removed the stale There has not been activity on this issue or PR for quite some time. label Apr 24, 2022
@pcuser42
Copy link

Confirmed that updating Apache to 2.4.53 fixed the issue for me.

@sinclairpaul
Copy link
Member

Closing, as it's not related to the addon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests