photonix
photonix copied to clipboard
Starting fresh fails to login
Describe the bug
At the very initial setup, after /onboarding/step5
it tries to redirect to /login
page, but it gives TypeError: Cannot read property 'form' of null
and only shows a black empty page.
To Reproduce Steps to reproduce the behavior:
- Install and run as https://photonix.org/docs/installing/#setting-up
- create user and library
- login the first time and set it up
- "we are all set"
- black empty screen
Expected behavior I think login form should show.
Screenshots
This is after /onboarding/step5
and moving to /login
.
Desktop (please complete the following information):
- OS: OSX 11.2.3 (20D91)
- Browser Version 89.0.4389.128 (Official Build) (arm64)
Hi github0013, thanks for reporting the issue. Could you tell me where the server is running - locally, VM or another machine? If on another machine what is the OS and architecture? I see you mentioned the browser is arm64 so I'm thinking the architecture might be the reason. Thanks.
My client is OSX. I run stuff on my local ubuntu server. On the ubuntu, I have docker installed to run Photonix.
▶ uname -a Linux ubuntu 5.4.0-66-generic #74-Ubuntu SMP Wed Jan 27 22:54:38 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
▶ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.2 LTS Release: 20.04 Codename: focal
▶ docker-compose --version docker-compose version 1.28.4, build cabd5cfb
▶ docker --version Docker version 20.10.3, build 48d30b5
I tried my iPhone with different browsers (Brave, Safari and Chrome), they resulted the same black blank page.
photonix | 192.168.1.176 - - [01/May/2021:00:01:20 +0000] "POST /graphql HTTP/1.1" 200 29 "http://ubuntu.local:8888/login" "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Mobile/15E148 Safari/604.1"
photonix | Traceback (most recent call last):
photonix | File "/usr/local/lib/python3.8/site-packages/promise/promise.py", line 489, in _resolve_from_executor
photonix | executor(resolve, reject)
photonix | File "/usr/local/lib/python3.8/site-packages/promise/promise.py", line 756, in executor
photonix | return resolve(f(*args, **kwargs))
photonix | File "/usr/local/lib/python3.8/site-packages/graphql/execution/middleware.py", line 75, in make_it_promise
photonix | return next(*args, **kwargs)
photonix | File "/srv/photonix/accounts/schema.py", line 116, in resolve_after_signup
photonix | if user.has_configured_image_analysis:
photonix | File "/usr/local/lib/python3.8/site-packages/django/utils/functional.py", line 225, in inner
photonix | return func(self._wrapped, *args)
photonix | graphql.error.located_error.GraphQLLocatedError: 'AnonymousUser' object has no attribute 'has_configured_image_analysis'
photonix |
photonix | 192.168.1.176 - - [01/May/2021:00:01:20 +0000] "POST /graphql HTTP/1.1" 200 185 "http://ubuntu.local:8888/login" "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Mobile/15E148 Safari/604.1"
Looking at the logs, I noticed graphql.error.located_error.GraphQLLocatedError: 'AnonymousUser' object has no attribute 'has_configured_image_analysis'
line. Is this maybe the reason?
Thanks for the extra detail @github0013. I'll try and reproduce.
Exactly the same issue here!
Tried on latest OSX with latest Docker, with iOS apps on iPad and iPhone as well as chrome and Firefox browsers.
Fresh install and experiencing the same blank screen login problem Also running Ubuntu 20.04 docker-compose version 1.29.2 Docker version 20.10.7, build f0df350
Same issue here. It worked fine to create the first user. Then, I ran the phython script to create a second user and can no longer get the login screen to come up. It shows the login box for a second, then it errors out and disappears, leaving a black screen.
Running from Docker (docker-compose) on Synology NAS accessing site through an nginx reverse proxy.
I have the same issue now after "reinstalling" my setup. I had set up a site with v0.9.0 before and everything was working, also after updating to the latest version regularly. I wanted to start anew however and deleted all my data (except the photos folder). After onboarding, I now face this issue.
Same here. "Cannot read property 'form' of null " on freshly installed 20.04. It seems Photonix is broken in its current version.
This issue was caused by has_config_persional_info
field set to f
in accounts_user
PostgreSQL table of photonix DB.
It looks like both Django's createsuperuser
and onboarding step 1 forget to set this value properly to t
.
Workaround for this issue is pretty simple:
- Connect to your Docker host
- Execute the following command:
docker exec -it photonix-postgres psql -U postgres photonix -c "update accounts_user set has_config_persional_info='t';"
That's it!
This issue was caused by
has_config_persional_info
field set tof
inaccounts_user
PostgreSQL table of photonix DB. It looks like both Django'screatesuperuser
and onboarding step 1 forget to set this value properly tot
.Workaround for this issue is pretty simple:
- Connect to your Docker host
- Execute the following command:
docker exec -it photonix-postgres psql -U postgres photonix -c "update accounts_user set has_config_persional_info='t';"
That's it!
Thank you so much for that workaround. It worked great!
Hit this also, I wondered if the cause of the bug is what looks like a typo in a property name (persional
for personal
) but no luck finding an instance that tries to set has_config_personal_info
instead.
NB: https://github.com/photonixapp/photonix/pull/352 below is not expected to resolve this issue, only to fix the typo and eliminate that as a possible cause (or potential for future problems) 😁
I see that https://github.com/photonixapp/photonix/blob/4bdd939780c16df97f056262df245009c26cc618/photonix/accounts/management/commands/create_admin_from_env.py#L34-L37 and https://github.com/photonixapp/photonix/blob/4bdd939780c16df97f056262df245009c26cc618/photonix/photos/management/commands/import_demo_photos.py#L37-L43 both apply the has_config_persional_info
as True. This might mean that tests against demo environments do not reveal the behaviour which is observed when bringing a site up from the install docs. Environments setting ADMIN_USERNAME
and ADMN_PASSWORD
from env/docker-compose.yml won't observe this broken behaviour.
If that behaviour is required for the admin account to work when created as per install docs, then perhaps there's an event on Django's createsuperuser
(or account create) command which we can react to and apply the permission there as appropriate?
I suspect that the bug to fix here isn't "ensure every user who can log in has has_config_personal_info
== True", but "ensure users can view the app regardless of has_config_personal_info
value". (If the flag should prevent login, then we'd see an HTTP 403, right?) So the SQL update above is a workaround to keep the system in a non-broken state temporarily AFAICT.
i am using the latest compose version and i cannot login after creating the super user as well. loading... never ends. i turned all the booleans f to t in accounts_user but no luck. created another admin user with create_admin_from_env but no luck. cannot login at all
This issue was caused by
has_config_persional_info
field set tof
inaccounts_user
PostgreSQL table of photonix DB. It looks like both Django'screatesuperuser
and onboarding step 1 forget to set this value properly tot
.Workaround for this issue is pretty simple:
- Connect to your Docker host
- Execute the following command:
docker exec -it photonix-postgres psql -U postgres photonix -c "update accounts_user set has_config_persional_info='t';"
That's it!
Brilliant!