Open jwjhdev opened 3 years ago
Strange. Actually "Waiting for master" means that your node doesn't have access to storage or hostname doesnt match regex for master group. Check the logs when you start cronicle (first 50 lines or so). On a single node the proxy would only cause issues with loading UI.
Regarding reverse https proxy - it should work, I used it with nginx (as rout) and now using with traefik (as subdomain). The only thing that would not work is livelog, because of downgrading websocket from https to http is blocked
@jwjhdev Figured out a reason/ solution yet? Running into the exact same error.
Behind a nginx reverse proxy and tried setting up Websocket but still getting same error
location ~* /(terminals/websocket)/? {
proxy_pass http://127.0.0.1:3012;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# WebSocket support
proxy_http_version 1.1;
proxy_set_header Upgrade "websocket";
proxy_set_header Connection "Upgrade";
proxy_read_timeout 86400;
}
@stubclan my solution was to use 'polling' instead of websockets.
I haven't been able to get websockets to work on a reverse proxy using https.
Below is the ngnix config I've used to use for reverse https (to rout localhost:3012 to https://myhost.com and https/myhost.com/cronicle). The only trick was to handle route for socket.io. It worked without any extra cronicle config tweaking.
https://github.com/cronicle-edge/cronicle-edge/blob/main/Docker/nginx.conf
I'm currently using traefik, as subdomain https proxy, and have no any issues (well besides livelog). I haven't set it up myself though. So there is no some "by design" issue, keep tweaking your configs
@mikeTWC1984 THANK YOU very much. That worked like a charm.
Now I'm getting websocket error to print logs. I'm trying to find solution but please let me know if you have seen this before and found a solve:
Yes, there will be problems with livelog in this case. Check that issue: https://github.com/jhuckaby/Cronicle/issues/426
Summary
Firstly, thank you community and @jhuckaby for this terrific tool! I have been using Cronicle for the past 2 years and it is excellent.
Unfortunately, however, with the new builds from the past year I have been having issues getting past the dreaded blank screen of death: "Waiting for master server...".
I have been reverting back to older revisions as a work around and told myself this weekend I would deep dive into why this happening.
I first started having this issue when installing newer versions (past 12 months) with Docker containers and this weekend I attempted to install out of the container environment and was still bumping into the problem on a test server.
Installing in a localhost environment without a reverse proxy or SSL certificates, this package installs without issue.
It isn't until you start navigating https and hosting on dedicated servers with domains that the issue presents itself.
Please keep in mind that it is likely it could be user error on my behalf! Hopefully with your help we can get the bottom of the problem, and hopefully help others with the same issue that might be viewing this ticket.
The problem
Websocket errors when resolving a reverse proxy subdomain pointing the Cronicle running on localhost in single server mode.
The error
Was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint
I am able to see the Cronicle web interface and a message "Waiting for master server..." which disappears after 30 seconds and doesn't proceed.
The assumption of the problem
Somewhere there is a http cross websocket attempt which is being rejected as force https is enabled. This is ultimately what I would love to find out.
I was able to solve my issue by using polling instead
I was able to solve my issue by adding a line from the configuration file on a on version
0.8.24
:"socket_io_transports": ["polling", "websocket"],
This should now force Cronicle to use polling as a preference and disregard using websockets.
The
socket_io_transports
configuration setting is missing in the newer revision configuration files, so I didn't immediately realise this option was available.Polling is quite archaic, so I would certainly prefer to use websocks. Polling in general is more resource hungry, has issues with ordering of requests and websockets is built on the tcp stack so it has those inbuilt security mechanisms as well.
I worked around this by allocating more memory for Cronicle and setting up a .htpasswd for the entire subdomain it is hosted on for security.
My question
How would I go about hunting down where the rogue http sock request is coming from? Is it perhaps my configuration that is the problem? Welcome any advice :)
My configuration
Here are the custom entries in the config file (the rest being default):
config.json
Added a new line:
"socket_io_transports": ["polling", "websocket"],
Here is my server block for Nginx subdomain:
subdomain.example.com
Thanks for reading, sorry about the wall-of-text!
Steps to reproduce the problem
$ /opt/cronicle/bin/control.sh setup
/opt/cronicle/bin/control.sh start
Your Setup
Operating system and version?
Node.js version?
Cronicle software version?
Are you using a multi-server setup, or just a single server?
Are you using the filesystem as back-end storage, or S3/Couchbase?
Can you reproduce the crash consistently?
Log Excerpts
Note: I have substituted my domain with
subdomain.example.com
universalModuleDefinition:3 WebSocket connection to 'wss://subdomain.example.com/socket.io/?EIO=3&transport=websocket&sid=Rggi9sYGV25F9ODZAAAC' failed:
was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint