Failed at the sogebot@11.24.0 prestart script

When updating the bot, I get the following error in the log.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sogebot@11.24.0 prestart: `node ./tools/migration.js`
npm ERR! Exit status 1


npm ERR! Failed at the sogebot@11.24.0 prestart script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-11-13T12_10_07_475Z-debug.log

That is in the migration.log

Error during migration run:

I’ve already tried that, but this time it seems to be a different error :open_mouth:

work npm ci correct bevore? and is make installed? better-sqlite3 can make problems on my side. so sudo npm ci -force can help on ubuntu. but the console log from npm ci even would be nice to see.

Oh, and I run the bot in Docke, that’s in the npm log.

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using npm@6.14.8
3 info using node@v14.15.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle sogebot@11.24.2~prestart: sogebot@11.24.2
6 verbose lifecycle sogebot@11.24.2~prestart: unsafe-perm in lifecycle true
7 verbose lifecycle sogebot@11.24.2~prestart: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/app/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
8 verbose lifecycle sogebot@11.24.2~prestart: CWD: /app
9 silly lifecycle sogebot@11.24.2~prestart: Args: [ '-c', 'node ./tools/migration.js' ]
10 silly lifecycle sogebot@11.24.2~prestart: Returned: code: 1  signal: null
11 info lifecycle sogebot@11.24.2~prestart: Failed to exec prestart script
12 verbose stack Error: sogebot@11.24.2 prestart: `node ./tools/migration.js`
12 verbose stack Exit status 1
12 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
12 verbose stack     at EventEmitter.emit (events.js:315:20)
12 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
12 verbose stack     at ChildProcess.emit (events.js:315:20)
12 verbose stack     at maybeClose (internal/child_process.js:1048:16)
12 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
13 verbose pkgid sogebot@11.24.2
14 verbose cwd /app
15 verbose Linux 4.18.0-193.28.1.el8_2.x86_64
16 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
17 verbose node v14.15.0
18 verbose npm  v6.14.8
19 error code ELIFECYCLE
20 error errno 1
21 error sogebot@11.24.2 prestart: `node ./tools/migration.js`
21 error Exit status 1
22 error Failed at the sogebot@11.24.2 prestart script.
22 error This is probably not a problem with npm. There is likely additional logging output above.
23 verbose exit [ 1, true ]

Did you change sqlite to better-sqlite3 in .env?

What does npx typeorm migration:run say?

I haven’t changed anything, the only thing I’ve done is to install the update from version 11.23.0 to 11.24.2

I am curious how 11.23.0 worked for you as we introduced breaking change in .env

  • If used sqlite3 (default option) you need to update your .env file and change connection from sqlite3 to better-sqlite3

So if I switch from splite3 to better-sqlite3 and the .env should it work?

Well, did you try? Did you try Failed at the sogebot@11.24.0 prestart script as well?

Now I’ve changed it. but it still doesn’t work.

In the container with the Sogebot I cannot execute any commands because
it crashes immediately after starting.

docker-compose logs?

These are the logs from Container

    2020-11-16T15:45:35.807060743Z
    2020-11-16T15:45:35.807101059Z > sogebot@11.24.2 prestart /app
    2020-11-16T15:45:35.807104405Z > node ./tools/migration.js
    2020-11-16T15:45:35.807106631Z
    2020-11-16T15:45:35.863174242Z ... Migration in progress, please wait (see logs/                                                                                                                                                             migration.log for progress and error) ...
    2020-11-16T15:45:36.350659524Z
    2020-11-16T15:45:36.350700782Z !!! Migration FAILED, please check your logs/migr                                                                                                                                                             ation.log for additional information !!!
    2020-11-16T15:45:36.350703858Z
    2020-11-16T15:45:36.355934050Z npm ERR! code ELIFECYCLE
    2020-11-16T15:45:36.356068174Z npm ERR! errno 1
    2020-11-16T15:45:36.358843670Z npm ERR! sogebot@11.24.2 prestart: `node ./tools/                                                                                                                                                             migration.js`
    2020-11-16T15:45:36.358933982Z npm ERR! Exit status 1
    2020-11-16T15:45:36.358951315Z npm ERR!
    2020-11-16T15:45:36.358954841Z npm ERR! Failed at the sogebot@11.24.2 prestart s                                                                                                                                                             cript.
    2020-11-16T15:45:36.358958257Z npm ERR! This is probably not a problem with npm.                                                                                                                                                              There is likely additional logging output above.
    2020-11-16T15:45:36.363029420Z
    2020-11-16T15:45:36.363095746Z npm ERR! A complete log of this run can be found                                                                                                                                                              in:
    2020-11-16T15:45:36.363104734Z npm ERR!     /root/.npm/_logs/2020-11-16T15_45_36                                                                                                                                                             _359Z-debug.log

/root/.npm/_logs/2020-11-16T15_45_36

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using npm@6.14.8
3 info using node@v14.15.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle sogebot@11.24.2~prestart: sogebot@11.24.2
6 verbose lifecycle sogebot@11.24.2~prestart: unsafe-perm in lifecycle true
7 verbose lifecycle sogebot@11.24.2~prestart: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/app/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
8 verbose lifecycle sogebot@11.24.2~prestart: CWD: /app
9 silly lifecycle sogebot@11.24.2~prestart: Args: [ '-c', 'node ./tools/migration.js' ]
10 silly lifecycle sogebot@11.24.2~prestart: Returned: code: 1  signal: null
11 info lifecycle sogebot@11.24.2~prestart: Failed to exec prestart script
12 verbose stack Error: sogebot@11.24.2 prestart: node ./tools/migration.js
12 verbose stack Exit status 1
12 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
12 verbose stack     at EventEmitter.emit (events.js:315:20)
12 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
12 verbose stack     at ChildProcess.emit (events.js:315:20)
12 verbose stack     at maybeClose (internal/child_process.js:1048:16)
12 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
13 verbose pkgid sogebot@11.24.2
14 verbose cwd /app
15 verbose Linux 4.18.0-193.28.1.el8_2.x86_64
16 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
17 verbose node v14.15.0
18 verbose npm  v6.14.8
19 error code ELIFECYCLE
20 error errno 1
21 error sogebot@11.24.2 prestart: node ./tools/migration.js
21 error Exit status 1
22 error Failed at the sogebot@11.24.2 prestart script.
22 error This is probably not a problem with npm. There is likely additional logging output above.
23 verbose exit [ 1, true ]

I hope this is what you wanted

So nothing in migration logs on 11.24.2?

/sogeBot-docker/logs/migration.log

Error during migration run:

nothing more is written there

I am not really sure why it is not working for you. Would be possibly good to try zip manually and use your db file and run npx typeorm migration:run to see why there are any errors.

If migration failed on docker then full output is sent to log file.

I don’t know how to do this.

  1. Download https://github.com/sogehige/sogeBot/releases/download/11.25.0/sogeBot-11.25.0.zip
  2. Unzip
  3. copy your db file from shared folder in your docker to unzipped folder
  4. run npm install
  5. run npx typeorm migration:run and share result
1 Like

Okay, to be able to follow your instructions, I will probably have to reinstall the bot.
Are all settings such as API key statisticians of the users etc. stored in the sogebot.db?