LibrePhotos / librephotos-linux

Here you can find the installation script for a local Linux install.
MIT License
47 stars 15 forks source link

Unauthorized: /api/albums/date/list/ #60

Closed PRBB28 closed 1 year ago

PRBB28 commented 1 year ago

I followed the the instructions on how to install, the ran install-librephotos.sh. Had an error regarding torch not available since I'm using pyhton 3.10. Installation finished. Did the rest of the configuration than accessed librephotos. Setup went fine. Added a picture it scaned it fine, but when I click on photos it says no image. And get the unauthorized in gunicorn log.

here's the log:

[2023-06-07 09:05:57 +0000] [185312] [INFO] Starting gunicorn 20.1.0 [2023-06-07 09:05:57 +0000] [185312] [INFO] Listening at: http://127.0.0.1:8001 (185312) [2023-06-07 09:05:57 +0000] [185312] [INFO] Using worker: gevent [2023-06-07 09:05:57 +0000] [185314] [INFO] Booting worker with pid: 185314 [2023-06-07 09:05:57 +0000] [185315] [INFO] Booting worker with pid: 185315 use SECRET_KEY from env use SECRET_KEY from env /usr/lib/librephotos/.local/lib/python3.10/site-packages/rest_framework/pagination.py:200: UnorderedObjectListWarning: Pagination may yield inconsistent results with an unordered object_list: <class 'api.models.person.Person'> QuerySet. paginator = self.django_paginator_class(queryset, page_size) /usr/lib/librephotos/.local/lib/python3.10/site-packages/rest_framework/pagination.py:200: UnorderedObjectListWarning: Pagination may yield inconsistent results with an unordered object_list: <class 'api.models.person.Person'> QuerySet. paginator = self.django_paginator_class(queryset, page_size) Unauthorized: /api/albums/date/list/ Unauthorized: /api/albums/date/list/ Unauthorized: /api/albums/date/list/ Unauthorized: /api/rqavailable/

Already did installation twice.

I'm running it under proxmox, with ubuntu 22.04 guest os.

PRBB28 commented 1 year ago

Update : Still getting the same unauthorized message in the log. But now square are showing in the photo page. After I uploaded a few more photos.

Screen Shot
derneuere commented 1 year ago

The unauthorized API calls happen when the token expired. Either the client can refresh it or when not you will get logged out.

Your issue seems to be something different. My guess is that nginx cannot forward your thumbnails, because of a misconfiguration. The thumbnails are in the data folder in protected_media

PRBB28 commented 1 year ago

I tried to rule out nginx by installing a desktop environment on the librephotos server, unfortunately when I try to use localhot:3000 I got to login screen but no further. So tried another reinstall, but this time I did not create the directory for the BASE_DATA and PHOTOS, and let the installer create it, also I did not add the SECRET_KEY into the backend configuration.

I'm still getting the unauthorized api in the logs, but now the photos are appearing. The only weird behavior I'm noticing is that the las t photo I upload does not show up until I upload another one. Trying to wait a bit more to see if it corrects itself.

PRBB28 commented 1 year ago

The problem with photos not appearing after upload is dependent on the filesize. If 1mb or bigger, scan doesn't seem to pick it up until you upload another photo. If you upload a photo less than 1mb same thing but the photo less 1 mb is immediately scaned. Copying the large jpeg file directly to the scan directory and doing a manual scan seems to work fine.

Don't know if it's just my installation or its a bug cause I only have my installation to test. Anyway I can live with just copy my photos directly to the scan directory so I'm closing this issue.