Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to 1.0.49 Unable to connect web socket, click to reconnect. #4242

Closed
ClickLeft opened this issue Jul 9, 2022 · 19 comments
Closed

Upgrade to 1.0.49 Unable to connect web socket, click to reconnect. #4242

ClickLeft opened this issue Jul 9, 2022 · 19 comments

Comments

@ClickLeft
Copy link

ClickLeft commented Jul 9, 2022

I just upgraded from 1.0.48 to 1.0.49. No other changes made. Now I'm getting this error after logging on: "Unable to connect web socket, click to reconnect."

To Reproduce
Steps to reproduce the behavior:

  1. Lot into MechCentral
  2. Error "Unable to connect web socket, click to reconnect." appears
  3. If you click to reconnect, it takes you back to the login screen.

ce1bd645-1946-4caf-8484-6062c88ce033 1

Expected behavior
You would normally see the list of systems after logging in.

Server Software (please complete the following information):

  • OS: Windows 10
  • Virtualization: N/A
  • Version: 1.0.49
  • Node: 16.16.0
  • Browser: Google Chrome 103.0.5060.114 64-bit

Remote Device (please complete the following information):

  • Device: Laptop / Desktop
  • LAN/WAN
  • OS: Windows 10
  • Version: 21H2

Config.json

{
  "settings": {
    "cert": "mesh.XXXXX.com",
    "_minify": true,
	"AllowHighQualityDesktop": true
  },
"letsencrypt": {
 "email": "XXX@XXXX.com",
 "names": "mesh.XXXX.com,
 "rsaKeySize": 3072,
 "production": true,
 "desktopMultiplex": true
}
}
@ClickLeft ClickLeft added the bug label Jul 9, 2022
@Fefo60
Copy link

Fefo60 commented Jul 9, 2022

Try clearing cookies
It worked for me

@si458
Copy link
Collaborator

si458 commented Jul 9, 2022

@ClickLeft yes you need to clear your cookies sorry!

Because we changed from single domain cookies to subdomain cookies

And sadly the old single domain cookie is still left behind and the server gets confused because the client sends two cookies instead of one!?

@I2700I
Copy link

I2700I commented Jul 9, 2022

Interestingly enough, the issue does not reproduce in FF and Safari, is it a chromium-only case? Chrome and Edge fail the same way.

@si458
Copy link
Collaborator

si458 commented Jul 9, 2022 via email

@uzmanager2
Copy link

Hello .

I confirm the bug. The problem appears on Chrome and Firefox when trying to access by IP address, not by hostname.

@si458
Copy link
Collaborator

si458 commented Jul 9, 2022

Hello .

I confirm the bug. The problem appears on Chrome and Firefox when trying to access by IP address, not by hostname.

@uzmanager2 Just simply clear your cookies and away it goes, it's not a bug!

Its Because we changed from single domain cookies to subdomain cookies

And sadly the old single domain cookie is still left behind and the server gets confused because the client sends two cookies instead of one!?

@uzmanager2
Copy link

I tried logging in with clear cookies but that didn't solve the problem. When accessing through the hostname - the problem does not appear.

@si458
Copy link
Collaborator

si458 commented Jul 9, 2022

@uzmanager2 oh yeh crap, accessing via an ip address isn't going to work because of the subdomain cookie!

So sorry about this! I never through about ip access!?

I'll see if I can do a PR to fix this if it's ip based for the moment

As i believe @Ylianst is working on rewriting the web relay for cookies!

But for now it is required to access via a domain name!

@Ylianst
Copy link
Owner

Ylianst commented Jul 9, 2022

I removed the domain for the cookie as that is not going to work well for many people. I am almost done on the improved version with the fix.

@Ylianst
Copy link
Owner

Ylianst commented Jul 9, 2022

Just put in the fix, working on releasing now.

@Ylianst
Copy link
Owner

Ylianst commented Jul 9, 2022

MeshCentral v1.0.50 is published. Cookies and web relay should both work.

@openncomp
Copy link

Now it works! Thank you very much!

@uzmanager2
Copy link

It works! Thank you very much!

@ClickLeft
Copy link
Author

MeshCentral v1.0.50 is published. Cookies and web relay should both work.

Wow, that was quick! I Installed the update, but now the "MeshCentral" service doesn't start at all.

@Ylianst
Copy link
Owner

Ylianst commented Jul 9, 2022

@ClickLeft Can you provide any hints as to what is going on? Your OS, NodeJS version, any errors in "meshcentral-data/mesherrors.txt"? Can you start MeshCentral manually and see if anything shows up? - Thanks.

@ClickLeft
Copy link
Author

ClickLeft commented Jul 9, 2022

@ClickLeft Can you provide any hints as to what is going on? Your OS, NodeJS version, any errors in "meshcentral-data/mesherrors.txt"? Can you start MeshCentral manually and see if anything shows up? - Thanks.

OS: Windows 10 21H1
Node: 16.16.0

meshcentral-data/mesherrors.txt doesn't exist.

Trying to figure out how to start it manually now...

"C:\Program Files\Open Source\MeshCentral\winservice\daemon\meshcentral.err.log"

node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'C:\Program Files\Open Source\MeshCentral\node_modules\node-windows\lib\wrapper.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'C:\Program Files\Open Source\MeshCentral\node_modules\node-windows\lib\wrapper.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

@ClickLeft
Copy link
Author

@ClickLeft Can you provide any hints as to what is going on? Your OS, NodeJS version, any errors in "meshcentral-data/mesherrors.txt"? Can you start MeshCentral manually and see if anything shows up? - Thanks.

AH, If I run it manually via node meshcentral it works! It's like the service needs to be reinstalled. I tried reinstalling everything, but it didn't work.

@Ylianst
Copy link
Owner

Ylianst commented Jul 9, 2022

If you run node node_modules/meshcentral --help you should see this:

MeshCentral v1.0.50, remote computer management web portal.
This software is open source under Apache 2.0 license.
Details at: https://www.meshcentral.com

Run as a background service
   --install/uninstall               Install MeshCentral as a background service.
   --start/stop/restart              Control MeshCentral background service.

Run standalone, console application
   --user [username]                 Always login as [username] if account exists.
   --port [number]                   Web server port number.
   --redirport [number]              Creates an additional HTTP server to redirect users to the HTTPS server.
   --exactports                      Server must run with correct ports or exit.
   --noagentupdate                   Server will not update mesh agent native binaries.
   --nedbtodb                        Transfer all NeDB records into current database.
   --listuserids                     Show a list of a user identifiers in the database.
   --cert [name], (country), (org)   Create a web server certificate with [name] server name.
                                     country and organization can optionally be set.

Server recovery commands, use only when MeshCentral is offline.
   --createaccount [userid]          Create a new user account.
   --resetaccount [userid]           Unlock an account, disable 2FA and set a new account password.
   --adminaccount [userid]           Promote account to site administrator.

You can try:

node node_modules/meshcentral --uninstall
node node_modules/meshcentral --install

@ClickLeft
Copy link
Author

@Ylianst Thank you, you're amazing! That worked and both issues are resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants