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

Closed
opened 2026-02-04 20:12:44 +03:00 by OVERLORD · 13 comments
Owner

Originally created by @joshuaevans9807 on GitHub (Sep 29, 2025).

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 (Sep 29, 2025). ### 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

@stonith404 commented on GitHub (Sep 30, 2025):

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 (Sep 30, 2025): 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

@joshuaevans9807 commented on GitHub (Sep 30, 2025):

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 (Sep 30, 2025): 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

@stonith404 commented on GitHub (Sep 30, 2025):

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 (Sep 30, 2025): 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 (Oct 4, 2025):

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 (Oct 4, 2025): 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 (Oct 6, 2025):

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 (Oct 6, 2025): 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

@joshuaevans9807 commented on GitHub (Oct 6, 2025):

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 (Oct 6, 2025): 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: ***@***.***>
Author
Owner

@stonith404 commented on GitHub (Oct 9, 2025):

The Postgres user you are using for Pocket ID doesn't have the permissions to create a CITEXT extension. You either have to give the permissions to the Postgres user you are using for Pocket ID or use the root user.

@stonith404 commented on GitHub (Oct 9, 2025): The Postgres user you are using for Pocket ID doesn't have the permissions to create a CITEXT extension. You either have to give the permissions to the Postgres user you are using for Pocket ID or use the root user.
Author
Owner

@joshuaevans9807 commented on GitHub (Oct 11, 2025):

Thanks for that. So i have sorted the extension piece and we are back to having it actually load. However tried to add the extra OIDC URL again and same issue. I have upgraded to 1.13.1 and same issue as well

Oct 11 09:06:16 ERR Request with errors: Error #01: invalid field app=pocket-id version=1.13.1 status=500 method=POST path=/api/oidc/clients query="" route=/api/oidc/clients ip=92.27.161.50 latency=9.917646ms referer=https://login.myhomenetworks.com/settings/admin/oidc-clients user_agent="Mozilla/5.0 (iPad; CPU OS 18_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Brave/1 Mobile/15E148 Safari/604.1" body_size=32

Oct 11 09:06:21 ERR Request with errors: Error #01: invalid field app=pocket-id version=1.13.1 status=500 method=POST path=/api/oidc/clients query="" route=/api/oidc/clients ip=92.27.161.50 latency=6.745565ms referer=https://login.myhomenetworks.com/settings/admin/oidc-clients user_agent="Mozilla/5.0 (iPad; CPU OS 18_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Brave/1 Mobile/15E148 Safari/604.1" body_size=32

@joshuaevans9807 commented on GitHub (Oct 11, 2025): Thanks for that. So i have sorted the extension piece and we are back to having it actually load. However tried to add the extra OIDC URL again and same issue. I have upgraded to 1.13.1 and same issue as well `Oct 11 09:06:16 ERR Request with errors: Error #01: invalid field app=pocket-id version=1.13.1 status=500 method=POST path=/api/oidc/clients query="" route=/api/oidc/clients ip=92.27.161.50 latency=9.917646ms referer=https://login.myhomenetworks.com/settings/admin/oidc-clients user_agent="Mozilla/5.0 (iPad; CPU OS 18_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Brave/1 Mobile/15E148 Safari/604.1" body_size=32` `Oct 11 09:06:21 ERR Request with errors: Error #01: invalid field app=pocket-id version=1.13.1 status=500 method=POST path=/api/oidc/clients query="" route=/api/oidc/clients ip=92.27.161.50 latency=6.745565ms referer=https://login.myhomenetworks.com/settings/admin/oidc-clients user_agent="Mozilla/5.0 (iPad; CPU OS 18_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Brave/1 Mobile/15E148 Safari/604.1" body_size=32 `
Author
Owner

@joshuaevans9807 commented on GitHub (Oct 11, 2025):

Interesting behavior i have just witnessed. Seems like i am also having issues with the My Apps section with the same error

@joshuaevans9807 commented on GitHub (Oct 11, 2025): Interesting behavior i have just witnessed. Seems like i am also having issues with the My Apps section with the same error
Author
Owner

@stonith404 commented on GitHub (Oct 12, 2025):

Oh ok it seems like your missing one more migration 😅. Please run the following queries:

ALTER TABLE oidc_clients ADD COLUMN launch_url TEXT;

ALTER TABLE user_authorized_oidc_clients ADD COLUMN last_used_at TIMESTAMPTZ NOT NULL DEFAULT current_timestamp;
@stonith404 commented on GitHub (Oct 12, 2025): Oh ok it seems like your missing one more migration 😅. Please run the following queries: ```sql ALTER TABLE oidc_clients ADD COLUMN launch_url TEXT; ALTER TABLE user_authorized_oidc_clients ADD COLUMN last_used_at TIMESTAMPTZ NOT NULL DEFAULT current_timestamp; ```
Author
Owner

@joshuaevans9807 commented on GitHub (Oct 12, 2025):

Gave that a go and seems like those columns are already there

@joshuaevans9807 commented on GitHub (Oct 12, 2025): Gave that a go and seems like those columns are already there
Author
Owner

@stonith404 commented on GitHub (Oct 20, 2025):

I'm not really sure what's going on with the database schema, but it seems messed up. If you don't have much data, it might be easiest to set it up again.

If you want to can also export you schema with pg_dump and share it, then I can compare which things are missing in your schema.

@stonith404 commented on GitHub (Oct 20, 2025): I'm not really sure what's going on with the database schema, but it seems messed up. If you don't have much data, it might be easiest to set it up again. If you want to can also export you schema with `pg_dump` and share it, then I can compare which things are missing in your schema.
Author
Owner

@stonith404 commented on GitHub (Nov 10, 2025):

I'm closing this because there was no activity recently. Feel free to comment if the issue still occurs.

@stonith404 commented on GitHub (Nov 10, 2025): I'm closing this because there was no activity recently. Feel free to comment if the issue still occurs.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pocket-id#490