Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration failed from 11.11 to 11.15 #4934

Closed
CGsama opened this issue May 16, 2019 · 2 comments
Closed

Migration failed from 11.11 to 11.15 #4934

CGsama opened this issue May 16, 2019 · 2 comments
Labels
鈿狅笍bug? This might be a bug

Comments

@CGsama
Copy link
Contributor

CGsama commented May 16, 2019

馃挕 Summary

Can't migrate, looks like #4926 but can't understood that.

馃檪 Expected Behavior

migration success

鈽癸笍 Actual Behavior

migration failed

馃摑 Steps to Reproduce

git checkout master
git pull
npm run cleanall
npm i
NODE_ENV=production npm run build
npm i ts-node
npm run migrate

馃搶 Environment

Ubuntu18.04

Logs

misskey@gothloli.club:~/misskey$ npm run migrate

> misskey@11.15.0 migrate /home/misskey/misskey
> npm run ormconfig && ts-node ./node_modules/typeorm/cli.js migration:run


> misskey@11.15.0 ormconfig /home/misskey/misskey
> node ./built/ormconfig.js

query: SELECT * FROM "information_schema"."tables" WHERE "table_schema" = curren                                                                                                                          t_schema() AND "table_name" = 'migrations'
query: CREATE TABLE "migrations" ("id" SERIAL NOT NULL, "timestamp" bigint NOT N                                                                                                                          ULL, "name" character varying NOT NULL, CONSTRAINT "PK_8c82d7f526340ab734260ea46                                                                                                                          be" PRIMARY KEY ("id"))
query: SELECT * FROM "migrations" "migrations"
0 migrations are already loaded in the database.
5 migrations were found in the source code.
5 migrations are new migrations that needs to be executed.
query: START TRANSACTION
query: CREATE TYPE "page_visibility_enum" AS ENUM('public', 'followers', 'specif                                                                                                                          ied')
query failed: CREATE TYPE "page_visibility_enum" AS ENUM('public', 'followers',                                                                                                                           'specified')
error: { error: type "page_visibility_enum" already exists
    at Connection.parseE (/home/misskey/misskey/node_modules/pg/lib/connection.j                                                                                                                          s:602:11)
    at Connection.parseMessage (/home/misskey/misskey/node_modules/pg/lib/connec                                                                                                                          tion.js:399:19)
    at Socket.<anonymous> (/home/misskey/misskey/node_modules/pg/lib/connection.                                                                                                                          js:121:22)
    at Socket.emit (events.js:193:13)
    at Socket.EventEmitter.emit (domain.js:481:20)
    at addChunk (_stream_readable.js:295:12)
    at readableAddChunk (_stream_readable.js:276:11)
    at Socket.Readable.push (_stream_readable.js:231:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:154:17)
  name: 'error',
  length: 100,
  severity: 'ERROR',
  code: '42710',
  detail: undefined,
  hint: undefined,
  position: undefined,
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'typecmds.c',
  line: '1139',
  routine: 'DefineEnum' }
query: ROLLBACK
Error during migration run:
{ QueryFailedError: type "page_visibility_enum" already exists
    at new QueryFailedError (/home/misskey/misskey/src/error/QueryFailedError.ts                                                                                                                          :9:9)
    at Query.callback (/home/misskey/misskey/src/driver/postgres/PostgresQueryRu                                                                                                                          nner.ts:176:30)
    at Query.handleError (/home/misskey/misskey/node_modules/pg/lib/query.js:142                                                                                                                          :17)
    at Connection.connectedErrorMessageHandler (/home/misskey/misskey/node_modul                                                                                                                          es/pg/lib/client.js:194:17)
    at Connection.emit (events.js:193:13)
    at Connection.EventEmitter.emit (domain.js:481:20)
    at Socket.<anonymous> (/home/misskey/misskey/node_modules/pg/lib/connection.                                                                                                                          js:126:12)
    at Socket.emit (events.js:193:13)
    at Socket.EventEmitter.emit (domain.js:481:20)
    at addChunk (_stream_readable.js:295:12)
  message: 'type "page_visibility_enum" already exists',
  name: 'QueryFailedError',
  length: 100,
  severity: 'ERROR',
  code: '42710',
  detail: undefined,
  hint: undefined,
  position: undefined,
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'typecmds.c',
  line: '1139',
  routine: 'DefineEnum',
  query:
   `CREATE TYPE "page_visibility_enum" AS ENUM('public', 'followers', 'specified                                                                                                                          ')`,
  parameters: [] }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! misskey@11.15.0 migrate: `npm run ormconfig && ts-node ./node_modules/t                                                                                                                          ypeorm/cli.js migration:run`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the misskey@11.15.0 migrate script.
npm ERR! This is probably not a problem with npm. There is likely additional log                                                                                                                          ging output above.

npm ERR! A complete log of this run can be found in:
@CGsama CGsama added the 鈿狅笍bug? This might be a bug label May 16, 2019
@acid-chicken
Copy link
Member

(Inspired by #4926)

Please delete following files then retry migrating.

  • migration/1556348509290-Pages.ts
  • migration/1556746559567-UserProfile.ts

@CGsama
Copy link
Contributor Author

CGsama commented May 16, 2019

It do works out! Thx a lot!

@CGsama CGsama closed this as completed May 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
鈿狅笍bug? This might be a bug
Projects
None yet
Development

No branches or pull requests

2 participants