funmaker / Hybooru

Hydrus-based booru-styled imageboard in React
https://booru.funmaker.moe/
MIT License
95 stars 15 forks source link

Crashes at Normalizing tags when rebuilding/initialize database #23

Closed beam7894123 closed 1 year ago

beam7894123 commented 1 year ago

As https://github.com/funmaker/Hybooru/issues/17 This time after I turn resolveRelations to true it didn't halt now but crashes.

Posts (28225/28225)             [####################] Done in 911ms
Urls (80856/80856)              [####################] Done in 1.66s
Tags (31234/31234)              [####################] Done in 428ms
Mappings (506011/506011)        [####################] Done in 2.35s
Mappings (137490/137490)        [####################] Done in 2.94s
Tag parents (1901/1901)         [####################] Done in 50ms
Tag siblings (513/513)          [####################] Done in 21ms
Importing options...            [####################] Done in 118ms
Resolving file relations...     [####################] Done in 632ms
Normalizing tags (1/6)          [###-----------------] error: duplicate key value violates unique constraint "tag_siblings_pkey"
    at Parser.parseErrorMessage (C:\hybooru\hybooru 1.7.0 (fail)\node_modules\pg-protocol\src\parser.ts:369:69)
    at Parser.handlePacket (C:\hybooru\hybooru 1.7.0 (fail)\node_modules\pg-protocol\src\parser.ts:188:21)
    at Parser.parse (C:\hybooru\hybooru 1.7.0 (fail)\node_modules\pg-protocol\src\parser.ts:103:30)    at Socket.<anonymous> (C:\hybooru\hybooru 1.7.0 (fail)\node_modules\pg-protocol\src\index.ts:7:48)
    at Socket.emit (node:events:527:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at Socket.Readable.push (node:internal/streams/readable:228:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
  length: 223,
  severity: 'ERROR',
  code: '23505',
  detail: 'Key (tagid, betterid)=(23786, 267) already exists.',
  hint: undefined,
  position: undefined,
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: 'public',
  table: 'tag_siblings',
  column: undefined,
  dataType: undefined,
  constraint: 'tag_siblings_pkey',
  file: 'nbtinsert.c',
  line: '670',
  routine: '_bt_check_unique'
}
funmaker commented 1 year ago

Should be fixed in v1.7.1. Reopen if the issue persists.