Cronicle icon indicating copy to clipboard operation
Cronicle copied to clipboard

Request timeout Error

Open amitgupta369 opened this issue 4 years ago • 13 comments

Summary

Croncile is working fine on local machine but if we deployed cronicle on development server then we are getting Network error 500 : request timeout while try to login Cronicle.

Please suggest if i am missing anything.. Note : Running as a single server installation

amitgupta369 avatar Feb 23 '21 10:02 amitgupta369

Check the log file, last several lines should contain detailed error description. I'd think this is something related to permissions (like the user running cronicle doesn't have write permission on data folder)

mikeTWC1984 avatar Feb 23 '21 14:02 mikeTWC1984

Thanks Mike, i gave full permission to data folder but still i am getting the same error Webserver.log WebServer][error][socket][Socket closed unexpectedly: c16][{"id":"c16","proto":"http","port":3012,"time_start":1614090743230,"num_requests":0,"bytes_in":0,"bytes_out":0,"total_elapsed":13155,

amitgupta369 avatar Feb 23 '21 14:02 amitgupta369

I assume your cronicle crashes once you see error 500, so that js error should pop up somewhere in the log. Do the following: ssh to your server, stop cronicle. cd to /opt/cronicle (or wherever it's installed) Try to start cronicle forwarding logs to stdout:

export CRONICLE_foreground=1
export CRONICLE_echo=1
export CRONICLE_master=1
./lib/main.js

You should now see logs on your screen. Try to login to cronicle on web ui again, and once it's crashed, check for error message on the log screen.

mikeTWC1984 avatar Feb 23 '21 15:02 mikeTWC1984

Hi Mike,

Thanks for your time and support and I am getting network error due to Socket closed unexpectedly

[1614099473.223][2021-02-23 11:57:53][cronicle-server-testing-dev.com][105050][User][debug][6][Logging user in: admin: New Session ID: 80817cec65228f1a2d916c48997cd578298726864f3813a0958ce9fd6ad70917][{"id":"80817cec65228f1a2d916c48997cd578298726864f3813a0958ce9fd6ad70917","username":"admin","ip":"192.168.12.12","useragent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36","created":1614099473,"modified":1614099473,"expires":1616644800}] [1614099473.553][2021-02-23 11:57:53][cronicle-server-testing-dev.com][105050][Filesystem][debug][9][Storing JSON Object: sessions/80817cec65228f1a2d916c48997cd578298726864f3813a0958ce9fd6ad70917][data/sessions/94/c7/ea/94c7ea58688857db707d146743d8e302.json] [1614099475.26][2021-02-23 11:57:55][cronicle-server-testing-dev.com][105050][Filesystem][debug][9][Store operation complete: sessions/80817cec65228f1a2d916c48997cd578298726864f3813a0958ce9fd6ad70917][] [1614099475.576][2021-02-23 11:57:55][cronicle-server-testing-dev.com][105050][Storage][transaction][put][sessions/80817cec65228f1a2d916c48997cd578298726864f3813a0958ce9fd6ad70917][{"elapsed_ms":2022.569}] [1614099475.892][2021-02-23 11:57:55][cronicle-server-testing-dev.com][105050][User][debug][6][Successfully logged in][] [1614099476.109][2021-02-23 11:57:56][cronicle-server-testing-dev.com][105050][User][transaction][user_login][admin][{"ip":"192.168.12.12","headers":{"host":"cronicle-server-testing-dev.com:9000","connection":"keep-alive","content-length":"39","accept":"text/plain, */*; q=0.01","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36","content-type":"text/plain","origin":"http://cronicle-server-testing-dev.com:9000","referer":"http://cronicle-server-testing-dev.com:9000/","accept-encoding":"gzip, deflate","accept-language":"en-US,en;q=0.9"}}] [1614099476.33][2021-02-23 11:57:56][cronicle-server-testing-dev.com][105050][Storage][debug][9][Setting expiration on: sessions/80817cec65228f1a2d916c48997cd578298726864f3813a0958ce9fd6ad70917 to 2021/03/25][] [1614099476.547][2021-02-23 11:57:56][cronicle-server-testing-dev.com][105050][Storage][debug][9][Enqueuing async task: expire_set][] [1614099476.769][2021-02-23 11:57:56][cronicle-server-testing-dev.com][105050][WebServer][error][socket][Socket closed unexpectedly: c9][{"id":"c9","proto":"http","port":9000,"time_start":1614099459891,"num_requests":0,"bytes_in":0,"bytes_out":0,"total_elapsed":16878,"url":"http://cronicle-server-testing-dev.com:9000/api/user/login","ips":["192.168.12.12"]}] [1614099476.984][2021-02-23 11:57:56][cronicle-server-testing-dev.com][105050][Storage][debug][9][Enqueuing async task: custom][]

and when i inspect in browser i got below error ( May be issue in socket.io package) `// --- Keep socket.io connected forever --- // This is the worst hack in history, but socket.io-client // is simply not behaving, and I have tried EVERYTHING ELSE. setInterval( function() { if (socket && !socket.connected) { Debug.trace("Forcing socket to reconnect"); socket.connect(); } }, 5000 ); },

websocket is already in closing or closed state

WebSocket connection to 'ws://cronicle-server-testing-dev.com:9000/socket.io/?EIO=3&transport=websocket' failed: WebSocket is closed before the connection is established. WebSocket connection to 'ws://cronicle-server-testing-dev.com:9000/socket.io/?EIO=3&transport=websocket' failed: Error during WebSocket handshake: net::ERR_CONNECTION_RESET 25 WebSocket connection to 'ws://cronicle-server-testing-dev.com:9000/socket.io/?EIO=3&transport=websocket' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSE `

amitgupta369 avatar Feb 23 '21 17:02 amitgupta369

OK, so the cronicle itself is not crashing, just can't setup a connection. Try to copy this url to your browser: http://cronicle-server-testing-dev.com:9000/api/app/config If you are getting response then that it something with websockets. If so, are you setting port 9000 in cronicle config or it's some reverse proxy?

mikeTWC1984 avatar Feb 23 '21 17:02 mikeTWC1984

Thanks Mike,

Yes, I am setting port 9000 in cronicle config file and when i copy the share url in browser then i am getting response also.

I am not sure, if i am missing anything else.....

amitgupta369 avatar Feb 23 '21 18:02 amitgupta369

OK, just for sanity check you may try default port 3012

Also, try to go to http://cronicle-server-testing-dev.com:9000 and then in browser's console run this:

var socket = io('ws://cronicle-server-testing-dev.com:9000');
socket.on('connect', ()=>console.log("connected"))

If it's throwing an error then most likely non-http traffic is blocked between you and your server.

mikeTWC1984 avatar Feb 23 '21 18:02 mikeTWC1984

One more thing to try - if you are on some ancient node version try to upgrade to v12 or v14.

mikeTWC1984 avatar Feb 23 '21 19:02 mikeTWC1984

  1. 3012 port is not allowed from server so can not use default 3012
  2. socket.on('connect', ()=>console.log("connected")) is not throwing error
  3. current node version is 12.16.1

JFYI,

  1. If i run cronicle on personal machine then it is working fine and i am able to login to Cronicle
  2. If i setup cronicle on server then i am able to access login page but when i click on login button then it is throwing network error 500
  3. In log file it is showing logged successfully then after it is showing [WebServer][error][socket][Socket closed unexpectedly: c9]
  4. If I inspect using browser then it is showing
  • websocket is already in closing or closed state
  • WebSocket connection to 'ws://cronicle-server-testing-dev.com:9000/socket.io/?EIO=3&transport=websocket' failed:
  • WebSocket is closed before the connection is established.
  • WebSocket connection to 'ws://cronicle-server-testing-dev.com:9000/socket.io/?EIO=3&transport=websocket' failed: Error during WebSocket handshake: net::ERR_CONNECTION_RESET
  • WebSocket connection to 'ws://cronicle-server-testing-dev.com:9000/socket.io/?EIO=3&transport=websocket' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSE ` I am not sure error may be due to Websocket disconnect frequently

amitgupta369 avatar Feb 24 '21 07:02 amitgupta369

OK. When you are in console, try type app.session_id. Do you see any value or app object at all? When you login app object should be generated. Also go to the network tab (instead of console) and check for errors in there (refresh page)

mikeTWC1984 avatar Feb 24 '21 14:02 mikeTWC1984

Still no luck...

there is no value if i type app.session_id

It is showing same error WebSocket connection to 'ws://cronicle-server-testing-dev.com:9000/socket.io/?EIO=3&transport=websocket' failed: WebSocket is closed before the connection is established.

amitgupta369 avatar Feb 24 '21 17:02 amitgupta369

@amitgupta369 please make sure nothing else is using port 9000 on your development system.

mrkcmo avatar Feb 26 '21 04:02 mrkcmo

@amitgupta369 one more thought - check if that machine is under high CPU/Memory/Disk usage (or has very limited resources), and also check the ping. I just got short term 500 error over very lagging connection.

mikeTWC1984 avatar Feb 26 '21 04:02 mikeTWC1984