October 2, 20223 yr Hello, I was interested for fun, in the test of the Home Assistant (HA, docker IP: 172.18.0.4) docker with Unraid and the "Nginx Proxy Manager" (NPM, docker IP: 172.18.0.3) reverse proxy. After configuring NPM for communication with HA, accessing my subdomain, the subdomain gives me a "400: Bad Request" error. I started investigating with multiple online forums. HA requires to indicate the IP of the reverse proxy docker in its configuration. So I added the docker IP to the "configuration.yaml" file of HA with the following configuration: http: use_x_forwarded_for: true trusted_proxies: - 172.18.0.3 However, it turns out that the HA log returns an error when I try to access the HA subdomain, with the following error: 2022-10-02 22:43:51.298 ERROR (MainThread) [homeassistant.components.http.forwarded] Received X-Forwarded-For header from an untrusted proxy 172.18.0.1 2022-10-02 22:43:51.400 ERROR (MainThread) [homeassistant.components.http.forwarded] Received X-Forwarded-For header from an untrusted proxy 172.18.0.1 The error repeats itself twice. We see that the untrusted IP is 172.18.0.1, which is neither the IP of the HA docker (172.18.0.4) and NPM (172.18.0.3). IPs 172.18.0.1 and 172.18.0.3 not being the same, would this suggest there is internal docker IP address routing in Unraid? Why? I added 172.18.0.1 in the trusted_proxies, with no effect. The web browser console returns the following errors: Failed to load resource: the server responded with a status of 400 () /favicon.ico:1 Failed to load resource: the server responded with a status of 400 () <my_subdomain>:1 Unchecked runtime.lastError: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received <my_subdomain>:1 Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received <my_subdomain>:1 The first two errors appear directly on click, and the last two appear after a while, and would suggest that the websocket is responding with a timeout and not working. The white rectangles correspond to my subdomain. NPM log gives no errors or warnings. No information is given in the network tracking on the web browser. I would like to point out that the configurations are as follows: - HA and NPM dockers are on the same custom network that I called "proxynet" ; - The subdomain is properly propagated in the DNS servers ; - Port forwarding is correctly defined (NPM works with other dockers in reverse proxy). Running Unraid OS 6.11.0, homeassistant (Ssickle's repository) v2022.9.7 and NGINX Proxy Manager (Djoss's repository) v2.9.18. Where do you think there is a problem? Thank you for your interest in this post.
January 23, 20233 yr On 10/3/2022 at 3:11 AM, Katal29 said: Unchecked runtime.lastError: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received <my_subdomain>:1 This error message indicates that there was a problem with the communication between the listener and the message channel. The reason is that sendMessage is now promisified internally, so you can 'await' it, but the by-product is that when you don't specify a callback yourselves, it is added internally anyway in order for the call to return a Promise, which means that since you don't call sendResponse in onMessage, the API will think that it was you who made a mistake of using a callback and not providing a response, and report it as such. Since the new behaviour is very confusing for almost everyone, a solution might be to stop showing this error when the callback is not specified, however it might cause confusion for those developers who still use callbacks and forgot to call sendResponse inside onMessage by mistake, which should be reported ideally as it always was. If you see your extension causing this errors - inspect closely all your onMessage listeners. Some of them probably need to start returning promises (marking them as async should be enough). If still error showing, try disabled all installed extensions in Chrome then you will get a clear console without errors.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.