What? UnhandledPromiseRejectionWarning


  • Trying to upgrade from 1.9.x to 2.4.0 but getting this.
    I can't afford to break the forums so figured I should ask directly as this is too important to try things I find on the Internet.

    I went back to the backup for now. Here is what shows then nothing more happens.

    at async Configs.list (/opt/nodebb/src/meta/configs.js:98:9)
    (Use node --trace-warnings ... to show where the warning was created)
    (node:155485) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch().

    To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
    (node:155485) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

  • NodeBB Admin

    @NodeHam Please post the entire stack trace for the error you are getting. at async Configs.list (/opt/nodebb/src/meta/configs.js:98:9) is only part of the error message.


  • Hi, I restored the vm so all was lost as I wanted to get the server up again asap.

    Is the stack trace in the nodebb/logs or with the web server?

    I can try to upgrade again and this time, keep what ever shows up if it happens again.

  • NodeBB Admin

    @NodeHam It should be in logs/output.log in the nodebb folder.


  • I tried again and still having problems. Seems to be a warning however and maybe not a problem.

    Trying to go from 1.19.2 to 2.5.2. The strange thing is the that GUI shows it's running 2.5.2 now. Should I restore the backup I made before anyone posts something?

    These are the steps I took and the error that comes.

    systemctl stop nodebb
    tar -cvf /new/nodebb-9-19-2022.tar /opt/nodebb/
    mongodump -d nodebb -o /new/mongodump/nodebb-
    dnf update nodejs
    git fetch
    git checkout v2.x
    git reset --hard origin/v2.x
    ./nodebb upgrade

    Updating NodeBB...
    
    1. Updating package.json file with defaults...  OK
    
    2. Bringing base dependencies up to date...  started
    npm WARN @apidevtools/[email protected] requires a peer of [email protected]>=7 but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of [email protected]^1.16.0 but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of [email protected]^0.14.2 but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of [email protected]>= 4.21.0 but none is installed. You must install peer dependencies yourself.
    
    audited 1431 packages in 11.595s
    
    128 packages are looking for funding
      run `npm fund` for details
    
    found 14 vulnerabilities (4 moderate, 6 high, 4 critical)
      run `npm audit fix` to fix them, or `npm audit` for details
     ╭────────────────────────────────────────────────────────────────╮
       │                                                                │
       │      New major version of npm available! 6.14.17 → 8.19.2      │
       │   Changelog: https://github.com/npm/cli/releases/tag/v8.19.2   │
       │               Run npm install -g npm to update!                │
       │                                                                │
       ╰────────────────────────────────────────────────────────────────╯
    
    
    3. Checking installed plugins for updates...Checking installed plugins and themes for updates...   OK
    All packages up-to-date!
    
    4. Updating NodeBB data store schema...2022-09-19T15:50:26.848Z [4567/18808] - verbose: [minifier] utilizing a maximum of 3 additional threads
    Error occurred during upgrade: TypeError: maxAge must be a number
        at LRUCache.set (/opt/nodebb/node_modules/lru-cache/index.js:157:13)
        at Object.cache.set (/opt/nodebb/src/cache/lru.js:68:12)
        at /opt/nodebb/src/database/mongo/hash.js:138:10
        at Array.forEach (<anonymous>)
        at module.getObjectsFields (/opt/nodebb/src/database/mongo/hash.js:136:16)
        at processTicksAndRejections (internal/process/task_queues.js:95:5)
        at async module.getObjects (/opt/nodebb/src/database/mongo/hash.js:92:10)
        at async module.getObject (/opt/nodebb/src/database/mongo/hash.js:87:16)
        at async Configs.getFields (/opt/nodebb/src/meta/configs.js:111:12)
        at async Configs.list (/opt/nodebb/src/meta/configs.js:98:9)
    (node:18808) UnhandledPromiseRejectionWarning: TypeError: maxAge must be a number
        at LRUCache.set (/opt/nodebb/node_modules/lru-cache/index.js:157:13)
        at Object.cache.set (/opt/nodebb/src/cache/lru.js:68:12)
        at /opt/nodebb/src/database/mongo/hash.js:138:10
        at Array.forEach (<anonymous>)
        at module.getObjectsFields (/opt/nodebb/src/database/mongo/hash.js:136:16)
        at processTicksAndRejections (internal/process/task_queues.js:95:5)
        at async module.getObjects (/opt/nodebb/src/database/mongo/hash.js:92:10)
        at async module.getObject (/opt/nodebb/src/database/mongo/hash.js:87:16)
        at async Configs.getFields (/opt/nodebb/src/meta/configs.js:111:12)
        at async Configs.list (/opt/nodebb/src/meta/configs.js:98:9)
    (Use `node --trace-warnings ...` to show where the warning was created)
    (node:18808) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
    (node:18808) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
    
    
    tail -f output.log
    Error: EACCES: permission denied, rmdir '/opt/nodebb/build/public/plugins/nodebb-plugin-emoji'
    2022-09-19T15:56:32.905Z [4567/18935] - error: admin.reload
    Error: EACCES: permission denied, rmdir '/opt/nodebb/build/public/plugins/nodebb-plugin-emoji'
    2022-09-19T15:56:32.906Z [4567/18935] - error: [build]          requirejs modules  build failed
    2022-09-19T15:56:32.940Z [4567/18935] - error: [build]                  templates  build failed
    2022-09-19T15:56:32.942Z [4567/18935] - error: [build]                  languages  build failed
    2022-09-19T15:56:39.483Z [4567/18935] - info: [build]           client js bundle  build completed in 6.677sec
    2022-09-19T15:56:39.483Z [4567/18935] - info: [build]            admin js bundle  build completed in 6.676sec
    2022-09-19T15:56:39.488Z [4567/18935] - info: [build]         client side styles  build completed in 6.681sec
    2022-09-19T15:56:40.287Z [4567/18935] - info: [build] admin control panel styles  build completed in 7.478sec
    
    
  • NodeBB Admin

    What does this print npm ls lru-cache?


  • @baris said in What? UnhandledPromiseRejectionWarning:

    npm ls lru-cache

    npm ls lru-cache

    [email protected] /opt/nodebb
    ├── [email protected]
    ├─┬ [email protected]
    │ ├─┬ @commitlint/[email protected]
    │ │ └─┬ @commitlint/[email protected]
    │ │ └─┬ [email protected]
    │ │ └─┬ [email protected]
    │ │ └─┬ [email protected]
    │ │ └─┬ [email protected]
    │ │ └── [email protected]
    │ └── [email protected]
    └─┬ [email protected]
    └── [email protected]


  • The log seems to show complaints about plugins and their versions too. Can't recall how I update plugins but I thought nodebb upgrade took care of that.


  • Now it's asking me to upgrade again, from 2.5.2 to 2.5.3.


  • @NodeHam Yeah the error during ./nodebb upgrade is expected, and I don't know how to condition around it. You have to run ./nodebb upgrade twice due to the lru-cache incompatibility.

    Just run ./nodebb upgrade again. You should see NodeBB Upgrade Complete centred in green at the bottom when the upgrade completes properly.


  • This post is deleted!

  • I did as you suggested.
    First I upgraded to the latest then I ran the upgrade a couple of times.

    These were some warnings.

    WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
    This can impact web performance.
    Assets:
      d9d9f5deccb1ee634fc7e944aa75df78.js (491 KiB)
      nodebb.min.js (354 KiB)
      admin.min.js (393 KiB)
      1083.54c1863fb2105af42e86.min.js (799 KiB)
      4793.2d2618b33142254453d5.min.js (454 KiB)
      8522.e860bab56ff4054cb14a.min.js (478 KiB)
    
    WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
    Entrypoints:
      nodebb (354 KiB)
          nodebb.min.js
      admin (393 KiB)
          admin.min.js
    
    webpack 5.74.0 compiled with 2 warnings in 43547 ms
    2022-09-19T22:13:36.525Z [4567/19606] - info: [build] Asset compilation successful. Completed in 54.785sec.
    
    

  • BTW, thank you very much for your help!


  • @NodeHam Those warnings are okay 🙂 We'll try to reduce those file sizes down further over time, but they are merely warnings.


Suggested Topics

  • 4
  • 5
  • 1
  • 1
  • 1
| | | |