0.46: the reverse proxy errors are back

Hi,

since upgrading to 0.46 a few hours ago, I’m starting to see proxy errors behind my Apache reverse proxy (again):

[Sun Jun 04 17:52:12.388205 2017] [proxy_http:error] [pid 62231] (20014)Internal error: [client 192.168.x.x:64287] AH01102: error reading status line from remote server 127.0.0.1:8123
[Sun Jun 04 17:52:12.388298 2017] [proxy:error] [pid 62231] [client 192.168.x.x:64287] AH00898: Error reading from remote server returned by /

On the frontend side I get 502 errors (not 504 as last time) - not that it makes a difference…
My config didn’t change in ages and it worked fine since HA switched to aiohttp 2 end of March.
Until 0.46 today…

Anyone else seeing those?

Sebastian

I’m seeing them too. I’m on 0.47 now.

[Wed Jun 21 09:53:13.061324 2017] [proxy_http:error] [pid 24724] (20014)Internal error: [client 10.0.0.210:45642] AH01102: error reading status line from remote server localhost:8123
[Wed Jun 21 09:53:13.061360 2017] [proxy:error] [pid 24724] [client 10.0.0.210:45642] AH00898: Error reading from remote server returned by /api/services/homeassistant/turn_on

I switched to the workaround that helped before: adding disablereuse=on to the ProxyPass[Reverse] statements.
This seems to help.

See https://home-assistant.io/docs/ecosystem/apache/.

Still looks like a bug to me.

Sebastian

I added keepalive=on to the ProxyPass directives and the 502 errors went away. However, starting on the hour, I start getting constant 401 errors about my cameras. Logging out of the HA web UI and back in again makes the errors stop but then they return at :00 on the next hour.

1.2.3.4 - - [21/Jun/2017:14:27:11 -0700] "GET /api/camera_proxy/camera.foo?token=bar&time=1498080451466 HTTP/1.1" 401 -

I’ll try disablereuse=on on ProxyPassReverse.

I’m having this same issue.

Error in browser:

Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request

Reason: Error reading from remote server

Apache/2.4.51 (Debian) Server at hass.example.com.au Port 443

Error in DevTools:

Error in Apache error.log:

[Thu Nov 25 14:45:06.664557 2021] [proxy_http:error] [pid 20832] (20014)Internal error (specific information not available): [client x.x.x.x:14654] AH01102: error reading status line from remote server 192.168.1.20:8123
[Thu Nov 25 14:45:06.664611 2021] [proxy:error] [pid 20832] [client x.x.x.x:14654] AH00898: Error reading from remote server returned by /
[Thu Nov 25 14:45:06.882101 2021] [proxy_http:error] [pid 20832] (20014)Internal error (specific information not available): [client x.x.x.x:14654] AH01102: error reading status line from remote server 192.168.1.20:8123, referer: https://hass.example.com.au/
[Thu Nov 25 14:45:06.888806 2021] [proxy_http:error] [pid 20833] (20014)Internal error (specific information not available): [client x.x.x.x:14653] AH01102: error reading status line from remote server 192.168.1.20:8123, referer: https://hass.example.com.au/
[Thu Nov 25 14:45:06.888926 2021] [proxy:error] [pid 20833] [client x.x.x.x:14653] AH00898: Error reading from remote server returned by /favicon.ico, referer: https://hass.example.com.au/

My configuration file for hass.example.com.au.conf in sites-enabled:

<VirtualHost *:80>
	ServerName hass.example.com.au
	ServerAdmin [email protected]	

	RewriteEngine On
	RewriteCond %{HTTPS} !=on
	RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
</VirtualHost>

<IfModule mod_ssl.c>
<VirtualHost *:443>
        ServerName hass.example.com.au
        ServerAdmin [email protected]

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

        RewriteEngine On
        RewriteCond %{HTTP:Upgrade} websocket [NC]
        RewriteRule ^/?(.*) "ws://192.168.1.20:8123/$1" [P,L]

        <Location "/">
                Satisfy any
        </Location>
        <Location "/api">
                Satisfy any
        </Location>

	SSLCertificateFile /etc/letsencrypt/live/hass.example.com.au/fullchain.pem
	SSLCertificateKeyFile /etc/letsencrypt/live/hass.example.com.au/privkey.pem
	Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

Any help would be greatly appreciated!

I think you need to provide an authorization header:

 RequestHeader set Authorization "Bearer xxxxx"

Replace the xxxxx with a long-lived access token.

Sebastian