MeshCentral
MeshCentral copied to clipboard
Web-Relay with RelayPort does not work properly
Describe the bug
I setup the web-relay with a port (as I don't have a dns-name for this instance - it is a kind of testing instance)
I configured HomeAssistance to the correct port
If I access my home-assistance instance via "MeshCentral Router" - everything works flawlessly. If I use the web-Relay function, strange things happen ...
In one case, the meshcentral instance logged me out
In one try, i was able to receive the login page of my HomeAssistance instance - after login, I got the following waiting screen ... forever ...
This problem is not specific to HomeAssistance, I also tried other http services via other agents ...
To Reproduce Steps to reproduce the behavior:
- enable web-relay with a realyport
- create group for agent-less devices - forwarded through other device
- create device with ip-address in local lan how to access this device via the agent
- try to connect to this relay
Expected behavior full access to the website as with the meshcentral-router
Screenshots If applicable, add screenshots to help explain your problem. error log from the case where meshcentral always restarts ...
meshcentral | cmd: '/usr/bin/node /opt/meshcentral/meshcentral/meshcentral --configfile config.json --launch 8'
meshcentral | }
meshcentral | ERROR: MeshCentral failed with critical error, check mesherrors.txt. Restarting in 5 seconds...
meshcentral | MeshCentral HTTP redirection server running on port 80.
meshcentral | MeshCentral v1.0.72, Hybrid (LAN + WAN) mode, Production mode.
meshcentral | MeshCentral Intel(R) AMT server running on xxx.yyy.zzz.www:4433.
meshcentral | MeshCentral HTTPS relay server running on xxx.yyy.zzz.www:453.
meshcentral | MeshCentral HTTPS server running on xxx.yyy.zzz.www:443.
meshcentral | ERR: /opt/meshcentral/meshcentral/apprelays.js:298
meshcentral | res.socket.on('end', function () { obj.close(); });
meshcentral | ^
meshcentral |
meshcentral | ReferenceError: res is not defined
meshcentral | at Object.obj.processWebSocket (/opt/meshcentral/meshcentral/apprelays.js:298:9)
meshcentral | at Object.tunnel.oncompleted (/opt/meshcentral/meshcentral/apprelays.js:182:59)
meshcentral | at processHttpResponse (/opt/meshcentral/meshcentral/apprelays.js:707:44)
meshcentral | at processHttpData (/opt/meshcentral/meshcentral/apprelays.js:568:29)
meshcentral | at processRawHttpData (/opt/meshcentral/meshcentral/apprelays.js:491:13)
meshcentral | at WebSocket.<anonymous> (/opt/meshcentral/meshcentral/apprelays.js:468:21)
meshcentral | at WebSocket.emit (node:events:527:28)
meshcentral | at Receiver.receiverOnMessage (/opt/meshcentral/meshcentral/node_modules/ws/lib/websocket.js:720:20)
meshcentral | at Receiver.emit (node:events:527:28)
meshcentral | at Receiver.dataMessage (/opt/meshcentral/meshcentral/node_modules/ws/lib/receiver.js:405:14)
meshcentral | Error: Command failed: /usr/bin/node /opt/meshcentral/meshcentral/meshcentral --configfile config.json --launch 8
meshcentral | /opt/meshcentral/meshcentral/apprelays.js:298 [3/138]
meshcentral | res.socket.on('end', function () { obj.close(); });
meshcentral | ^
meshcentral |
meshcentral | ReferenceError: res is not defined
meshcentral | at Object.obj.processWebSocket (/opt/meshcentral/meshcentral/apprelays.js:298:9)
meshcentral | at Object.tunnel.oncompleted (/opt/meshcentral/meshcentral/apprelays.js:182:59)
meshcentral | at processHttpResponse (/opt/meshcentral/meshcentral/apprelays.js:707:44)
meshcentral | at processHttpData (/opt/meshcentral/meshcentral/apprelays.js:568:29)
meshcentral | at processRawHttpData (/opt/meshcentral/meshcentral/apprelays.js:491:13)
meshcentral | at WebSocket.<anonymous> (/opt/meshcentral/meshcentral/apprelays.js:468:21)
meshcentral | at WebSocket.emit (node:events:527:28)
meshcentral | at Receiver.receiverOnMessage (/opt/meshcentral/meshcentral/node_modules/ws/lib/websocket.js:720:20)
meshcentral | at Receiver.emit (node:events:527:28)
meshcentral | at Receiver.dataMessage (/opt/meshcentral/meshcentral/node_modules/ws/lib/receiver.js:405:14)
meshcentral |
meshcentral | at ChildProcess.exithandler (node:child_process:398:12)
meshcentral | at ChildProcess.emit (node:events:539:35)
meshcentral | at maybeClose (node:internal/child_process:1092:16)
meshcentral | at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5) {
meshcentral | code: 1,
meshcentral | killed: false,
meshcentral | signal: null,
meshcentral | cmd: '/usr/bin/node /opt/meshcentral/meshcentral/meshcentral --configfile config.json --launch 8'
meshcentral | }
meshcentral | ERROR: MeshCentral failed with critical error, check mesherrors.txt. Restarting in 5 seconds...
meshcentral | MeshCentral HTTP redirection server running on port 80.
meshcentral | MeshCentral v1.0.72, Hybrid (LAN + WAN) mode, Production mode.
meshcentral | MeshCentral Intel(R) AMT server running on xxx.yyy.zzz.www:4433.
meshcentral | MeshCentral HTTPS relay server running on xxx.yyy.zzz.www:453.
meshcentral | MeshCentral HTTPS server running on xxx.yyy.zzz.www:443.
Server Software (please complete the following information):
- OS: vps from cloud provider
- Virtualization: Docker
- Network: full access to the internet via public IP (required ports in docker-compose forwarded)
- Version: sorry, don't konw how to find out the version - should be the latest - is automatically updated every day
- Node: from docker image
Client Device (please complete the following information):
- Device: Laptop
- OS: windows
- Network: behind NAT - connecting to the meshcentral instance which has a public ip address
- Browser: Firefox
- MeshCentralRouter Version: v1.8.7998
Remote Device (please complete the following information):
- Device: proxmox VM
- OS: HomeAssistance - Linux based - I believe freeBSD
- Network: Local to Meshcentral-agent
- Current Core Version (if known):
Current Core: Apr 4 2022, 1656207267
Agent Time: 2022-08-25 22:00:22.483+00:00.
User Rights: 0xffffffff.
Platform: linux.
Additional context works with MeshCentral Router but not with web-relay I would really like to help to track this bug down as this feature could help a lot during working ...
Your config.json file (replaced my public IP with MY_PUBLIC_IP_ADDRESS)
"$schema": "http://info.meshcentral.com/downloads/meshcentral-config-schema.json",
"settings": {
"plugins":{"enabled": "false"},
"cert": "MY_PUBLIC_IP_ADDRESS",
"_WANonly": true,
"_LANonly": true,
"_sessionKey": "MyReallySecretPassword1",
"port": 443,
"_aliasPort": 443,
"redirPort": 80,
"RelayPort": 453,
"_redirAliasPort": 80,
"AgentPong": 300,
"TLSOffload": false,
"SelfUpdate": false,
"AllowFraming": "false",
"WebRTC": "false",
"Compression": true,
"WsCompression": true,
"AgentWsCompression": true
},
"domains": {
"": {
"_title": "MyServer",
"_title2": "Servername",
"minify": "true",
"NewAccounts": "false",
"localSessionRecording": "false",
"_userNameIsEmail": true,
"_certUrl": "my.reverse.proxy"
}
},
"_letsencrypt": {
"__comment__": "Requires NodeJS 8.x or better, Go to https://letsdebug.net/ first before>",
"_email": "[email protected]",
"_names": "myserver.mydomain.com",
"production": false
}
}
This is good timing. I am just working on web relay right now for #4413 and I happen to be a Home Assistant myself so I can test this. At some point I would like to work on a MeshCentral add-in for Home Assistant. It seems like it could be a very possible thing to do.
Good news, I got the same error! Working on it now.
Found the issue and fixed it. I can how see my dashboard thru MeshCentral. Fix will be in v1.0.73
Just published MeshCentral v1.0.73. Let me know if it works.
Thx for your work,
Unfortunately, version v 1.0.73 does not work for me yet ...
The login to one home assistance instance works now. However, instead of the dashboard, i only see this:
I also have some other services defined on different ports. If I want to access them, I am not even able to access the login pages ... I only receive:
Stepst to re-create:
create 2 devices, one with home assistance, one with a different ip/port - in my case https
Access home assistance on Port 8123 -> Login works (afterwards as in first image - no data on lovelace) Access the second service on non standard https port -> output is of second image ...
Unfortunately the log output does not print any details ...
meshcentral | MeshCentral HTTP redirection server running on port 80.
meshcentral | MeshCentral v1.0.73, Hybrid (LAN + WAN) mode, Production mode.
meshcentral | MeshCentral Intel(R) AMT server running on xxx.yyy.zzz.www:4433.
meshcentral | MeshCentral HTTPS relay server running on xxx.yyy.zzz.www:453.
meshcentral | MeshCentral HTTPS server running on xxx.yyy.zzz.www:443.
Is there a option to enable further logging to help you find the error ...
Thx for your work,
Unfortunately, version v 1.0.73 does not work for me yet ...
The login to one home assistance instance works now. However, instead of the dashboard, i only see this:
I also have some other services defined on different ports. If I want to access them, I am not even able to access the login pages ... I only receive:
Stepst to re-create:
create 2 devices, one with home assistance, one with a different ip/port - in my case https
Access home assistance on Port 8123 -> Login works (afterwards as in first image - no data on lovelace) Access the second service on non standard https port -> output is of second image ...
Unfortunately the log output does not print any details ...
meshcentral | MeshCentral HTTP redirection server running on port 80. meshcentral | MeshCentral v1.0.73, Hybrid (LAN + WAN) mode, Production mode. meshcentral | MeshCentral Intel(R) AMT server running on xxx.yyy.zzz.www:4433. meshcentral | MeshCentral HTTPS relay server running on xxx.yyy.zzz.www:453. meshcentral | MeshCentral HTTPS server running on xxx.yyy.zzz.www:443.
Is there a option to enable further logging to help you find the error ...
you cant access two different services at the same time as it gets confused, to access two different services at the same time, you need to use the DNS relay method with multiple domain names, hope this helps!
...
you cant access two different services at the same time as it gets confused, to access two different services at the same time, you need to use the DNS relay method with multiple domain names, hope this helps!
I know this, however, if i switch from one service to the other, the other should pop up (as presented in the video) At the moment, it does not work
How is it possible to use custom HTTP\S ports such as 8123?
How is it possible to use custom HTTP\S ports such as 8123?
right click things is your friend
right click the https button and then click alternative port, set the port then reclick the https button
I didn't even think about right clicking that link.. thnx
the problem seams to be solved now, thx, great feature and great work!