🐛 Bug Report: Unable to add an additional or edit an existing Callback URL #7

Open
opened 2025-10-06 23:58:04 +03:00 by OVERLORD · 6 comments
Owner

Originally created by @joshuaevans9807 on GitHub.

Reproduction steps

  1. Login to PocketID
  2. Go to OIDC Clients
  3. Edit any existing app
  4. Under callback urls, click the Add another
  5. Type in a valid URL
  6. Click Save
  7. You will get a error saying Something went wrong

In the container logs, its saying:
Sep 29 10:32:59 ERR Request with errors: Error #01: invalid field app=pocket-id version=1.11.2 status=500 method=PUT path=/api/oidc/clients/d9a4f019-471d-470c-8d97-f924517335f9 query="" route=/api/oidc/clients/:id ip=176.186.142.77 latency=10.613509ms referer=https://<PocketID URL>/settings/admin/oidc-clients/<OIDC Client App ID> user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36" body_size=32

Expected behavior

I should be able to add multiple callback urls without errors

Actual Behavior

I get a error saying Something went wrong

In the container logs, its saying:
Sep 29 10:32:59 ERR Request with errors: Error #01: invalid field app=pocket-id version=1.11.2 status=500 method=PUT path=/api/oidc/clients/d9a4f019-471d-470c-8d97-f924517335f9 query="" route=/api/oidc/clients/:id ip=176.186.142.77 latency=10.613509ms referer=https://<PocketID URL>/settings/admin/oidc-clients/<OIDC Client App ID> user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36" body_size=32

Pocket ID Version

1.11.2

Database

PostgreSQL 17.4

OS and Environment

PocketID Host: Docker 28.04.0 installed on a Ubuntu Server 24.04.3 virtual machine.
Client: Windows 11 24H2

Log Output

Sep 29 10:32:59 ERR Request with errors: Error #01: invalid field app=pocket-id version=1.11.2 status=500 method=PUT path=/api/oidc/clients/d9a4f019-471d-470c-8d97-f924517335f9 query="" route=/api/oidc/clients/:id ip=176.186.142.77 latency=10.613509ms referer=https://<PocketID URL>/settings/admin/oidc-clients/<OIDC Client App ID> user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36" body_size=32

Originally created by @joshuaevans9807 on GitHub. ### Reproduction steps 1. Login to PocketID 2. Go to OIDC Clients 3. Edit any existing app 4. Under callback urls, click the Add another 5. Type in a valid URL 6. Click Save 7. You will get a error saying Something went wrong In the container logs, its saying: `Sep 29 10:32:59 ERR Request with errors: Error #01: invalid field app=pocket-id version=1.11.2 status=500 method=PUT path=/api/oidc/clients/d9a4f019-471d-470c-8d97-f924517335f9 query="" route=/api/oidc/clients/:id ip=176.186.142.77 latency=10.613509ms referer=https://<PocketID URL>/settings/admin/oidc-clients/<OIDC Client App ID> user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36" body_size=32` ### Expected behavior I should be able to add multiple callback urls without errors ### Actual Behavior I get a error saying Something went wrong In the container logs, its saying: `Sep 29 10:32:59 ERR Request with errors: Error #01: invalid field app=pocket-id version=1.11.2 status=500 method=PUT path=/api/oidc/clients/d9a4f019-471d-470c-8d97-f924517335f9 query="" route=/api/oidc/clients/:id ip=176.186.142.77 latency=10.613509ms referer=https://<PocketID URL>/settings/admin/oidc-clients/<OIDC Client App ID> user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36" body_size=32` ### Pocket ID Version 1.11.2 ### Database PostgreSQL 17.4 ### OS and Environment PocketID Host: Docker 28.04.0 installed on a Ubuntu Server 24.04.3 virtual machine. Client: Windows 11 24H2 ### Log Output `Sep 29 10:32:59 ERR Request with errors: Error #01: invalid field app=pocket-id version=1.11.2 status=500 method=PUT path=/api/oidc/clients/d9a4f019-471d-470c-8d97-f924517335f9 query="" route=/api/oidc/clients/:id ip=176.186.142.77 latency=10.613509ms referer=https://<PocketID URL>/settings/admin/oidc-clients/<OIDC Client App ID> user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36" body_size=32`
Author
Owner

@joshuaevans9807 commented on GitHub:

Managed to do this today. I ran the above and now getting this
Oct 4 08:59:39 ERR Failed to run pocket-id app=pocket-id version=1.11.2 error="failed to initialize database: failed to run migrations: failed to apply embedded migrations: migration failed in line 0: ALTER TABLE public.audit_logs\n DROP CONSTRAINT IF EXISTS audit_logs_user_id_fkey,\n ADD CONSTRAINT audit_logs_user_id_fkey\n FOREIGN KEY (user_id) REFERENCES public.users (id) ON DELETE CASCADE;\n\nALTER TABLE public.oidc_authorization_codes\n ADD CONSTRAINT oidc_authorization_codes_client_fk\n FOREIGN KEY (client_id) REFERENCES public.oidc_clients (id) ON DELETE CASCADE; (details: ERROR: constraint \"oidc_authorization_codes_client_fk\" for relation \"oidc_authorization_codes\" already exists (SQLSTATE 42710))" Oct 4 08:59:40 INF Pocket ID is starting app=pocket-id version=1.11.2 Oct 4 08:59:40 INF Connected to database app=pocket-id version=1.11.2 provider=postgres Oct 4 08:59:40 ERR Failed to run pocket-id app=pocket-id version=1.11.2 error="failed to initialize database: failed to run migrations: failed to apply embedded migrations: Dirty database version 20250822000000. Fix and force version."

@joshuaevans9807 commented on GitHub: Managed to do this today. I ran the above and now getting this `Oct 4 08:59:39 ERR Failed to run pocket-id app=pocket-id version=1.11.2 error="failed to initialize database: failed to run migrations: failed to apply embedded migrations: migration failed in line 0: ALTER TABLE public.audit_logs\n DROP CONSTRAINT IF EXISTS audit_logs_user_id_fkey,\n ADD CONSTRAINT audit_logs_user_id_fkey\n FOREIGN KEY (user_id) REFERENCES public.users (id) ON DELETE CASCADE;\n\nALTER TABLE public.oidc_authorization_codes\n ADD CONSTRAINT oidc_authorization_codes_client_fk\n FOREIGN KEY (client_id) REFERENCES public.oidc_clients (id) ON DELETE CASCADE; (details: ERROR: constraint \"oidc_authorization_codes_client_fk\" for relation \"oidc_authorization_codes\" already exists (SQLSTATE 42710))" Oct 4 08:59:40 INF Pocket ID is starting app=pocket-id version=1.11.2 Oct 4 08:59:40 INF Connected to database app=pocket-id version=1.11.2 provider=postgres Oct 4 08:59:40 ERR Failed to run pocket-id app=pocket-id version=1.11.2 error="failed to initialize database: failed to run migrations: failed to apply embedded migrations: Dirty database version 20250822000000. Fix and force version."`
Author
Owner

@stonith404 commented on GitHub:

It seems that this migration has already been applied. Please run the following command and then restart Pocket ID:

UPDATE schema_migrations SET dirty = false;

If it fails again after restarting with the same error, just repeat the steps: Run the above command and restart Pocket ID.

@stonith404 commented on GitHub: It seems that this migration has already been applied. Please run the following command and then restart Pocket ID: ``` UPDATE schema_migrations SET dirty = false; ``` If it fails again after restarting with the same error, just repeat the steps: Run the above command and restart Pocket ID.
Author
Owner

@stonith404 commented on GitHub:

Have you ever executed a database command manually, to resolve a migration issue for example? Because it seems like your database schema isn't correct.

@stonith404 commented on GitHub: Have you ever executed a database command manually, to resolve a migration issue for example? Because it seems like your database schema isn't correct.
Author
Owner

@stonith404 commented on GitHub:

You can try the following commands, but please make a backup first in case something goes wrong.

  1. Stop Pocket ID
  2. Run these commands
ALTER TABLE oidc_clients DROP COLUMN IF EXISTS requires_reauthentication;
DROP INDEX IF EXISTS idx_reauthentication_tokens_token;
DROP TABLE IF EXISTS reauthentication_tokens;

UPDATE schema_migrations SET version = 20250810144214, dirty = false;
  1. Start Pocket ID
@stonith404 commented on GitHub: You can try the following commands, but please make a backup first in case something goes wrong. 1. Stop Pocket ID 2. Run these commands ```sql ALTER TABLE oidc_clients DROP COLUMN IF EXISTS requires_reauthentication; DROP INDEX IF EXISTS idx_reauthentication_tokens_token; DROP TABLE IF EXISTS reauthentication_tokens; UPDATE schema_migrations SET version = 20250810144214, dirty = false; ``` 3. Start Pocket ID
Author
Owner

@joshuaevans9807 commented on GitHub:

I think i did when there was issues with 1.11.0 and recently when upgrading to the latest as it said i had a dirty database migration

Is there a way to fix the database schema or will I have to re-set it back up?

@joshuaevans9807 commented on GitHub: I think i did when there was issues with 1.11.0 and recently when upgrading to the latest as it said i had a dirty database migration Is there a way to fix the database schema or will I have to re-set it back up?
Author
Owner

@joshuaevans9807 commented on GitHub:

Okay it seems like we are getting somewhere.

Now getting "permission denied to create extension citext"

Many Thanks
Joshua Evans

On Monday, 6 October 2025 at 07:31, Elias Schneider @.***> wrote:

stonith404 left a comment (pocket-id/pocket-id#990)

It seems that this migration has already been applied. Please run the following command and then restart Pocket ID:

UPDATE schema_migrations SET dirty = false;

If it fails again after restarting with the same error, just repeat the steps: Run the above command and restart Pocket ID.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: @.***>

@joshuaevans9807 commented on GitHub: Okay it seems like we are getting somewhere. Now getting "permission denied to create extension citext" Many Thanks Joshua Evans On Monday, 6 October 2025 at 07:31, Elias Schneider ***@***.***> wrote: > stonith404 left a comment [(pocket-id/pocket-id#990)](https://github.com/pocket-id/pocket-id/issues/990#issuecomment-3370094799) > > It seems that this migration has already been applied. Please run the following command and then restart Pocket ID: > > UPDATE schema_migrations SET dirty = false; > > If it fails again after restarting with the same error, just repeat the steps: Run the above command and restart Pocket ID. > > — > Reply to this email directly, [view it on GitHub](https://github.com/pocket-id/pocket-id/issues/990#issuecomment-3370094799), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AI2J42XBTP7X6RW74RSTSSD3WIEEHAVCNFSM6AAAAACHYZUX2OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTGNZQGA4TINZZHE). > You are receiving this because you authored the thread.Message ID: ***@***.***>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pocket-id#7