photonixapp/photonix

Photonix on Unraid - Blank login screen after initial setup.

KptnKMan opened this issue · 8 comments

Describe the bug
Please, I'm trying to seek some help.
Not sure if this is a "bug" but I've been able to reproduce it reliably.

I have got Photonix "running" in a docker container on Unraid 6.9.2, but after setup when I got back to the login page it flashes up for a second then disappears.

I've reinstalled multiple times, cleared postgres and redis, reinstalled all dependencies.

I can login initially and setup Photonix, then next login the login screen flashes up for a second then disappears again. This happens from then on each time the login is accessed.
The logs don't seem to show any errors, shows postgres connected.
I've tried accessing from different browsers, InPrivate mode, different client workstations, same login prompt flashes up for a second then is gone.

Its quite irritating and I cannot find what is the matter.

Can anyone help?

To Reproduce
Using Unraid 6.9.2 stable
Containers used (All available in Unraid "Community Applications"):

  1. "rw-photonix" by cedev
  2. "postgres11" by jj9987
  3. "Redis" by jj9987

Steps to reproduce the behavior:

  1. Setup all containers (postgres11, Redis then rw-photonix)
  2. Access Web GUI of rw-photonix
  3. Setup Photonix with initial user and settings
  4. Logout and/or restart rw-photonix container
  5. Access Web GUI exactly as in Step 2
  6. Login page appears then disappears (Refreshing page same behaviour)

Expected behavior
Expected Behaviour is for after initial setup, that the Web GUI page is accessible, and able to login for normal use.

Screenshots
Can add screenshots, but not sure if "blank page" is useful.
Can add a video screencap of this if required.

Server (please complete the following information):

  • Device: AMD Ryzen 5950x, 64GB ECC RAM, x570 Motherboard.
  • OS: Unraid 6.9.2 Stable
  • Architecture: AMD64

Desktop (please complete the following information):

  • OS: Windows 10
  • Browsers tried: Chrome, Edge, Firefox.
  • Version Chrome 97.0.4692.71, other browsers latest.

Smartphone (please complete the following information):

  • Device: Samsung Galaxy S10
  • OS: Android 12
  • Browser Chrome
  • Version Chrome 96.0.4664.104

Additional context
Here are the docker logs for the "rw-photonix" container:

UNRAID1.local.lan [192.168.178.11] 5432 (postgresql) open
Postgres is up
Running migrations
Operations to perform:
Apply all migrations: accounts
Running migrations:
No migrations to apply.
Your models in app(s): 'photos' have changes that are not yet reflected in a migration, and so won't be applied.
Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.
Operations to perform:
Apply all migrations: accounts, admin, auth, contenttypes, photos, refresh_token, sessions
Running migrations:
No migrations to apply.
Your models in app(s): 'photos' have changes that are not yet reflected in a migration, and so won't be applied.
Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.
Attempting to create admin user as ADMIN_PASSWORD as environment variable is set
User "admin" adready exists so not making changes
Resetting Redis lock
Rescheduling any required upgrade-related tasks
Starting supervisor
2022-01-20 17:43:15,818 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message.
2022-01-20 17:43:15,824 INFO RPC interface 'supervisor' initialized
2022-01-20 17:43:15,824 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2022-01-20 17:43:15,824 INFO supervisord started with pid 54
2022-01-20 17:43:16,826 INFO spawned: 'cron' with pid 57
2022-01-20 17:43:16,827 INFO spawned: 'rescan_photos_periodically' with pid 58
2022-01-20 17:43:16,828 INFO spawned: 'classification_style_processor' with pid 59
2022-01-20 17:43:16,829 INFO spawned: 'raw_processor' with pid 60
2022-01-20 17:43:16,830 INFO spawned: 'storybook' with pid 61
2022-01-20 17:43:16,831 INFO spawned: 'classification_event_processor' with pid 62
2022-01-20 17:43:16,831 INFO spawned: 'webpack' with pid 63
2022-01-20 17:43:16,832 INFO spawned: 'nginx' with pid 64
2022-01-20 17:43:16,833 INFO spawned: 'classification_face_detection_processor' with pid 70
2022-01-20 17:43:16,834 INFO spawned: 'classification_color_processor' with pid 72
2022-01-20 17:43:16,835 INFO spawned: 'classification_object_processor' with pid 73
2022-01-20 17:43:16,836 INFO spawned: 'classification_scheduler' with pid 76
2022-01-20 17:43:16,836 INFO spawned: 'thumbnail_scheduler' with pid 78
2022-01-20 17:43:16,837 INFO spawned: 'watch_photos' with pid 79
2022-01-20 17:43:16,838 INFO spawned: 'raw_scheduler' with pid 81
2022-01-20 17:43:16,839 INFO spawned: 'classification_location_processor' with pid 83
2022-01-20 17:43:16,840 INFO spawned: 'app_server' with pid 85
2022-01-20 17:43:16,840 INFO exited: storybook (exit status 0; expected)
2022-01-20 17:43:16,840 INFO exited: webpack (exit status 0; expected)
Starting Nginx in prd mode
2022/01/20 17:43:16 [notice] 74#74: using the "epoll" event method
2022/01/20 17:43:16 [notice] 74#74: nginx/1.14.2
2022/01/20 17:43:16 [notice] 74#74: OS: Linux 5.10.28-Unraid
2022/01/20 17:43:16 [notice] 74#74: getrlimit(RLIMIT_NOFILE): 40960:40960
2022/01/20 17:43:16 [notice] 74#74: start worker processes
2022/01/20 17:43:16 [notice] 74#74: start worker process 86
2022/01/20 17:43:16 [notice] 74#74: start worker process 87
2022/01/20 17:43:16 [notice] 74#74: start worker process 88
2022/01/20 17:43:16 [notice] 74#74: start worker process 89
2022/01/20 17:43:16 [notice] 74#74: start worker process 90
2022/01/20 17:43:16 [notice] 74#74: start worker process 91
2022/01/20 17:43:16 [notice] 74#74: start worker process 92
2022/01/20 17:43:16 [notice] 74#74: start worker process 93
Starting Gunicorn server as in prd mode
[2022-01-20 17:43:17 +0100] [96] [INFO] Starting gunicorn 20.0.4
[2022-01-20 17:43:17 +0100] [96] [INFO] Listening at: http://0.0.0.0:8000 (96)
[2022-01-20 17:43:17 +0100] [96] [INFO] Using worker: sync
[2022-01-20 17:43:17 +0100] [100] [INFO] Booting worker with pid: 100
[2022-01-20 17:43:17 +0100] [101] [INFO] Booting worker with pid: 101
[2022-01-20 17:43:17 +0100] [109] [INFO] Booting worker with pid: 109
[2022-01-20 17:43:17 +0100] [110] [INFO] Booting worker with pid: 110
[2022-01-20 17:43:17 +0100] [111] [INFO] Booting worker with pid: 111
[2022-01-20 17:43:17 +0100] [112] [INFO] Booting worker with pid: 112
[2022-01-20 17:43:17 +0100] [113] [INFO] Booting worker with pid: 113
[2022-01-20 17:43:17 +0100] [114] [INFO] Booting worker with pid: 114
�[32m2022-01-20 16:43:18,217 INFO Watching new path: /data/photos�[0m
2022-01-20 17:43:18,218 INFO success: cron entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2022-01-20 17:43:18,218 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2022-01-20 17:43:22,222 INFO success: app_server entered RUNNING state, process has stayed up for > than 5 seconds (startsecs)
�[32m2022-01-20 16:43:23,193 INFO Starting 8 raw processor workers�[0m
�[32m2022-01-20 16:43:23,193 INFO Starting 8 raw processor workers�[0m
�[32m2022-01-20 16:43:24,207 INFO Starting 8 thumbnail processor workers�[0m
�[32m2022-01-20 16:43:26,198 INFO Starting 1 classify.color workers�[0m
2022-01-20 17:43:27,200 INFO success: watch_photos entered RUNNING state, process has stayed up for > than 10 seconds (startsecs)
2022-01-20 17:43:27,200 INFO success: watch_photos entered RUNNING state, process has stayed up for > than 10 seconds (startsecs)
�[32m2022-01-20 16:43:27,988 INFO Starting 1 classify.location workers�[0m
�[33m2022-01-20 16:43:31,083 WARNING Limited tf.compat.v2.summary API due to missing TensorBoard installation.�[0m

�[33m2022-01-20 16:43:31,083 WARNING Limited tf.compat.v2.summary API due to missing TensorBoard installation.�[0m

�[33m2022-01-20 16:43:31,103 WARNING Limited tf.compat.v2.summary API due to missing TensorBoard installation.�[0m

�[33m2022-01-20 16:43:31,103 WARNING Limited tf.compat.v2.summary API due to missing TensorBoard installation.�[0m

�[33m2022-01-20 16:43:31,104 WARNING Limited tf.compat.v2.summary API due to missing TensorBoard installation.�[0m

�[33m2022-01-20 16:43:31,104 WARNING Limited tf.compat.v2.summary API due to missing TensorBoard installation.�[0m

�[33m2022-01-20 16:43:31,134 WARNING Limited tf.compat.v2.summary API due to missing TensorBoard installation.�[0m

�[33m2022-01-20 16:43:31,144 WARNING Limited tf.compat.v2.summary API due to missing TensorBoard installation.�[0m

�[33m2022-01-20 16:43:31,145 WARNING Limited tf.compat.v2.summary API due to missing TensorBoard installation.�[0m

�[33m2022-01-20 16:43:31,146 WARNING Limited tf.summary API due to missing TensorBoard installation.�[0m

�[33m2022-01-20 16:43:31,146 WARNING Limited tf.summary API due to missing TensorBoard installation.�[0m

�[33m2022-01-20 16:43:31,162 WARNING Limited tf.summary API due to missing TensorBoard installation.�[0m

�[32m2022-01-20 16:43:31,217 INFO Starting 1 classify.event workers�[0m
�[32m2022-01-20 16:43:31,332 INFO Starting 1 classify.face workers�[0m
�[32m2022-01-20 16:43:31,397 INFO Starting 1 classify.style workers�[0m
�[33m2022-01-20 16:43:31,083 WARNING Limited tf.compat.v2.summary API due to missing TensorBoard installation.�[0m

�[33m2022-01-20 16:43:31,083 WARNING Limited tf.compat.v2.summary API due to missing TensorBoard installation.�[0m

�[33m2022-01-20 16:43:31,103 WARNING Limited tf.compat.v2.summary API due to missing TensorBoard installation.�[0m

�[33m2022-01-20 16:43:31,103 WARNING Limited tf.compat.v2.summary API due to missing TensorBoard installation.�[0m

�[33m2022-01-20 16:43:31,104 WARNING Limited tf.compat.v2.summary API due to missing TensorBoard installation.�[0m

�[33m2022-01-20 16:43:31,104 WARNING Limited tf.compat.v2.summary API due to missing TensorBoard installation.�[0m

�[33m2022-01-20 16:43:31,134 WARNING Limited tf.compat.v2.summary API due to missing TensorBoard installation.�[0m

�[33m2022-01-20 16:43:31,144 WARNING Limited tf.compat.v2.summary API due to missing TensorBoard installation.�[0m

�[33m2022-01-20 16:43:31,145 WARNING Limited tf.compat.v2.summary API due to missing TensorBoard installation.�[0m

�[33m2022-01-20 16:43:31,146 WARNING Limited tf.summary API due to missing TensorBoard installation.�[0m

�[33m2022-01-20 16:43:31,146 WARNING Limited tf.summary API due to missing TensorBoard installation.�[0m

�[33m2022-01-20 16:43:31,162 WARNING Limited tf.summary API due to missing TensorBoard installation.�[0m

�[32m2022-01-20 16:43:31,217 INFO Starting 1 classify.event workers�[0m
�[32m2022-01-20 16:43:31,332 INFO Starting 1 classify.face workers�[0m
�[32m2022-01-20 16:43:31,397 INFO Starting 1 classify.style workers�[0m
2022-01-20 17:43:32,398 INFO success: raw_scheduler entered RUNNING state, process has stayed up for > than 15 seconds (startsecs)
2022-01-20 17:43:33,399 INFO success: raw_processor entered RUNNING state, process has stayed up for > than 16 seconds (startsecs)
2022-01-20 17:43:33,399 INFO success: raw_processor entered RUNNING state, process has stayed up for > than 16 seconds (startsecs)
�[32m2022-01-20 16:43:33,996 INFO Starting 1 classify.object workers�[0m
2022-01-20 17:43:33,996 INFO success: thumbnail_scheduler entered RUNNING state, process has stayed up for > than 17 seconds (startsecs)
2022-01-20 17:43:34,997 INFO success: classification_scheduler entered RUNNING state, process has stayed up for > than 18 seconds (startsecs)
2022-01-20 17:43:35,999 INFO success: classification_color_processor entered RUNNING state, process has stayed up for > than 19 seconds (startsecs)
2022-01-20 17:43:37,000 INFO success: classification_location_processor entered RUNNING state, process has stayed up for > than 20 seconds (startsecs)
2022-01-20 17:43:37,000 INFO success: classification_location_processor entered RUNNING state, process has stayed up for > than 20 seconds (startsecs)
2022-01-20 17:43:38,001 INFO success: classification_face_detection_processor entered RUNNING state, process has stayed up for > than 21 seconds (startsecs)
2022-01-20 17:43:39,002 INFO success: classification_style_processor entered RUNNING state, process has stayed up for > than 22 seconds (startsecs)
2022-01-20 17:43:40,003 INFO success: classification_object_processor entered RUNNING state, process has stayed up for > than 23 seconds (startsecs)
2022-01-20 17:43:40,003 INFO success: classification_object_processor entered RUNNING state, process has stayed up for > than 23 seconds (startsecs)
2022-01-20 17:43:41,004 INFO success: classification_event_processor entered RUNNING state, process has stayed up for > than 24 seconds (startsecs)
�[32m2022-01-20 16:44:17,223 INFO Rescan complete�[0m
2022-01-20 17:44:27,235 INFO success: rescan_photos_periodically entered RUNNING state, process has stayed up for > than 70 seconds (startsecs)
2022/01/20 17:44:41 [info] 86#86: *6 client closed connection while waiting for request, client: 192.168.178.101, server: 0.0.0.0:80
2022/01/20 17:44:41 [info] 86#86: *6 client closed connection while waiting for request, client: 192.168.178.101, server: 0.0.0.0:80

I know this isn't a huge help but I had the same issue but can't remember what fixed it, I'm running 6.9.2 as well. I do remember following the instructions in the 2nd post on here: https://forums.unraid.net/topic/112590-support-cedev-photonix/ and have had it working ever since.

If there's any info I can provide I'd be happy to.

EDIT: I see you posted on that thread lol, I also saw my comment there which is what fixed it for me:

I also couldn't login (it hung), logs said it couldn't connect to postgres ... I had to set the postgres user to photonix accidentally, had to delete the postgres docker, clear it's app data, re-install and then it was fine.

I do believe I also had misunderstood what password to use in the postgres docker (like the previous post to me on that thread).

@neostim hey sorry for the delayed response, I've still been trying to get this working.

I do have a some questions, as I really want to get this working and understand what's happening.

I have both my user and database set to "photonix", is that not a good idea?
I created the "photonix" database separately after the default postgres user.
I installed adminer, logged into the postgres server and executed an SQL command like this:

CREATE DATABASE photonix;
CREATE USER photonix WITH ENCRYPTED PASSWORD 'mydbpassword';
GRANT ALL PRIVILEGES ON DATABASE photonix TO photonix;

I used these credentials to create the photonix container and have it access the database, which seems to be working correctly.
The logs above show connected to postgres, and I was able to log into photonix and set it up, but after setup I am unable to log in again. No idea why, the login prompt flashes up and is gone in a second.

Did you change the username to something else?
Did you only recreate the postgres container (and appdata) and nothing else?
When you say reinstall, you mean only postgres or photonix as well?
Are you using the same containers from Community Applications that I am?

Was there anything else you did?

So in my situation when I had the issue I just deleted and restarted with Postgres, right from the start in my docker compose I made the postgres default database "photonix" and username/password "postgres" (I know, terrible password practice).

Then in Photonix I set the postgres user and password to "postgres" and the database to "photonix" and from there everything worked for me.

Apologies if this isn't more helpful, I'm by no means an expert but was throwing it together fast to try it out, I ended up going with another comparable solution so haven't been using Photorec lately (it's great, I think the author is just buy being a dad right now :) ).

Hey, thanks for responding.
Regarding the issue, I managed to get it working after some changes.
I did a few things, and some seem to line up with your experience as well.

First, I deleted everything.
Its clear now to me that photonix stores basically everything in Postgres which is good, as it reduces the time to reinstall. On my unraid setup (using the containers listed in first post) only postgres11 stores any userdata, so I was able to wipe everything, delete all the configurations and start over. After that I saw I can just stop everything (photonix, redis & postgres) and delete postgres userdata, then start back up (postgres, redis, then photonix) and have a clean installation.

The way I got everything working was I went through the photonix official docker-compose.example.yml file and made sure I am using EXACTLY the same images, those being: postgres:11.1-alpine, redis:6.2.2 and photonixapp/photonix:latest.
After that, I edited the unraid templates and tried to get everything inline with the docker-compose.example.yml file.
I also noticed that the instance refuses to work if a django secret is not set, it doesn't create one by itself as indicated. Considering so much fuss is made about known django secret keys, it seems weird that it will complain infinitely that no secret is set.

Lastly, I used the default created postgres database, and I think this might also somehow be important.
Creating a secondary database with all permissions (Using instructions in my previous comment) might well be an issue, but I haven't gone back to test this as I've been able to wipe and restart without issues. Still, would be a weird bug if that's the case that you have to dedicate an entire postgres instance or it will refuse to work as part of a shared instance.

Can I ask what solution you went with in the end?
I'm currently working through different solutions at the moment, with the intention/use-case of sharing self-hosted family photos amongst my family.

I'm glad you got it working! I love Photonix but have been having issues with face detection so started exploring other options (at least for now). I found damselfly and started using it, it's much the same except it uses Azure for facial recognition (everything else is local), so far I've been pretty happy but still testing.

Yeah, I've been playing with Photonix for a few hours and I'm seeing issues as well.
The UI is having some issues, and I cannot seem to be able to edit anything from the initial admin user.
I can see the images places in the /data/photos directory, but cannot add new face or object recognitions. I cannot seem to add or edit anything tbh, not sure what's going on there or if that's by design.
Also, the "drop folder" image import function seems to not work at all, I can just place new pictures in the /data/photos directory itself and they are picked up but I setup /data/import as a dropbox folder and nothing seems to be seen (even after restarting container, I saw advised somewhere else).

Furthermore, the manage.py script appears to have some serious issues, and is creating issues for me already:

  • I can create a user/superuser, but I cannot delete a user/superuser? Seriously?
  • If I create a superuser without creating a NEW library with create_library, the superuser has null access. Just logs into a void.
  • Cannot assign a library in createsuperuser like you can with create_user, only create a new Library for the superuser?
  • Seems impossible to assign libraries to users after creation?

The idea is that I just want a single central library initially, but achieving that seems problematic.

I was looking at damselfly as well and heard good things, but encountered a strange "Segmentation fault" container crashing issue with it. I want to get back to trying samselfly as well.
I should probably open an issue there to see if there's any solution, it seems in active development.

Try posting on damselfly subreddit, I did this morning and had a reply from the author within 30~ minutes, I'm running it in docker on UnRAID without issue so far.

I will say I prefer Photonix/Damselfly's object detection but Photoprism for face recognition and layout, I might run Damselfly for object detection and have it write to the EXIF data, then bring it into Photoprism for management/face matching.

Thanks @neostim I don't want to get too much into the damselfly issue here, as its not this project to be fair, but I just now opened an issue on the damselfly github. I'll take a look at the subreddit and see if there's anything there as well, thanks!

If you have time, I would really appreciate you taking a look at the github issue 334 and see if you can reproduce it as simply as I can? It would really help especially as you're using Unraid also.

Apart from that, I'm still testing Photonix alongside Photoprism and Damselfly to see if I can get somewhere.