Closed mahsashadi closed 2 years ago
Have you changed any paths or ports?
On Sun, 3 Jul 2022, 19:31 mahsashadi, @.***> wrote:
I have osjs docker container running. After login, without any user interaction, my osjs keeps closing websocket connection and reopening that.
Error: websocket is not open, readyState 2 (closing)
what should the problem be? I have no other errors in my server logs.
— Reply to this email directly, view it on GitHub https://github.com/os-js/osjs-server/issues/59, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABHODDWQZG34OMOPS7AQMTVSHE6JANCNFSM52RAB6SQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
The osjs is on port 8000 inside container and it is exposed on port 80 in server. Which path you mean?
Path as in the base url.
Check browser devtools network tab and check what the client is trying to connect to.
On Sun, 3 Jul 2022, 19:50 mahsashadi, @.***> wrote:
The osjs is on port 8000 inside container and it is exposed on port 80 in server. Which path you mean?
— Reply to this email directly, view it on GitHub https://github.com/os-js/osjs-server/issues/59#issuecomment-1173143664, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABHODHROYW5EKKZPCUR5NDVSHHFZANCNFSM52RAB6SQ . You are receiving this because you commented.Message ID: @.***>
I have nothing in network
tab,
In console
I have this error:
WebSocket connection to 'ws://[server-ip-address]/' failed
ℹ Shutting down...
/usr/src/osjs/node_modules/ws/lib/websocket.js:320
throw err;
^
Error: WebSocket is not open: readyState 2 (CLOSING)
at WebSocket.send (/usr/src/osjs/node_modules/ws/lib/websocket.js:314:19)
at Timeout.setInterval [as _onTimeout] (/usr/src/osjs/node_modules/@osjs/server/src/providers/core.js:193:12)
at ontimeout (timers.js:436:11)
at tryOnTimeout (timers.js:300:5)
at listOnTimeout (timers.js:263:5)
at Timer.processTimers (timers.js:223:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @osjs/osjs@3.1.12 serve: `node src/server/index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @osjs/osjs@3.1.12 serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Getting that server error on shutdown is normal.
On Sun, 3 Jul 2022, 20:36 mahsashadi, @.***> wrote:
ℹ Shutting down...
/usr/src/osjs/node_modules/ws/lib/websocket.js:320
throw err; ^
Error: WebSocket is not open: readyState 2 (CLOSING)
at WebSocket.send (/usr/src/osjs/node_modules/ws/lib/websocket.js:314:19) at Timeout.setInterval [as _onTimeout] ***@***.***/server/src/providers/core.js:193:12) at ontimeout (timers.js:436:11) at tryOnTimeout (timers.js:300:5) at listOnTimeout (timers.js:263:5) at Timer.processTimers (timers.js:223:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @@.*** serve:
node src/server/index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @@.*** serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
— Reply to this email directly, view it on GitHub https://github.com/os-js/osjs-server/issues/59#issuecomment-1173150619, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABHODEGSHCJNNAR4IPWU6DVSHMUFANCNFSM52RAB6SQ . You are receiving this because you commented.Message ID: @.***>
so why is it shutting down?
I thought yo did that.
Look through the log before that error for any more info.
On Sun, 3 Jul 2022, 20:41 mahsashadi, @.***> wrote:
so why is it shutting down?
— Reply to this email directly, view it on GitHub https://github.com/os-js/osjs-server/issues/59#issuecomment-1173151312, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABHODB3USJW4VQFGYO3IS3VSHNGLANCNFSM52RAB6SQ . You are receiving this because you commented.Message ID: @.***>
No useful logs or errors before.
Attach your full log here, or email me if it has private info.
On Sun, 3 Jul 2022, 20:49 mahsashadi, @.***> wrote:
No useful logs or errors before.
— Reply to this email directly, view it on GitHub https://github.com/os-js/osjs-server/issues/59#issuecomment-1173152196, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABHODCB5A7IVB7INJEB7Y3VSHOBXANCNFSM52RAB6SQ . You are receiving this because you commented.Message ID: @.***>
> @osjs/osjs@3.1.12 serve /usr/src/osjs
> node src/server/index.js
ℹ Initializing services...
ℹ Provider binding osjs/express
ℹ Proxying /grafana -> [some-address .......]
ℹ Starting services...
ℹ Provider binding osjs/packages
ℹ Using package discovery file /packages.json
ℹ Using package manifest file /dist/metadata.json
✔ Mounted osjs
✔ Mounted home
✔ Mounted myMonster
ℹ Provider binding osjs/fs
ℹ Provider binding osjs/vfs
ℹ Loading /src/packages/osjs-TIC-AI/server.js
ℹ Loading /src/packages/osjs-TIC-AI-10/server.js
ℹ Loading /src/packages/osjs-TIC-AI-6/server.js
ℹ Loading /src/packages/osjs-TIC-AI-3/server.js
ℹ Loading /src/packages/osjs-splash/server.js
ℹ Loading /node_modules/@burna/osjs-office-collabora/server.js
ℹ Loading /node_modules/@osjs/musicplayer-application/server.js
✔ Initialized!
ℹ Opening server connection
✔ Using 'connect-loki' sessions
✔ Serving '/dist'
✔ WebSocket listening on ws://localhost:8000
✔ Server listening on http://localhost:8000
POST /login 200 61 - 33.728 ms
GET /metadata.json 200 6762 - 8.041 ms
WebSocket connection opened
GET /themes/StandardTheme/main.js 200 1521 - 1.963 ms
{ [Error: ENOENT: no such file or directory, scandir '/usr/src/osjs/vfs/hafez/.desktop']
errno: -2,
code: 'ENOENT',
syscall: 'scandir',
path: '/usr/src/osjs/vfs/hafez/.desktop' }
GET /vfs/readdir?path=home%3A%2F.desktop 404 191 - 15.706 ms
{ [Error: ENOENT: no such file or directory, stat '/usr/src/osjs/vfs/hafez/.desktop/.shortcuts.json']
errno: -2,
code: 'ENOENT',
syscall: 'stat',
path: '/usr/src/osjs/vfs/hafez/.desktop/.shortcuts.json' }
GET /vfs/readfile?path=home%3A%2F.desktop%2F.shortcuts.json 404 217 - 15.305 ms
GET /themes/StandardTheme/main.css 200 10483 - 18.182 ms
GET /icons/GnomeIcons/main.css 200 34284 - 17.732 ms
GET /icons/GnomeIcons/icons/view-fullscreen.png 200 1334 - 3.521 ms
GET /dc35be17d0d5216ac4c918933825b620.jpg 200 147988 - 17.978 ms
GET /icons/GnomeIcons/icons/system-search.png 200 4115 - 1.250 ms
GET /881c86876af63b732063d7bdd51bb226.png 200 1034 - 1.527 ms
GET /icons/GnomeIcons/icons/preferences-desktop-locale.png 200 2832 - 1.150 ms
GET /sounds/FreedesktopSounds/service-login.mp3 206 44964 - 2.920 ms
GET /favicon.png 200 7625 - 1.903 ms
WebSocket connection closed
GET /sounds/FreedesktopSounds/message.mp3 206 8914 - 1.893 ms
WebSocket connection opened
WebSocket connection closed
WebSocket connection opened
I don't see any server closing there.
On Sun, 3 Jul 2022, 20:59 mahsashadi, @.***> wrote:
@@.*** serve /usr/src/osjs
node src/server/index.js
ℹ Initializing services...
ℹ Provider binding osjs/express
ℹ Proxying /grafana -> [some-address .......]
ℹ Starting services...
ℹ Provider binding osjs/packages
ℹ Using package discovery file /packages.json
ℹ Using package manifest file /dist/metadata.json
✔ Mounted osjs
✔ Mounted home
✔ Mounted myMonster
ℹ Provider binding osjs/fs
ℹ Provider binding osjs/vfs
ℹ Loading /src/packages/osjs-TIC-AI/server.js
ℹ Loading /src/packages/osjs-TIC-AI-10/server.js
ℹ Loading /src/packages/osjs-TIC-AI-6/server.js
ℹ Loading /src/packages/osjs-TIC-AI-3/server.js
ℹ Loading /src/packages/osjs-splash/server.js
ℹ Loading @.***/osjs-office-collabora/server.js
ℹ Loading @.***/musicplayer-application/server.js
✔ Initialized!
ℹ Opening server connection
✔ Using 'connect-loki' sessions
✔ Serving '/dist'
✔ WebSocket listening on ws://localhost:8000
✔ Server listening on http://localhost:8000
POST /login 200 61 - 33.728 ms
GET /metadata.json 200 6762 - 8.041 ms
WebSocket connection opened
GET /themes/StandardTheme/main.js 200 1521 - 1.963 ms
{ [Error: ENOENT: no such file or directory, scandir '/usr/src/osjs/vfs/hafez/.desktop']
errno: -2,
code: 'ENOENT',
syscall: 'scandir',
path: '/usr/src/osjs/vfs/hafez/.desktop' }
GET /vfs/readdir?path=home%3A%2F.desktop 404 191 - 15.706 ms
{ [Error: ENOENT: no such file or directory, stat '/usr/src/osjs/vfs/hafez/.desktop/.shortcuts.json']
errno: -2,
code: 'ENOENT',
syscall: 'stat',
path: '/usr/src/osjs/vfs/hafez/.desktop/.shortcuts.json' }
GET /vfs/readfile?path=home%3A%2F.desktop%2F.shortcuts.json 404 217 - 15.305 ms
GET /themes/StandardTheme/main.css 200 10483 - 18.182 ms
GET /icons/GnomeIcons/main.css 200 34284 - 17.732 ms
GET /icons/GnomeIcons/icons/view-fullscreen.png 200 1334 - 3.521 ms
GET /dc35be17d0d5216ac4c918933825b620.jpg 200 147988 - 17.978 ms
GET /icons/GnomeIcons/icons/system-search.png 200 4115 - 1.250 ms
GET /881c86876af63b732063d7bdd51bb226.png 200 1034 - 1.527 ms
GET /icons/GnomeIcons/icons/preferences-desktop-locale.png 200 2832 - 1.150 ms
GET /sounds/FreedesktopSounds/service-login.mp3 206 44964 - 2.920 ms
GET /favicon.png 200 7625 - 1.903 ms
WebSocket connection closed
GET /sounds/FreedesktopSounds/message.mp3 206 8914 - 1.893 ms
WebSocket connection opened
WebSocket connection closed
WebSocket connection opened
— Reply to this email directly, view it on GitHub https://github.com/os-js/osjs-server/issues/59#issuecomment-1173153716, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABHODGX4AAED2PZIAXTVYLVSHPKFANCNFSM52RAB6SQ . You are receiving this because you commented.Message ID: @.***>
It repeatedly open and close and then shut down, also in client I get the alarm of connection lost.
WebSocket connection closed
WebSocket connection opened
WebSocket connection closed
WebSocket connection opened
ℹ Shutting down...
/usr/src/osjs/node_modules/ws/lib/websocket.js:320
throw err;
^
Error: WebSocket is not open: readyState 2 (CLOSING)
at WebSocket.send (/usr/src/osjs/node_modules/ws/lib/websocket.js:314:19)
at Timeout.setInterval [as _onTimeout] (/usr/src/osjs/node_modules/@osjs/server/src/providers/core.js:193:12)
at ontimeout (timers.js:436:11)
at tryOnTimeout (timers.js:300:5)
at listOnTimeout (timers.js:263:5)
at Timer.processTimers (timers.js:223:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @osjs/osjs@3.1.12 serve: `node src/server/index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @osjs/osjs@3.1.12 serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-07-03T19_01_56_438Z-debug.log
Since there's no additional errors this is pretty much impossible for me to debug without acces to your server(s).
I would still like to know exactly what is going on in devtools network ws connection in order to see if its connecting the correct way.
Another tip is to try to test this on a completely fresh install with no customization.
On Sun, 3 Jul 2022, 21:04 mahsashadi, @.***> wrote:
It repeatedly open and close and then shut down, also in client I get the alarm of connection lost.
WebSocket connection closed
WebSocket connection opened
WebSocket connection closed
WebSocket connection opened
ℹ Shutting down...
/usr/src/osjs/node_modules/ws/lib/websocket.js:320
throw err; ^
Error: WebSocket is not open: readyState 2 (CLOSING)
at WebSocket.send (/usr/src/osjs/node_modules/ws/lib/websocket.js:314:19) at Timeout.setInterval [as _onTimeout] ***@***.***/server/src/providers/core.js:193:12) at ontimeout (timers.js:436:11) at tryOnTimeout (timers.js:300:5) at listOnTimeout (timers.js:263:5) at Timer.processTimers (timers.js:223:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @@.*** serve:
node src/server/index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @@.*** serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-07-03T19_01_56_438Z-debug.log
— Reply to this email directly, view it on GitHub https://github.com/os-js/osjs-server/issues/59#issuecomment-1173154537, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABHODFIOKLLVLB3UZFKIULVSHP43ANCNFSM52RAB6SQ . You are receiving this because you commented.Message ID: @.***>
I have nothing in network tab, just errors in console tab. OK, I will test with fresh install tomorrow, if I got the answer I will share it here. thanks a lot for your help
Again, devtools should show the ws connection no matter what.
At least on Chrome. You can even filter it with the "WS" button.
On Sun, 3 Jul 2022, 21:15 mahsashadi, @.***> wrote:
I have nothing in network tab, just errors in console tab. OK, I will test with fresh install tomorrow, if I got the answer I will share it here. thanks a lot for your help
— Reply to this email directly, view it on GitHub https://github.com/os-js/osjs-server/issues/59#issuecomment-1173156283, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABHODGJ77JOIBEFGQATGMLVSHRGTANCNFSM52RAB6SQ . You are receiving this because you commented.Message ID: @.***>
Yes, you are right.
There are ws connection rows. all have server-ip-adress in Name
col and 101
or finished
in status
col.
If its the right IP and port in devtools we can almost eliminate that it is a client issue. At least if there is no firewall on your server.
On Sun, 3 Jul 2022, 21:25 mahsashadi, @.***> wrote:
Yes, you are right.
There are ws connection rows. all have server-ip-adress in Name col and 101 or finished in status col.
— Reply to this email directly, view it on GitHub https://github.com/os-js/osjs-server/issues/59#issuecomment-1173157607, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABHODCJBOHLOMCZD3H6KBTVSHSKHANCNFSM52RAB6SQ . You are receiving this because you commented.Message ID: @.***>
Yes it is a right ip and port. So can it be a host server issue? considering that connection lost happenes after osjs login.
Since the server detects the socket it must be some kind of connection issue.
Does the client constantly alert, or do you get a pause between?
On Sun, 3 Jul 2022, 21:38 mahsashadi, @.***> wrote:
Yes it is a right ip and port. So can it be a host server issue? considering that connection lost happenes after osjs login.
— Reply to this email directly, view it on GitHub https://github.com/os-js/osjs-server/issues/59#issuecomment-1173159314, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABHODB3CDGFRUMQBE65G33VSHT2DANCNFSM52RAB6SQ . You are receiving this because you commented.Message ID: @.***>
I get the pause for some seconds (maybe less than 10) between.
Thats the internal timer. So you have a constant connection issue it seems.
On Sun, 3 Jul 2022, 21:52 mahsashadi, @.***> wrote:
I get the pause for some seconds (maybe less than 10) between.
— Reply to this email directly, view it on GitHub https://github.com/os-js/osjs-server/issues/59#issuecomment-1173161152, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABHODDJCI7WBDHC5MTTVMLVSHVPBANCNFSM52RAB6SQ . You are receiving this because you commented.Message ID: @.***>
Thats the internal timer. So you have a constant connection issue it seems.
What do you mean by internal timer? By connection issue you mean there is some problem with my host?
The internal timer on the client tries to reconnect on a configured interval (circa 5 seconds) when there is no activity, which is what you see. That basically means you never get "connected correctly".
On Sun, 3 Jul 2022, 21:59 mahsashadi, @.***> wrote:
Thats the internal timer. So you have a constant connection issue it seems.
What do you mean by internal timer? By connection issue you mean there is some problem with my host?
— Reply to this email directly, view it on GitHub https://github.com/os-js/osjs-server/issues/59#issuecomment-1173162039, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABHODCTKLEMKUCFRLVIJ3LVSHWIRANCNFSM52RAB6SQ . You are receiving this because you commented.Message ID: @.***>
Why this error happenes only after osjs login?
Ws connects after login.
On Sun, 3 Jul 2022, 22:05 mahsashadi, @.***> wrote:
Why this error happenes only after osjs login?
— Reply to this email directly, view it on GitHub https://github.com/os-js/osjs-server/issues/59#issuecomment-1173163018, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABHODG5U7VYYSX77DIZ6BDVSHXCHANCNFSM52RAB6SQ . You are receiving this because you commented.Message ID: @.***>
So what causes not connecting to host via ws? Firewall?
Again, hard to say.
Try to reproduce this on a fresh setup first so we can do this in smaller steps.
On Sun, 3 Jul 2022, 22:10 mahsashadi, @.***> wrote:
So what causes not connecting to host via ws? Firewall?
— Reply to this email directly, view it on GitHub https://github.com/os-js/osjs-server/issues/59#issuecomment-1173163666, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABHODF232YOGPWZBEO6JVLVSHXTFANCNFSM52RAB6SQ . You are receiving this because you commented.Message ID: @.***>
Doing a little cleanup of issues, so I'm closing this due to inactivity.
I just also remembered something. If you run this behind an Apache proxy you might simply be experiencing a common issue.
Your network tab should show the ws connection.
Check that you have no filters set.
Then refresh page with devtools open.
On Sun, 3 Jul 2022, 19:56 mahsashadi, @.***> wrote:
I have nothing in network tab,
In console I have this error: WebSocket connection to 'ws://[server-ip-address]/' failed
— Reply to this email directly, view it on GitHub https://github.com/os-js/osjs-server/issues/59#issuecomment-1173144526, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABHODAIZBENJRNRJLFBCNLVSHH5BANCNFSM52RAB6SQ . You are receiving this because you commented.Message ID: @.***>
I have osjs docker container running. After login, without any user interaction, my osjs keeps closing websocket connection and reopening that.
Error: websocket is not open, readyState 2 (closing)
what should the problem be? I have no other errors in my server logs.