l3mpire / lemverse

The first-ever coworking metaverse
https://app.lemverse.com
GNU Affero General Public License v3.0
149 stars 43 forks source link

Production deployment error #1

Closed ThibManfredi closed 2 years ago

ThibManfredi commented 3 years ago

Hello !

I'm facing an issue regarding the rproduction deployment process

The deploy script failed after the check of the health of the application, there is the logs

+ @babel/runtime@7.15.4
updated 1 package and audited 261 packages in 2.039s

40 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

ubuntu@meet:~/lemverse/app$ ./deploy
Are you sure you want to deploy in production? (ctrl-c if not)

sourcing nvm from ~/.nvm
Now using node v14.17.5 (npm v6.14.14)

Meteor Up Ubuntu 18+ lempire patch 😎 + rsync + microservice
------------------------------------------------------------

Building Started: .

Started TaskList: Deploy app 'lemverse' on 'lemverse' (linux)
[meet.flexper.xyz] - Rsyncing bundle
root@meet.flexper.xyz's password:

Number of files: 46,697 (reg: 41,931, dir: 4,692, link: 74)
Number of created files: 25 (reg: 11, dir: 14)
Number of deleted files: 2,834 (reg: 2,375, dir: 439, link: 20)
Number of regular files transferred: 31
Total file size: 281.09M bytes
Total transferred file size: 7.53M bytes
Literal data: 7.42M bytes
Matched data: 109.04K bytes
File list size: 65.52K
File list generation time: 0.001 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 3.89M
Total bytes received: 336.64K

sent 3.89M bytes  received 336.64K bytes  76.10K bytes/sec
total size is 281.09M  speedup is 66.55

[meet.flexper.xyz] - Rsyncing bundle: SUCCESS
[meet.flexper.xyz] - Setting up Environment Variables
[meet.flexper.xyz] - Setting up Environment Variables: SUCCESS
[meet.flexper.xyz] - Invoking deployment process
[meet.flexper.xyz] x Invoking deployment process: FAILED

    -----------------------------------STDERR-----------------------------------
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
    curl: (7) Failed to connect to localhost port 9000: Connection refused
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
    curl: (7) Failed to connect to localhost port 9000: Connection refused
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
    curl: (7) Failed to connect to localhost port 9000: Connection refused
    Latest deployment failed! Reverted back to the previous version.
    -----------------------------------STDOUT-----------------------------------
    bundle/programs/server/npm/node_modules/meteor/lempire_lempire/node_modules/sweetalert
    underscore.string@3.3.5 /opt/lemverse/tmp/bundle/programs/server/npm/node_modules/meteor/lempire_lempire/node_modules/underscore.string
    v8-profiler-node8@6.2.0 /opt/lemverse/tmp/bundle/programs/server/npm/node_modules/meteor/lempire_lempire/node_modules/v8-profiler-node8
    {
      "npm": "6.14.13",
      "ares": "1.17.1",
      "brotli": "1.0.9",
      "cldr": "39.0",
      "icu": "69.1",
      "llhttp": "2.1.3",
      "modules": "83",
      "napi": "8",
      "nghttp2": "1.42.0",
      "node": "14.17.3",
      "openssl": "1.1.1k",
      "tz": "2021a",
      "unicode": "13.0",
      "uv": "1.41.0",
      "v8": "8.4.371.23-node.67",
      "zlib": "1.2.11"
    }
    added 152 packages from 84 contributors and audited 153 packages in 21.066s

    4 packages are looking for funding
      run `npm fund` for details

    found 0 vulnerabilities

    Waiting for MongoDB to initialize. (5 minutes)
    connected
    Waiting for 10 seconds while app is booting up
    Checking is app booted or not?
    curl failed
    ----------------------------------------------------------------------------

There is the systemd logs:

● lemverse.service - Meteor Up - lemverse on lemverse
     Loaded: loaded (/lib/systemd/system/lemverse.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2021-09-08 09:58:10 UTC; 50s ago
    Process: 153688 ExecStart=/opt/nodejs/bin/node --title=lemverse --max-old-space-size=8192 --expose-gc /opt/lemverse/app/main.js (code=exited, status=1/FAILURE)
   Main PID: 153688 (code=exited, status=1/FAILURE)

Sep 08 09:58:09 meet.flexper.xyz systemd[1]: lemverse.service: Main process exited, code=exited, status=1/FAILURE
Sep 08 09:58:09 meet.flexper.xyz systemd[1]: lemverse.service: Failed with result 'exit-code'.
Sep 08 09:58:10 meet.flexper.xyz systemd[1]: lemverse.service: Scheduled restart job, restart counter is at 5.
Sep 08 09:58:10 meet.flexper.xyz systemd[1]: Stopped Meteor Up - lemverse on lemverse.
Sep 08 09:58:10 meet.flexper.xyz systemd[1]: lemverse.service: Start request repeated too quickly.
Sep 08 09:58:10 meet.flexper.xyz systemd[1]: lemverse.service: Failed with result 'exit-code'.
Sep 08 09:58:10 meet.flexper.xyz systemd[1]: Failed to start Meteor Up - lemverse on lemverse.

And the logs with the exec made by systemd:

/opt/lemverse/app/programs/server/node_modules/fibers/fibers.js:92
                    return fn.apply(this, arguments);
                              ^

Error:
The @babel/runtime npm package could not be found in your node_modules
directory. Please run the following command to install it:

  meteor npm install --save @babel/runtime

    at module (packages/babel-runtime.js:20:9)
    at fileEvaluate (packages/modules-runtime.js:336:7)
    at Module.require (packages/modules-runtime.js:238:14)
    at require (packages/modules-runtime.js:258:21)
    at packages/babel-runtime.js:53:15
    at packages/babel-runtime.js:58:3
    at /opt/lemverse/app/programs/server/boot.js:401:38
    at Array.forEach (<anonymous>)
    at /opt/lemverse/app/programs/server/boot.js:226:21
    at /opt/lemverse/app/programs/server/boot.js:464:7

I'm trying to launch the application on an AWS VPS with ubuntu

Can you help me ? :)

Donorhan commented 3 years ago

Thanks for the details, I managed to reproduce the problem and am on it :)

Donorhan commented 3 years ago

I did a complete installation of lemverse on an Ubuntu VM. I didn't have the problem with @babel/runtime so I invite you to get the last commits, remove node_modules and package-lock and re-install.

I added the missing information about the Mongo configuration, without these modifications the project would'nt start.

I'm available on lemverse if you want to talk about it and get some help during the installation :)

ThibManfredi commented 3 years ago

Hello !

I've tried the fix regarding mongo for the production deployment part. It fix the problem that regarding babel/runtime in the start of the application thanks :)

I've got an another problem regarding the peer configuration, in the "settings.json" configuration file, I fill the peer.server.url with my personal https access for our lemverse. Do I need to configure something else regarding the peer ?

My error when I'm on lemverse

Uncaught TypeError: Cannot read properties of undefined (reading 'callDelay')
    at Object.onProximityStarted (31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9202)
    at Object.addNearUser (31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9202)
    at Object.checkDistance (31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9202)
    at 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9202
    at Array.forEach (<anonymous>)
    at Object.checkDistances (31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9202)
    at e.postUpdate (31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9202)
    at t [as emit] (31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:74)
    at t.step (31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:1189)
    at t.update (31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:2439)
Donorhan commented 3 years ago

Can you share your settings.json (without the sensitive data)?

ThibManfredi commented 3 years ago

Yes of course

{
  "public": {
    "lp": {
      "product": "lemverse",
      "process": "main",
      "admins": [],
      "production": true,
      "staging": false,
      "enableLogClient": false
    },

    "debug": false,

    "defaultReaction": "❤️",

    "zoom": 1,

    "meet": {
      "serverURL": "*************",
      "roomDefaultName": "flexper-hall"
    },

    "character": {
      "walkSpeed": 180,
      "runSpeed": 720
    },

    "characterNames": ["Basic", "Ghost"],

    "skins": {
      "guest": "Ghost",
      "default": "Basic"
    },

    "templateLevelId": "lvl_iLOVEaLOTlemverse"
  },

  "defaultLevelId": "lvl_iLOVEaLOTlemverse",

  "peer": {
    "answerMaxAttempt": 5,
    "answerDelayBetweenAttempt": 750,
    "avatars": [
        "https://www.monchat.ca/wp-content/uploads/2020/01/Fond-ecran-mignon-chaton-en-position-de-priere-1024x640.jpg",
        "https://animalaxy.fr/wp-content/uploads/2019/02/iStock5.jpg",
        "https://cdn.radiofrance.fr/s3/cruiser-production/2018/12/9f19b228-269f-4995-ba7f-eda054945811/1136_gettyimages-155607257.jpg",
        "https://chatfaitdubien.fr/wp-content/uploads/2016/09/chaton.jpg",
        "https://i.pinimg.com/564x/8b/f7/c6/8bf7c6e26f7250944e963f23f364b68f.jpg"
    ],
      "callDelay": 250
  },

  "peer": {
    "server": {
      "url": "**********",
      "port": 443,
      "path": "/peer",
      "credentialDuration": 86400,
      "secret": "",
      "config": {
        "iceServers": [{
          "urls": "stun:stun.l.google.com:19302"
        }],
        "sdpSemantics": "unified-plan"
      }
    }
  }
}
Donorhan commented 3 years ago

The problem is that you have two peers at the same level, you need one in public and one outside (The one in public was missing)

{
  "public": {
    "lp": {
      "product": "lemverse",
      "process": "main",
      "admins": [],
      "production": true,
      "staging": false,
      "enableLogClient": false
    },

    "debug": false,

    "defaultReaction": "❤️",

    "zoom": 1,

    "peer": {
      "answerMaxAttempt": 5,
      "answerDelayBetweenAttempt": 750,
      "avatars": [
          "https://www.monchat.ca/wp-content/uploads/2020/01/Fond-ecran-mignon-chaton-en-position-de-priere-1024x640.jpg",
          "https://animalaxy.fr/wp-content/uploads/2019/02/iStock5.jpg",
          "https://cdn.radiofrance.fr/s3/cruiser-production/2018/12/9f19b228-269f-4995-ba7f-eda054945811/1136_gettyimages-155607257.jpg",
          "https://chatfaitdubien.fr/wp-content/uploads/2016/09/chaton.jpg",
          "https://i.pinimg.com/564x/8b/f7/c6/8bf7c6e26f7250944e963f23f364b68f.jpg"
      ],
      "callDelay": 250
    },

    "meet": {
      "serverURL": "*************",
      "roomDefaultName": "flexper-hall"
    },

    "character": {
      "walkSpeed": 180,
      "runSpeed": 720
    },

    "characterNames": ["Basic", "Ghost"],

    "skins": {
      "guest": "Ghost",
      "default": "Basic"
    },

    "templateLevelId": "lvl_iLOVEaLOTlemverse"
  },

  "defaultLevelId": "lvl_iLOVEaLOTlemverse",

  "peer": {
    "server": {
      "url": "**********",
      "port": 443,
      "path": "/peer",
      "credentialDuration": 86400,
      "secret": "",
      "config": {
        "iceServers": [{
          "urls": "stun:stun.l.google.com:19302"
        }],
        "sdpSemantics": "unified-plan"
      }
    }
  }
}
riderx commented 3 years ago

If you need i deployed it wwith docker-compose and docker : https://github.com/riderx/lemverse-deploy

ThibManfredi commented 3 years ago

Oh cool ! :) I'll try this !

I've got an another issue regarding the peer connection

Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first. https://goo.gl/xX8pDD
play @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9202
createPeerCalls @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9202
(anonymous) @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9202
r.withValue @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:1
(anonymous) @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:1
(anonymous) @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:1
setTimeout (async)
n.setTimeout @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:1
onProximityStarted @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9202
addNearUser @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9202
checkDistance @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9202
(anonymous) @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9202
checkDistances @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9202
playerUpdate @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9202
changed @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9202
changed @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9018
applyChange.changed @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9018
(anonymous) @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9018
t.runTask @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:1
t.flush @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:1
t.drain @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:1
update @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9018
update @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9040
n.<computed> @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9032
(anonymous) @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9032
(anonymous) @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9032
_performWrites @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9032
_flushBufferedWrites @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9032
(anonymous) @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:1
setTimeout (async)
_livedata_data @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9032
onMessage @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9032
(anonymous) @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9030
forEachCallback @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9030
socket.onmessage @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9030
r.dispatchEvent @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9030
k._dispatchMessage @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9030
k._didMessage @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9030
o.ws.onmessage @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9030
31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:8933 WebSocket connection to 'wss://lemverse.flexper.xyz/myapp/peerjs?key=peerjs&id=usr_MYSGv5y6Rf9K6AXCY&token=iye0uf3kaw' failed: 
e.start @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:8933
e._initialize @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:8933
e @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:8933
(anonymous) @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9202
(anonymous) @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:1
_maybeInvokeCallback @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9032
receiveResult @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9032
_livedata_result @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9032
onMessage @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9032
(anonymous) @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9030
forEachCallback @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9030
socket.onmessage @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9030
r.dispatchEvent @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9030
k._dispatchMessage @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9030
k._didMessage @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9030
o.ws.onmessage @ 31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9030
31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9165 peer error network Error: Lost connection to server.
    at e.emitError (31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:8933)
    at e.<anonymous> (31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:8933)
    at e.u.emit (31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:8933)
    at WebSocket._socket._disconnected._socket.onclose (31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:8933)
31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9165 lp.timeout: Started
31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9165 lp.timeout: Ended in 0ms
31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9165 lp.timeout: Started
31600b1da77a74409724a4999a9f8707514f968d.js?meteor_js_resource=true:9165 lp.timeout: Ended in 0ms

Do I have a peer server to deploy in addition to lemverse ? or my configuration of the settings.json is wrong ?

There is my settings.json file

{
  "public": {
    "lp": {
      "product": "lemverse",
      "process": "main",
      "admins": [],
      "production": true,
      "staging": false,
      "enableLogClient": false
    },

    "debug": false,

    "defaultReaction": "❤️",

    "zoom": 1,

    "peer": {
      "answerMaxAttempt": 5,
      "answerDelayBetweenAttempt": 750,
      "avatars": [
          "https://www.monchat.ca/wp-content/uploads/2020/01/Fond-ecran-mignon-chaton-en-position-de-priere-1024x640.jpg",
          "https://animalaxy.fr/wp-content/uploads/2019/02/iStock5.jpg",
          "https://cdn.radiofrance.fr/s3/cruiser-production/2018/12/9f19b228-269f-4995-ba7f-eda054945811/1136_gettyimages-155607257.jpg",
          "https://chatfaitdubien.fr/wp-content/uploads/2016/09/chaton.jpg",
          "https://i.pinimg.com/564x/8b/f7/c6/8bf7c6e26f7250944e963f23f364b68f.jpg"
      ],
      "callDelay": 250
    },

    "meet": {
      "serverURL": "<JISTI_CONNECTION>",
      "roomDefaultName": "flexper-hall"
    },

    "character": {
      "walkSpeed": 180,
      "runSpeed": 720
    },

    "characterNames": ["Basic", "Ghost"],

    "skins": {
      "guest": "Ghost",
      "default": "Basic"
    },

    "templateLevelId": "lvl_iLOVEaLOTlemverse"
  },

  "defaultLevelId": "lvl_iLOVEaLOTlemverse",

  "peer": {
    "server": {
      "url": "<my_lemverse_domain>",
      "port": 443,
      "path": "/myapp",
      "credentialDuration": 86400,
      "secret": "flexper2019",
      "config": {
        "iceServers": [{
          "urls": "stun:stun.l.google.com:19302"
        }],
        "sdpSemantics": "unified-plan"
      }
    }
  }
}

I've tried multiple settings in the peer.server scope but I can't make this error disapear

Donorhan commented 3 years ago

On which browser do you have this error? This message exists when your browser tries to play a sound or use a media when you haven't interacted with the web page. Normally this is not a problem. I recently made a commit to work around this problem, if your version of lemverse is up to date you shouldn't see this message.

ThibManfredi commented 3 years ago

I have this error on the chrome browser but it appear only I did my tests ! I no more have this log.

I had to deploy a peer-js server in addition to lemverse for make the communication betwwen user works, I didn't see this in the Readme, it could be good to add it ;)

Thanks for the help !

riderx commented 3 years ago

@ThibManfredi on the setting you didn't change this "url": "<my_lemverse_domain>", it should reflect your peer url, if you use lemverse in local it should be http://localhost or your domain where you deploy your lemverse .

riderx commented 3 years ago

@ThibManfredi Lemverse run a peer server internally, but you can use external one as I did too .

ThibManfredi commented 3 years ago

@riderx In the first place I use to fill the peer.server.url field with the domain of lemverse, but I always had a connection "WebSocket Connection failed" :/

I deploy peer-js server with tls certificate and specific server block in nginx

riderx commented 3 years ago

@ThibManfredi are you on thr right endpoint if you deploy peer with docker the endpoint by default is /myapp for peer

riderx commented 3 years ago

just to let you know on dockerhub i build 2 version :

DblK commented 2 years ago

@ThibManfredi, do you still need help? If no, I will close this issue in few days.

DblK commented 2 years ago

Closing because no more active.