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

web relaying crashing with PUT requests #4241

Closed
si458 opened this issue Jul 8, 2022 · 6 comments
Closed

web relaying crashing with PUT requests #4241

si458 opened this issue Jul 8, 2022 · 6 comments

Comments

@si458
Copy link
Collaborator

si458 commented Jul 8, 2022

Describe the bug
if i relay port 9000 for portainer, then update a stack i have, meshcentral is crashing and restarting?

To Reproduce
Steps to reproduce the behavior:

  1. relay port 9000 for portainer (no tls)
  2. login to portainer via relay
  3. update a stack (checked with network request console in firefox, shows a PUT request)

Expected behavior
to complete request and not crash

Screenshots
If applicable, add screenshots to help explain your problem.

Server Software (please complete the following information):

  • OS: [e.g. Ubuntu] Alpine
  • Virtualization: [e.g. Docker] Docker
  • Network: [e.g. LAN/WAN, reverse proxy, cloudflare, ssl offload, etc...] Hybrid Mode, Traefik reverse proxy
  • Version: [e.g. 1.0.43] 1.0.49
  • Node: [e.g. 18.4.0] 18.4.0
  • Browser: [e.g. Google Chrome] Firefox 102

Remote Device (please complete the following information):

  • Device: [e.g. Laptop] Dell Computer
  • OS: [e.g. Windows 10] Debian 11
  • Version: [e.g. 21H2] 11
  • Current Core Version (if known): [HINT: Go to a device then console Tab then type info] Current Core: Apr 4 2022, 2871001987

Additional context

2022-07-08T18:28:09.787512303Z MeshCentral HTTP redirection server running on port 80.
2022-07-08T18:28:09.836571803Z MeshCentral v1.0.49, Hybrid (LAN + WAN) mode, Production mode.
2022-07-08T18:28:11.800415437Z MeshCentral Intel(R) AMT server running on meshcentral.MYSERVER.com:4433.
2022-07-08T18:28:11.849665336Z MeshCentral HTTP server running on port 443.
2022-07-08T18:28:11.849693581Z MeshCentral HTTP relay server running on relay.meshcentral.MYSERVER.com:443.
2022-07-08T18:28:11.899822390Z Loaded web certificate from "https://traefik:443", host: "meshcentral.MYSERVER.com"
2022-07-08T18:28:11.899853769Z   SHA384 cert hash: LONGSTRING
2022-07-08T18:28:11.900184791Z   SHA384 key hash: LONGSTRING
2022-07-08T18:29:12.491712068Z ERR: /opt/meshcentral/meshcentral/node_modules/express/lib/router/index.js:646
2022-07-08T18:29:12.491764165Z     return fn.apply(this, arguments);
2022-07-08T18:29:12.491773703Z               ^
2022-07-08T18:29:12.491781718Z 
2022-07-08T18:29:12.491789327Z TypeError: Cannot read properties of undefined (reading 'apply')
2022-07-08T18:29:12.491797060Z     at /opt/meshcentral/meshcentral/node_modules/express/lib/router/index.js:646:15
2022-07-08T18:29:12.491804891Z     at next (/opt/meshcentral/meshcentral/node_modules/express/lib/router/index.js:265:14)
2022-07-08T18:29:12.491812654Z     at Function.handle (/opt/meshcentral/meshcentral/node_modules/express/lib/router/index.js:175:3)
2022-07-08T18:29:12.491820416Z     at Object.router [as webRelayRouter] (/opt/meshcentral/meshcentral/node_modules/express/lib/router/index.js:47:12)
2022-07-08T18:29:12.491828217Z     at /opt/meshcentral/meshcentral/webserver.js:5879:99
2022-07-08T18:29:12.491835968Z     at Layer.handle [as handle_request] (/opt/meshcentral/meshcentral/node_modules/express/lib/router/layer.js:95:5)
2022-07-08T18:29:12.491843801Z     at trim_prefix (/opt/meshcentral/meshcentral/node_modules/express/lib/router/index.js:328:13)
2022-07-08T18:29:12.491851638Z     at /opt/meshcentral/meshcentral/node_modules/express/lib/router/index.js:286:9
2022-07-08T18:29:12.491859226Z     at Function.process_params (/opt/meshcentral/meshcentral/node_modules/express/lib/router/index.js:346:12)
2022-07-08T18:29:12.491866979Z     at next (/opt/meshcentral/meshcentral/node_modules/express/lib/router/index.js:280:10)
2022-07-08T18:29:12.494050610Z ERR: 
2022-07-08T18:29:12.494080892Z Node.js v18.4.0
2022-07-08T18:29:12.527729462Z Error: Command failed: /usr/local/bin/node /opt/meshcentral/meshcentral/meshcentral --launch 7
2022-07-08T18:29:12.527765127Z /opt/meshcentral/meshcentral/node_modules/express/lib/router/index.js:646
2022-07-08T18:29:12.527775197Z     return fn.apply(this, arguments);
2022-07-08T18:29:12.527783057Z               ^
2022-07-08T18:29:12.527790733Z 
2022-07-08T18:29:12.527798293Z TypeError: Cannot read properties of undefined (reading 'apply')
2022-07-08T18:29:12.527806294Z     at /opt/meshcentral/meshcentral/node_modules/express/lib/router/index.js:646:15
2022-07-08T18:29:12.527814287Z     at next (/opt/meshcentral/meshcentral/node_modules/express/lib/router/index.js:265:14)
2022-07-08T18:29:12.527822154Z     at Function.handle (/opt/meshcentral/meshcentral/node_modules/express/lib/router/index.js:175:3)
2022-07-08T18:29:12.527830185Z     at Object.router [as webRelayRouter] (/opt/meshcentral/meshcentral/node_modules/express/lib/router/index.js:47:12)
2022-07-08T18:29:12.527838328Z     at /opt/meshcentral/meshcentral/webserver.js:5879:99
2022-07-08T18:29:12.527846139Z     at Layer.handle [as handle_request] (/opt/meshcentral/meshcentral/node_modules/express/lib/router/layer.js:95:5)
2022-07-08T18:29:12.527868057Z     at trim_prefix (/opt/meshcentral/meshcentral/node_modules/express/lib/router/index.js:328:13)
2022-07-08T18:29:12.527876408Z     at /opt/meshcentral/meshcentral/node_modules/express/lib/router/index.js:286:9
2022-07-08T18:29:12.527883594Z     at Function.process_params (/opt/meshcentral/meshcentral/node_modules/express/lib/router/index.js:346:12)
2022-07-08T18:29:12.527890989Z     at next (/opt/meshcentral/meshcentral/node_modules/express/lib/router/index.js:280:10)
2022-07-08T18:29:12.527898067Z 
2022-07-08T18:29:12.527904777Z Node.js v18.4.0
2022-07-08T18:29:12.527934929Z 
2022-07-08T18:29:12.527942707Z     at ChildProcess.exithandler (node:child_process:389:12)
2022-07-08T18:29:12.527949966Z     at ChildProcess.emit (node:events:549:35)
2022-07-08T18:29:12.527957081Z     at maybeClose (node:internal/child_process:1091:16)
2022-07-08T18:29:12.527964297Z     at ChildProcess._handle.onexit (node:internal/child_process:302:5) {
2022-07-08T18:29:12.527971572Z   code: 1,
2022-07-08T18:29:12.527978435Z   killed: false,
2022-07-08T18:29:12.527985407Z   signal: null,
2022-07-08T18:29:12.527992297Z   cmd: '/usr/local/bin/node /opt/meshcentral/meshcentral/meshcentral --launch 7'
2022-07-08T18:29:12.527999390Z }
2022-07-08T18:29:12.528006210Z ERROR: MeshCentral failed with critical error, check mesherrors.txt. Restarting in 5 seconds...

Your config.json file

{
  "$schema": "http://info.meshcentral.com/downloads/meshcentral-config-schema.json",
  "settings": {
    "cert": "meshcentral.myserver.com",
    "port": 443,
    "redirPort": 80,
    "AgentPong": 300,
    "authLog": "/opt/meshcentral/meshcentral-data/authlog.log",
    "trustedProxy": "traefik",
    "relayDNS": "relay.meshcentral.myserver.com",
    "tlsOffload": "traefik",
    "webRTC": true,
    "autoBackup": {
        "backupIntervalHours": 1,
        "keepLastDaysBackup": 7,
        "backupPath": "/opt/meshcentral/meshcentral-backup"
    }
  },
  "domains": {
	"": {
	  "title": "MyCentral",
      "certUrl": "https://traefik:443",
      "agentCustomization": {
          "companyName": "My Ltd",
          "image": "128x128.png"
      },
      "assistantCustomization": {
          "image": "128x128.png"
      },
      "androidCustomization": {
          "image": "128x128.png"
      }
	}
  }
}
@si458 si458 added the bug label Jul 8, 2022
@Ylianst Ylianst self-assigned this Jul 8, 2022
@arduin0guru
Copy link

Clear Browser Cash and cookies

@si458
Copy link
Collaborator Author

si458 commented Jul 8, 2022

Clear Browser Cash and cookies

Already done that, this is a physical serverside issue as its crashing the server

@Ylianst
Copy link
Owner

Ylianst commented Jul 9, 2022

Can you test again with MeshCentral v1.0.50? Let me know if it works now.

@si458
Copy link
Collaborator Author

si458 commented Jul 10, 2022

@Ylianst sorry for delay, yes its now working with 1.0.50
HOWEVER any DELETE requests are now not working and returning a 404 not found error
https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods

@Ylianst
Copy link
Owner

Ylianst commented Jul 10, 2022

Ha, ok. I will add DELETE and look to see of others should be added :)

@si458
Copy link
Collaborator Author

si458 commented Jul 12, 2022

bingo! thanks for 1.0.51 works a treat now!

@si458 si458 closed this as completed Jul 12, 2022
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

3 participants