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

Cannot log in after updated to the 1.39.1 #1583

Closed
MFYDev opened this issue Oct 25, 2022 · 11 comments
Closed

Cannot log in after updated to the 1.39.1 #1583

MFYDev opened this issue Oct 25, 2022 · 11 comments
Labels
bug Something isn't working fixed in dev Fixed in the dev branch troubleshooting Troubleshooting request

Comments

@MFYDev
Copy link

MFYDev commented Oct 25, 2022

Hello, I cannot log in anymore after the update.

I got 500 error when post the credentials to the /auth/login

I am using Nginx and did not have that issue before

@MFYDev
Copy link
Author

MFYDev commented Oct 25, 2022

Below here is my Nginx configuration:

location ^~ /
{
proxy_pass http://myhost;
proxy_set_header Host myhost;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
#PROXY-END/

@benscobie
Copy link

Me too. Here's the error in my log:
4 migrations found in prisma/migrations
✓ Database is up to date.
$ node scripts/update-tracker.js
$ node server.js
Listening on port 3000
PrismaClientKnownRequestError:
Invalid prisma.account.findUnique() invocation:
The column account.account_uuid does not exist in the current database.

@nicolasluckie
Copy link

I had similar error after updating to v1.39.1 - I was able to fix and restore all my data after executing the following commands on the postgres database:

1) CREATE EXTENSION pgcrypto;

Learned the hard way that you need to load the pgcrypto extension in the current database/schema first.

You otherwise get the following error:

[53] ERROR:  function gen_random_uuid() does not exist at character 33
[53] HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

2) Copy/Paste

If using docker-compose: docker exec -it <umami_db_container_name> psql -U umami -W umami

Enter your db password and copy/paste the following:

-- AlterTable
ALTER TABLE "account" ADD COLUMN "account_uuid" UUID NULL;

-- Backfill UUID
UPDATE "account" SET account_uuid = gen_random_uuid();

-- AlterTable
ALTER TABLE "account" ALTER COLUMN "account_uuid" SET NOT NULL;

-- CreateIndex
CREATE UNIQUE INDEX "account_account_uuid_key" ON "account"("account_uuid");

-- AlterTable
ALTER TABLE "event" ADD COLUMN "event_uuid" UUID NULL;

-- Backfill UUID
UPDATE "event" SET event_uuid = gen_random_uuid();

-- AlterTable
ALTER TABLE "event" ALTER COLUMN "event_uuid" SET NOT NULL;

-- CreateIndex
CREATE UNIQUE INDEX "event_event_uuid_key" ON "event"("event_uuid");

-- CreateIndex
CREATE INDEX "account_account_uuid_idx" ON "account"("account_uuid");

-- CreateIndex
CREATE INDEX "session_session_uuid_idx" ON "session"("session_uuid");

-- CreateIndex
CREATE INDEX "website_website_uuid_idx" ON "website"("website_uuid");

-- CreateIndex
CREATE INDEX "event_event_uuid_idx" ON "event"("event_uuid");

Hope this helps! -Nic

@benscobie
Copy link

benscobie commented Oct 25, 2022

Thanks @nicolasluckie I checked the _prisma_migrations table and saw the same error. I just ran
CREATE EXTENSION IF NOT EXISTS pgcrypto;
delete from _prisma_migrations where migration_name = '04_add_uuid';

And restarted Umami to re-apply.

I suppose creating pgcrypto should've been part of the migration.

@briancao
Copy link
Collaborator

@nicolasluckie Thank you for the quick solution!

It looks like gen_random_uuid() was added in postgres v13+ natively (https://pgpedia.info/g/gen_random_uuid-function.html) and I should have taken versions into consideration.

@mikecao mikecao added the troubleshooting Troubleshooting request label Oct 25, 2022
@mskian
Copy link

mskian commented Oct 25, 2022

tried this work for me but issue on real-time logs

server ubuntu 20.04 LTS
MYSQL - 8
umami - latest
sever - nginx

yarn check-db
yarn update-db
service mysql restart
service nginx restart

Screenshot from 2022-10-25 11-42-48

@giuliomagnifico
Copy link

2) Copy/Paste

If using docker-compose: docker exec -it <umami_db_container_name> psql -U umami -W umami

I get this error:

root@analytics:/opt/umami# docker exec -it umami_umami_1 psql -U umami -W umami OCI runtime exec failed: exec failed: unable to start container process: exec: "psql": executable file not found in $PATH: unknown

@ddeimeke
Copy link

2) Copy/Paste

If using docker-compose: docker exec -it <umami_db_container_name> psql -U umami -W umami

I get this error:

root@analytics:/opt/umami# docker exec -it umami_umami_1 psql -U umami -W umami OCI runtime exec failed: exec failed: unable to start container process: exec: "psql": executable file not found in $PATH: unknown

Maybe you do not use the DB container but the application container.

@tycrek
Copy link
Contributor

tycrek commented Oct 25, 2022

Reverting back to umami:postgresql-v1.38.0 ended up being my workaround. I tried v1.39.0 but encountered the same error as v1.39.1.

--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -2,7 +2,7 @@
 version: '3'
 services:
   umami:
-    image: ghcr.io/umami-software/umami:postgresql-latest
+    image: ghcr.io/umami-software/umami:postgresql-v1.38.0
     ports:
       - "3000:3000"
     environment:

@briancao
Copy link
Collaborator

briancao commented Oct 25, 2022

Root cause of issue appears to be centered around migration not running.

We had a lot of fixes to apply to auth and migrations in 1.39.2. Should be fixed tonight.

@briancao briancao added bug Something isn't working fixed in dev Fixed in the dev branch labels Oct 25, 2022
@mikecao
Copy link
Collaborator

mikecao commented Oct 26, 2022

Fixed in v1.39.2.

@mikecao mikecao closed this as completed Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in dev Fixed in the dev branch troubleshooting Troubleshooting request
Projects
None yet
Development

No branches or pull requests

9 participants