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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postresql: Start of Shiori fails with "failed to run migration from 0.2.0 to 0.3.0:" after fresh installation #996

Open
IeP4nieF opened this issue Oct 13, 2024 · 2 comments · May be fixed by #1013
Labels
type:bug Something isn't working
Milestone

Comments

@IeP4nieF
Copy link

Data

  • Shiori version: 1.7.1 (build 2315f0d)
  • 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:[email protected]/shiori?sslmode=require'

in compose.yml.

@IeP4nieF IeP4nieF added the type:bug Something isn't working label Oct 13, 2024
@github-project-automation github-project-automation bot moved this to To do in Roadmap Oct 13, 2024
@fmartingr fmartingr added this to the 1.7.2 milestone Nov 1, 2024
@fmartingr
Copy link
Member

fmartingr commented 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

@fmartingr
Copy link
Member

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;

@fmartingr fmartingr linked a pull request Nov 16, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
Status: To do
Development

Successfully merging a pull request may close this issue.

2 participants