hwgilbert16 / scholarsome

Web-based interactive flashcard learning software
http://scholarsome.com
GNU Affero General Public License v3.0
531 stars 30 forks source link

Error deploying after v1.2 update #126

Closed kellogcheung closed 8 months ago

kellogcheung commented 8 months ago

Tried re-pulling the latest image and compose, service would not start. Did a clean slate reinstall everything from scratches, same.

Logs reported missing bcrypt_lib module:

> scholarsome@1.2.0 serve:node
> npm run migrate && node dist/apps/api/main.js
> scholarsome@1.2.0 migrate
Prisma schema loaded from prisma/schema.prisma
> npx prisma migrate deploy
Datasource "db": MySQL database "scholarsome" at "mariadb:3306"
No pending migrations to apply.
12 migrations found in prisma/migrations
node:internal/modules/cjs/loader:1147

  throw err;
  ^
Error: Cannot find module '/usr/src/app/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node'
Require stack:
- /usr/src/app/node_modules/bcrypt/bcrypt.js
- /usr/src/app/dist/apps/api/main.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at require (node:internal/modules/helpers:176:18)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at Object.<anonymous> (/usr/src/app/node_modules/bcrypt/bcrypt.js:6:16)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Module.require (node:internal/modules/cjs/loader:1235:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/usr/src/app/node_modules/bcrypt/bcrypt.js',
    '/usr/src/app/dist/apps/api/main.js'
}
  ]
Node.js v20.11.1

Redis and MariaDB also reporting some errors

*** FATAL CONFIG FILE ERROR (Redis 7.2.4) ***
Reading the configuration file, at line 4
>>> 'appendfilename "/data/appendonly.aof"'
appendfilename can't be a path, just a filename
2024-03-14  3:54:06 30 [Warning] Aborted connection 30 to db: 'scholarsome' user: 'scholarsome' host: '172.31.0.3' (Got an error reading communication packets)

I am running on a Synology NAS using Portainer stack function to compose with the latest version of the compose.yml Was working and testing fine with version 1.10 with that version of compose.yml

hwgilbert16 commented 8 months ago

Will be fixing this later this afternoon

hwgilbert16 commented 8 months ago

@kellogcheung This issue has been resolved - re-pull the Docker image and the error should no longer occur. The "aborted connection" error is expected to happen a few times during the startup, as it takes a bit of time for the database to be ready to accept connections.