[GH-ISSUE #996] Postresql: Start of Shiori fails with "failed to run migration from 0.2.0 to 0.3.0:" after fresh installation #437

Closed
opened 2026-02-25 23:34:13 +03:00 by kerem · 2 comments
Owner

Originally created by @IeP4nieF on GitHub (Oct 13, 2024).
Original GitHub issue: https://github.com/go-shiori/shiori/issues/996

Originally assigned to: @fmartingr on GitHub.

Data

  • Shiori version: 1.7.1 (build 2315f0da40)
  • Database Engine: Postgresql
  • Operating system: Debian with podman-compose
  • CLI/Web interface/Web Extension: no

Describe the bug / actual behavior

After a fresh installation I'm starting Shiori for the first time and and get:

[shiori] | 2024/10/13 02:09:07 error during commit: sql: transaction has already been committed or rolled back
[shiori] | 2024/10/13 02:09:07 error during commit: sql: transaction has already been committed or rolled back
[shiori] | time="2024-10-13T02:09:07+01:00" level=fatal msg="Error running migration" error="failed to run migration from 0.2.0 to 0.3.0: failed to add has_content column to book mark table: pq: column »has_content« of relation »bookmark« exists already"

There is not data nor any relations in the database before I start Shiori.

Expected behavior

Shiori should start without errors.

To Reproduce

Use the latest docker-image with postgresql:

SHIORI_DATABASE_URL='postgres://shiori:secretpassword@postgresql.domainname/shiori?sslmode=require'

in compose.yml.

Originally created by @IeP4nieF on GitHub (Oct 13, 2024). Original GitHub issue: https://github.com/go-shiori/shiori/issues/996 Originally assigned to: @fmartingr on GitHub. ## Data - **Shiori version**: 1.7.1 (build 2315f0da403a2e5dca6841e83f0fac5f52e4a18f) - **Database Engine**: Postgresql - **Operating system**: Debian with podman-compose - **CLI/Web interface/Web Extension**: no ## Describe the bug / actual behavior After a fresh installation I'm starting Shiori for the first time and and get: ``` [shiori] | 2024/10/13 02:09:07 error during commit: sql: transaction has already been committed or rolled back [shiori] | 2024/10/13 02:09:07 error during commit: sql: transaction has already been committed or rolled back [shiori] | time="2024-10-13T02:09:07+01:00" level=fatal msg="Error running migration" error="failed to run migration from 0.2.0 to 0.3.0: failed to add has_content column to book mark table: pq: column »has_content« of relation »bookmark« exists already" ``` There is not data nor any relations in the database before I start Shiori. ## Expected behavior Shiori should start without errors. ## To Reproduce Use the latest docker-image with postgresql: SHIORI_DATABASE_URL='postgres://shiori:secretpassword@postgresql.domainname/shiori?sslmode=require' in `compose.yml`.
kerem 2026-02-25 23:34:13 +03:00
Author
Owner

@fmartingr commented on GitHub (Nov 1, 2024):

The 0.3.0 migration checks the output for the column existence by comparing the error with the string: column "has_content" of relation "bookmark" already exists, yours is sightly different because it does not use quotes. We need to add a better way to handle that.

Edit: Made (not tested) this dirty patch, leaving it here until I (or someone) can make a proper PR

migration-word-check.patch

<!-- gh-comment-id:2451546118 --> @fmartingr commented on GitHub (Nov 1, 2024): The 0.3.0 migration checks the output for the column existence by comparing the error with the string: `column "has_content" of relation "bookmark" already exists`, yours is sightly different because it does not use quotes. We need to add a better way to handle that. Edit: Made (not tested) this dirty patch, leaving it here until I (or someone) can make a proper PR [migration-word-check.patch](https://github.com/user-attachments/files/17598075/migration-word-check.patch)
Author
Owner

@fmartingr commented on GitHub (Nov 16, 2024):

Could you run this three queries in your psql server and provide the output? Your output, even if in English, is sightly differnent than mine.

SHOW lc_ctype;
SHOW lc_collate;
SHOW server_encoding;
<!-- gh-comment-id:2480524765 --> @fmartingr commented on GitHub (Nov 16, 2024): Could you run this three queries in your psql server and provide the output? Your output, even if in English, is sightly differnent than mine. ``` SHOW lc_ctype; SHOW lc_collate; SHOW server_encoding; ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shiori#437
No description provided.