Migration from 1.5.0-dev7 to 1.5.0-dev11 failed
What happened?
I have a Firefish instance that was running version 1.5.0-dev7, and I attempted to upgrade it to 1.5.0-dev11. The firefish_web
docker compose service fails almost immediately on startup. See below for a log excerpt.
What did you expect to happen?
I expected the migration to succeed and firefish to start up correctly.
Version
1.5.0-dev7
Instance
What type of issue is this?
Server-side
How do you deploy Firefish on your server? (Server-side issues only)
Deployed through docker compose, using docker images build from the develop
branch. My firefish:v1.0.5-dev11
image was built from commit d69bc740ea7a487aeefa9eb37dd262b9bbe4e579
(currently the head of the develop branch) by running sudo docker build . -t firefish:v1.0.5-dev11
.
What operating system are you using? (Server-side issues only)
Ubuntu Linux 22.04
Relevant log output
firefish_web |
firefish_web | > firefish@1.0.5-dev11 migrate /firefish
firefish_web | > pnpm --filter backend run migrate
firefish_web |
firefish_web |
firefish_web | > backend@ migrate /firefish/packages/backend
firefish_web | > pnpm run migrate:typeorm && pnpm run migrate:cargo
firefish_web |
firefish_web |
firefish_web | > backend@ migrate:typeorm /firefish/packages/backend
firefish_web | > typeorm migration:run -d ormconfig.js
firefish_web |
firefish_web | Error during migration run:
firefish_web | Error: Unable to open file: "/firefish/packages/backend/ormconfig.js". Class extends value undefined is not a constructor or null
firefish_web | at CommandUtils.loadDataSource (/firefish/node_modules/.pnpm/typeorm@0.3.17_ioredis@5.3.2_pg@8.11.3_ts-node@10.9.1/node_modules/typeorm/commands/CommandUtils.js:22:19)
firefish_web | at async Object.handler (/firefish/node_modules/.pnpm/typeorm@0.3.17_ioredis@5.3.2_pg@8.11.3_ts-node@10.9.1/node_modules/typeorm/commands/MigrationRunCommand.js:41:26)
firefish_web | ELIFECYCLE Command failed with exit code 1.
firefish_web | /firefish/packages/backend:
firefish_web | ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL backend@ migrate: `pnpm run migrate:typeorm && pnpm run migrate:cargo`
firefish_web | Exit status 1
firefish_web | ELIFECYCLE Command failed with exit code 1.
firefish_web | ELIFECYCLE Command failed with exit code 1.
firefish_web exited with code 1
I took a quick look inside the image and verified that ormconfig.js
does exist, and it's not obvious to me at a glance why opening the file would fail:
$ sudo docker run -it --rm firefish:v1.0.5-dev11 /bin/bash
...
root@7f158e5d2622:/firefish# cd packages/backend/
root@7f158e5d2622:/firefish/packages/backend# ls -l
total 68
drwxrwxr-x 1 root root 4096 Sep 6 15:59 assets
drwxr-xr-x 15 root root 4096 Sep 6 15:57 built
-rw-rw-r-- 1 root root 270 Jul 6 04:46 check_connect.js
-rw-rw-r-- 1 root root 173 Jul 6 04:46 jsconfig.json
drwxrwxr-x 2 root root 16384 Aug 27 02:26 migration
drwxrwxr-x 1 root root 4096 Sep 6 15:59 native-utils
drwxr-xr-x 14 root root 4096 Sep 6 15:51 node_modules
drwxrwxr-x 2 root root 4096 Sep 6 15:48 nsfw-model
-rw-rw-r-- 1 root root 394 Jul 6 04:46 ormconfig.js
-rw-rw-r-- 1 root root 5792 Sep 6 15:46 package.json
drwxrwxr-x 15 root root 4096 Jul 30 05:31 src
drwxrwxr-x 6 root root 4096 Jul 30 05:31 test
-rw-rw-r-- 1 root root 938 Jul 6 04:46 tsconfig.json
root@7f158e5d2622:/firefish/packages/backend# cat ormconfig.js
import { DataSource } from "typeorm";
import config from "./built/config/index.js";
import { entities } from "./built/db/postgre.js";
export default new DataSource({
type: "postgres",
host: config.db.host,
port: config.db.port,
username: config.db.user,
password: config.db.pass,
database: config.db.db,
extra: config.db.extra,
entities: entities,
migrations: ["migration/*.js"],
});
Contribution Guidelines By submitting this issue, you agree to follow our Contribution Guidelines
-
I agree to follow this project's Contribution Guidelines -
I have searched the issue tracker for similar issues, and this is not a duplicate.