mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-09 14:53:00 +03:00
🐛 Bug Report: Logo and background image is not visible after upgrading to 1.0.0 #192
Reference in New Issue
Block a user
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 @gepbird on GitHub.
Reproduction steps
UI_CONFIG_DISABLED=1environment variableExpected behavior
The logo and background image loads.
Actual Behavior
The logo and background image falls back to it's alt text:
Version and Environment
I started noticing this from version 1.0.0, our database was created ~3 months ago.
Note that the data dump which is attached is heavily stripped to protect privacy and hopefully make debugging simpler (if needed I may share more data via email), the only relevant information in that is some empty logo and background image fields:
I assume these should've been deleted from the database with a previous migration, but wasn't. There's also a chance of me making a mistake and starting an older version after the database was upgraded to a newer version, but whenever I noticed errors from this, I immediately rolled back.
(When starting Pocket ID 1.0.0 with the attached data dumps, uploads/application-images with the logo, background and other images are automatically created.)
Log Output
@EweSparky commented on GitHub:
I have the same issue with v1.1.0 using Docker. I haven't modified the database or used custom images. I can see the files exist:
@gepbird commented on GitHub:
I just found our oldest backup from 2025-02-28, it also has empty values (and some more columns).
In that time there was no NixOS module or package for Pocket ID, so we used it with docker.
I'm not sure how to figure out which version of Pocket ID we were using, this was schema_migrations version:
20250210152631We didn't modify the database manually.
Yes, we uploaded OIDC client images and a profile picture (this is from the oldest backup)
Yes that works well, I mainly want to find out why this has happened and make sure it won't affect others. (As a maintainer of the NixOS module and package for Pocket ID I feel like we should understand issues like this, but at this point I'm starting to doubt other people will ever run into this)
Edit: note that on 0.53.0 images work well website even though the background and logo image types have empty values.
Edit 2: our 3rd oldest backup (2025-04-27) is a month younger than our 2nd oldest (2025-03-31)
In that time there was probably multiple Pocket ID version bumps. Looks like some migration was applied that deleted the default value and other columns (or maybe we started from a new database which did not create those columns at all?), it looks like this, similarly to what's in today's database:
If this was a migration, maybe it should've set the value to the default value before deleting default value?
From the 2nd oldest backup we replaced the Docker container with a Nix package (that builds the frontend and backend from source) and NixOS module (that mainly starts a systemd service for the frontend and backend).
@stonith404 commented on GitHub:
The reason why it has worked before
v1.0.0is probably because Pocket ID has ignoredbackgroundImageType,logoLightImageTypeandlogoDarkImageTypeifUI_CONFIG_DISABLEDwas set totrue. This was a bug and fixed inbf710aec56.We never had an SQL migration that changes values in the
app_config_variablestable because of that I don't think that is was a migration. In the past we handled the configuration variables differently in the code though. My guess is that we had a bug in our code in a previous version and this bug set the 3 config variables to an empty string. Since you setUI_CONFIG_DISABLEDtotrueyou've never noticed that the values were empty because the values were ignored beforev1.0.0.@EweSparky @gepbird can you confirm that the issue is fixed if you remove
backgroundImageType,logoLightImageTypeandlogoDarkImageTypefrom theapp_config_variablestable? Alternatively the issue should also be fixed if you upload the images again in the UI.@gepbird commented on GitHub:
I'm probably misunderstanding, but this implies that not setting
UI_CONFIG_DISABLED=1(or settingUI_CONFIG_DISABLED=0) should make me notice that the values are empty, therefore make image loading fail. However without disabling the UI config, images work well and this bug is not reproducible.Yes, that works on my minimal repro and on our production server. This is Pocket ID 1.1.0 with our ~3 months old data after removing those 3 fields:
@stonith404 commented on GitHub:
Thanks for your detailed bug report, this really helps to debug things faster.
I have no clue how these three values in the database can be empty. Are you sure that you didn't somehow manipulate the database manually? Is there a possibility that the NixOS package tampers with the database?
Additionally, did you upload custom images in the past?
As a workaround you can just delete
backgroundImageType,logoLightImageTypeandlogoDarkImageTypefrom the database.@stonith404 commented on GitHub:
@gepbird I've identified and resolved the issue. Your hint about it working without
UI_CONFIG_DISABLED=truereally helped.The problem was that the configuration loading logic was inconsistent between database and environment variable sources:
I've added a migration in
decf8ec70bthat removes all configuration variables with empty values from the database. This will be included in the next release.Thanks for the detailed reproduction steps, they made debugging much easier.
@EweSparky commented on GitHub:
@stonith404 changing
UI_CONFIG_DISABLEDfromtruetofalseand restarting the container allowed the images to load. Changing it back totruecaused them to break.@stonith404 commented on GitHub:
This should be fixed in
v1.2.0. Let me know if the issue still occurs.