rez0n / docker-nodebb

NodeBB forum software Docker image with persistent storage support. k8s tested.
https://hub.docker.com/r/nibrev/nodebb
31 stars 13 forks source link

Updating/Changing docker image in docker-compose doesn't upgrade an existing installation. #66

Closed fais3000 closed 3 years ago

fais3000 commented 4 years ago

DISTRIB_ID=Ubuntu DISTRIB_RELEASE=20.04 DISTRIB_CODENAME=focal DISTRIB_DESCRIPTION="Ubuntu 20.04.1 LTS" NAME="Ubuntu" VERSION="20.04.1 LTS (Focal Fossa)"

Existing Installation running on Nodebb Docker image NodeBB v1.15.0-rc.3 through nibrev/nodebb:beta

After changing the docker compose image to nibrev/nodebb:v1.15.0. Docker pulled the latest image but the container is stuck on old version.

Logs

benchpressjs] Unable to build or find a suitable native module, falling back to JS version.

[benchpressjs] This will result in much longer template build times.

[benchpressjs] prebuilt module failed to load: linux_72

[benchpressjs] If the above module is not available at `node_modules/benchpressjs/rust/benchpress-rs/pre-built/`,

[benchpressjs] you can manually build benchpress-rs following the instructions here:

[benchpressjs] `https://github.com/benchpressjs/benchpressjs/blob/master/README.md#manually-building-native-module`

2. Updating NodeBB data store schema...2020-11-05T12:46:32.375Z [4567/11] - warn: [cache-buster] could not read cache buster ENOENT: no such file or directory, open '/usr/src/app/build/cache-buster' {"errno":-2,"code":"ENOENT","syscall":"open","path":"/usr/src/app/build/cache-buster","stack":"Error: ENOENT: no such file or directory, open '/usr/src/app/build/cache-buster'"}

Parsing upgrade scripts... 

OK | 0 script(s) found, 99 skipped

Schema update complete!

3. Rebuilding assets...  started

2020-11-05T12:46:32.461Z [4567/11] - info: [build] Building in parallel mode

2020-11-05T12:46:32.461Z [4567/11] - info: [build]         plugin static dirs  build started

2020-11-05T12:46:32.464Z [4567/11] - info: [build]          requirejs modules  build started

2020-11-05T12:46:32.465Z [4567/11] - info: [build]           client js bundle  build started

2020-11-05T12:46:32.496Z [4567/11] - info: [build]            admin js bundle  build started

2020-11-05T12:46:32.497Z [4567/11] - info: [build]         client side styles  build started

2020-11-05T12:46:32.497Z [4567/11] - info: [build] admin control panel styles  build started

2020-11-05T12:46:32.498Z [4567/11] - info: [build]                  templates  build started

2020-11-05T12:46:32.498Z [4567/11] - info: [build]                  languages  build started

2020-11-05T12:46:33.003Z [4567/11] - info: [build]         plugin static dirs  build completed in 0.542sec

2020-11-05T12:46:38.295Z [4567/11] - info: [build]           client js bundle  build completed in 5.83sec

2020-11-05T12:46:38.296Z [4567/11] - info: [build]            admin js bundle  build completed in 5.8sec

2020-11-05T12:46:43.029Z [4567/11] - info: [build]          requirejs modules  build completed in 10.565sec

2020-11-05T12:46:50.256Z [4567/11] - info: [build]                  languages  build completed in 17.758sec

2020-11-05T12:46:51.636Z [4567/11] - info: [build]         client side styles  build completed in 19.139sec

2020-11-05T12:46:53.389Z [4567/11] - info: [build] admin control panel styles  build completed in 20.892sec

2020-11-05T12:46:55.444Z [4567/11] - info: [build]                  templates  build completed in 22.946sec

2020-11-05T12:46:55.445Z [4567/11] - info: [build] Asset compilation successful. Completed in 22.984sec.

  NodeBB Upgrade Complete!

NodeBB v1.15.0-rc.3 Copyright (C) 2013-2014 NodeBB Inc.

This program comes with ABSOLUTELY NO WARRANTY.

This is free software, and you are welcome to redistribute it under certain conditions.

For the full license, please visit: http://www.gnu.org/copyleft/gpl.html

Clustering enabled: Spinning up 1 process(es).

2020-11-05T12:46:55.999Z [4567/99] - info: Initializing NodeBB v1.15.0-rc.3 https://discussplaces.com

[benchpressjs] Unable to build or find a suitable native module, falling back to JS version.

[benchpressjs] This will result in much longer template build times.

[benchpressjs] prebuilt module failed to load: linux_72

[benchpressjs] If the above module is not available at `node_modules/benchpressjs/rust/benchpress-rs/pre-built/`,

[benchpressjs] you can manually build benchpress-rs following the instructions here:

[benchpressjs] `https://github.com/benchpressjs/benchpressjs/blob/master/README.md#manually-building-native-module`

2020-11-05T12:46:57.708Z [4567/99] - info: [socket.io] Restricting access to origin: https://discussplaces.com:*

2020-11-05T12:46:57.909Z [4567/99] - warn:    [plugins/nodebb-theme-slick] The plugin.json field "library" is deprecated. Please use the package.json field "main" instead.

2020-11-05T12:46:57.931Z [4567/99] - warn: [plugins] Unable to load library for: nodebb-plugin-soundpack-default

2020-11-05T12:46:57.931Z [4567/99] - error: Error: Cannot find module '/usr/src/app/node_modules/nodebb-plugin-soundpack-default'

Require stack:

- /usr/src/app/src/plugins/index.js

- /usr/src/app/src/meta/configs.js

- /usr/src/app/src/meta/index.js

- /usr/src/app/src/start.js

- /usr/src/app/require-main.js

- /usr/src/app/app.js

    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15)

    at Function.Module._load (internal/modules/cjs/loader.js:687:27)

    at Module.require (internal/modules/cjs/loader.js:903:19)

    at require (internal/modules/cjs/helpers.js:74:18)

    at Object.Plugins.requireLibrary (/usr/src/app/src/plugins/index.js:53:38)

    at registerHooks (/usr/src/app/src/plugins/load.js:159:13)

    at Plugins.loadPlugin (/usr/src/app/src/plugins/load.js:122:4)

    at async Plugins.reload (/usr/src/app/src/plugins/index.js:113:3)

    at async Plugins.init (/usr/src/app/src/plugins/index.js:86:2)

    at async initializeNodeBB (/usr/src/app/src/webserver.js:100:2)

2020-11-05T12:46:57.932Z [4567/99] - warn:    [plugins/nodebb-plugin-spam-be-gone] The plugin.json field "library" is deprecated. Please use the package.json field "main" instead.

2020-11-05T12:46:57.972Z [4567/99] - warn: [plugins/load] The following plugins may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing. In the event of an unresponsive NodeBB caused by this plugin, run `./nodebb reset -p PLUGINNAME` to disable it.

  * nodebb-plugin-composer-default

  * nodebb-plugin-markdown

  * nodebb-plugin-mentions

  * nodebb-widget-essentials

  * nodebb-rewards-essentials

  * nodebb-plugin-emoji

  * nodebb-plugin-emoji-android

  * nodebb-theme-slick

  * nodebb-plugin-dbsearch

  * nodebb-plugin-custom-pages

  * nodebb-plugin-soundpack-default

  * nodebb-plugin-spam-be-gone

  * nodebb-plugin-write-api

2020-11-05T12:46:58.068Z [4567/99] - info: [plugins/spam-be-gone] Settings loaded

2020-11-05T12:46:58.097Z [4567/99] - info: [api] Adding 0 route(s) to `api/v3/plugins`

2020-11-05T12:46:58.105Z [4567/99] - info: Routes added

2020-11-05T12:46:58.109Z [4567/99] - info: NodeBB Ready

2020-11-05T12:46:58.111Z [4567/99] - info: Enabling 'trust proxy'

There are bunch of other errors in the build flow, that may be a problem too. Portainer (docker monitoring/management software) shows that the image attached with the stack is actually nibrev/nodebb:v1.15.0. So my hunch is that

./nodebb upgrade

is not being called or failing.

fais3000 commented 4 years ago

@rez0n I verified. The start script is indeed not calling ./nodebb upgrade. I was able to fix it by going into container and running. ./nodebb upgrade

2020-11-05_18-00-10
rez0n commented 4 years ago

Hi, first of all, today NodeBB was released stable v1.15.0 Due to building pipeline issue, currently beta, stable and latest = v1.15.0 So, pulling beta tag today, you'll get the latest released version.

I was spin up a clear instance using nodebb:v1.15.0-rc.3 and have a benchpressjs errors too, but the forum is live.

nodebb_1  | 2020-11-05T16:45:30.180Z [4567/177] - info: Initializing NodeBB v1.15.0-rc.3 http://localhost
nodebb_1  | [benchpressjs] Unable to build or find a suitable native module, falling back to JS version.
nodebb_1  | [benchpressjs] This will result in much longer template build times.
nodebb_1  | [benchpressjs] prebuilt module failed to load: linux_72
nodebb_1  | [benchpressjs] If the above module is not available at `node_modules/benchpressjs/rust/benchpress-rs/pre-built/`,
nodebb_1  | [benchpressjs] you can manually build benchpress-rs following the instructions here:
nodebb_1  | [benchpressjs] `https://github.com/benchpressjs/benchpressjs/blob/master/README.md#manually-building-native-module`

Then I updated image tag to nodebb:v1.15.0 it was built with errors, but seems forum is upgraded and alive.

nodebb_1  | 2020-11-05T16:53:47.181Z [4567/12] - error: [build]           client js bundle  build failed
nodebb_1  | 2020-11-05T16:53:47.182Z [4567/12] - error: [build] Encountered error during build step
nodebb_1  | Error: ENOENT: no such file or directory, open '/usr/src/app/build/public/rjs-bundle-client.js'
nodebb_1  | Error occurred during upgrade: Error: ENOENT: no such file or directory, open '/usr/src/app/build/public/rjs-bundle-client.js'
nodebb_1  | 2020-11-05T16:53:47.186Z [4567/12] - error: uncaughtException: ENOENT: no such file or directory, open '/usr/src/app/build/public/rjs-bundle-client.js'
nodebb_1  | Error: ENOENT: no such file or directory, open '/usr/src/app/build/public/rjs-bundle-client.js' {"error":{"errno":-2,"code":"ENOENT","syscall":"open","path":"/usr/src/app/build/public/rjs-bundle-client.js"},"stack":"Error: ENOENT: no such file or directory, open '/usr/src/app/build/public/rjs-bundle-client.js'","exception":true,"date":"Thu Nov 05 2020 16:53:47 GMT+0000 (Coordinated Universal Time)","process":{"pid":12,"uid":0,"gid":0,"cwd":"/usr/src/app","execPath":"/usr/local/bin/node","version":"v12.19.0","argv":["/usr/local/bin/node","/usr/src/app/nodebb","upgrade","-sbi"],"memoryUsage":{"rss":143851520,"heapTotal":98816000,"heapUsed":75113752,"external":1591674,"arrayBuffers":83542}},"os":{"loadavg":[0.26,0.23,0.18],"uptime":127962},"trace":[]}
nodebb_1  | 2020-11-05T16:53:47.187Z [4567/12] - error: [build]            admin js bundle  build failed

I will work on these errors to fix soon, it was appeared by some changes in the building or releasing changes. But they do not break the forum. But yes, forum initializing as v1.15.0-rc.3 anyway, I will work on that too.

The ./nodebb upgrade -sbi is executing on each container startup.

nodebb_1  | Updating NodeBB...
rez0n commented 4 years ago

Found an issue with version upgrading. I will push changes soon.

rez0n commented 3 years ago

Hi, I fixed both issues in the @27a8b4 Thank you for the report.

fais3000 commented 3 years ago

@rez0n Updated from 1.15.0 to 1.15.1. Upgraded properly, good work!

Regarding the build error, should i create a separate issue so we can keep track of it?

rez0n commented 3 years ago

@fais3000 I'm already fixed the build error in the same commit.