funmaker / Hybooru

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

Invalid input syntax for type integer #12

Closed NoOtakuSama closed 2 years ago

NoOtakuSama commented 2 years ago

Hey,

Got a problem with starting the production build. After creating a Postgresql db and user, editting the config.json and doing a npm start; I get the following error:

Database update detected, rebuilding...

Rebuilding Database!

Posts (24576/22950)             [####################]
D:\Hydrus Network\Hybooru\node_modules\pg-protocol\src\parser.ts:369
      name === 'notice' ? new NoticeMessage(length, messageValue) : new DatabaseError(messageValue, length, name)
                                                                    ^
error: invalid input syntax for type integer: "1129.2"
    at Parser.parseErrorMessage (D:\Hydrus Network\Hybooru\node_modules\pg-protocol\src\parser.ts:369:69)
    at Parser.handlePacket (D:\Hydrus Network\Hybooru\node_modules\pg-protocol\src\parser.ts:188:21)
    at Parser.parse (D:\Hydrus Network\Hybooru\node_modules\pg-protocol\src\parser.ts:103:30)
    at Socket.<anonymous> (D:\Hydrus Network\Hybooru\node_modules\pg-protocol\src\index.ts:7:48)
    at Socket.emit (node:events:520: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)

Tried googling for a solution, didn't find anything. But I think it's an error related to Postgresql? Maybe I did something wrong creating the db? I did the following:

CREATE DATABASE hybooru
CREATE USER hybooru WITH PASSWORD 'hybooru';
GRANT ALL PRIVILEGES ON DATABASE "hybooru" to hybooru;

Thanks!

NoOtakuSama commented 2 years ago

I fixed it. I was using the latest version of postgresql. Tried using version 13.6 and it works now. Letting you know just in case! Thanks for your great work!

funmaker commented 2 years ago

Thanks for letting me know, this might help if someone else encounters similar error. This is a strange, it implies either post's hash id, width, height, mime type or number of frames in hydru's database is a float, which definitely shouldn't be the case. But maybe it was just some weird error from the old postgresql version.