mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[GH-ISSUE #4157] [bug]: Database not updated with Version 2024.6.0 (Hoppscotch not usable) #1495
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#1495
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pthoelken on GitHub (Jul 1, 2024).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4157
Is there an existing issue for this?
Current behavior
After upgrade to HS 2024.6.0 I'm not able to login. In the log appears these kind of errors. I'm coming from version 2024.3.4 to the latest.
Steps to reproduce
update to latest Version
Environment
Release
Version
Self-hosted
@balub commented on GitHub (Jul 1, 2024):
Hey @pthoelken, can you run the migration and try again ?
@pthoelken commented on GitHub (Jul 1, 2024):
@balub you mean these instructions here? https://docs.hoppscotch.io/documentation/self-host/community-edition/install-and-build#migrations
I'll test it tomorrow morning and come back here.
@Brainpitcher commented on GitHub (Jul 1, 2024):
i made it already and i got this
`/usr/src/app/packages/hoppscotch-backend # pnpx prisma migrate deploy
Packages: +6
++++++
Progress: resolved 6, reused 0, downloaded 6, added 6, done
.cache/pnpm/dlx/32qs76zfpdzhrg4l3y6ui3zucu/1906d351bf9-7a/node_modules/.pnpm/@prisma+engines@5.16.1/node_modules/@prisma/engines: Running postinstall script, done in 4.2s
.cache/pnpm/dlx/32qs76zfpdzhrg4l3y6ui3zucu/1906d351bf9-7a/node_modules/.pnpm/prisma@5.16.1/node_modules/prisma: Running preinstall script, done in 75ms
Prisma schema loaded from prisma/schema.prisma
Datasource "db": PostgreSQL database "hoppscotch", schema "public" at "c-hqnulgjid1l6.rw.mdb.cloud.net:6432"
8 migrations found in prisma/migrations
Applying migration
20240226053141_full_text_search_additionsError: P3018
A migration failed to apply. New migrations cannot be applied before the error is recovered from. Read more about how to resolve migration issues in a production database: https://pris.ly/d/migrate-resolve
Migration name: 20240226053141_full_text_search_additions
Database error code: 42501
Database error:
ERROR: permission denied to create extension "pg_trgm"
HINT: Must be superuser to create this extension.
DbError { severity: "ERROR", parsed_severity: Some(Error), code: SqlState(E42501), message: "permission denied to create extension "pg_trgm"", detail: None, hint: Some("Must be superuser to create this extension."), position: None, where_: None, schema: None, table: None, column: None, datatype: None, constraint: None, file: Some("extension.c"), line: Some(916), routine: Some("execute_extension_script") }`
@Brainpitcher commented on GitHub (Jul 1, 2024):
in addition
I encountered an issue while deploying the migration 20240226053141_full_text_search_additions. The migration fails with the following error:
This error indicates that the migration attempts to create the pg_trgm extension, which requires superuser privileges. However, not all database users have these privileges, and this led to the migration failure.
Suggestions for Improvement
Communication: Please inform all team members about the requirement to enable certain extensions like pg_trgm before running the migration. This can be communicated through the migration documentation or comments within the migration file.
Pre-migration Steps: Consider adding pre-migration steps or a separate script to ensure necessary extensions are enabled. This script can be run by a superuser before the main migration is applied.
Alternative Approaches: If feasible, modify the migration to avoid requiring superuser privileges, such as using database functions that do not depend on the pg_trgm extension.
now everything works fine
@pthoelken commented on GitHub (Jul 2, 2024):
@balub can you confirm the latest issues in this thread? It's possible for you to give exact informations and steps what to do after the new images are pulled?
@balub commented on GitHub (Jul 2, 2024):
@pthoelken, the issue is that the user needs the superuser privileges to create the extension. If possible you can try creating a new user with the superuser privileges or upgrade an already existing one to a superuser using
ALTER ROLE <user_name> SUPERUSER;command and then try running the migration again.@Brainpitcher commented on GitHub (Jul 2, 2024):
i think it would be nice if you just add the need of a "pg_trgm" extension as the necessity
@pthoelken commented on GitHub (Jul 3, 2024):
https://docs.hoppscotch.io/documentation/self-host/community-edition/install-and-build#migrations
works pretty charm. Thanks for your assistance in this case.