LibrePhotos / librephotos

A self-hosted open source photo management service. This is the repository of the backend.
MIT License
7.01k stars 309 forks source link

Option to set scan directory missing in admin area #51

Closed 92Magnum closed 3 years ago

92Magnum commented 3 years ago

Followed the recommended Docker-compose method. I have modified only the path to volumes under the backend inside the docker-compose.yml file (as shown)

  backend:
    image: reallibrephotos/librephotos:dev
    # For development uncomment the "build" line below and comment the "image" line above
    # build: .
    container_name: librephotos-backend
    restart: always
    volumes:
      - $HOME/Pictures/librephotos/librephotos_images:/data # CHANGE ME
      - $HOME/Pictures/librephotos/librephotos_media:/code/protected_media # CHANGE ME
      - $HOME/Pictures/librephotos/librephotos_logs:/code/logs # CHANGE ME
      - $HOME/Pictures/librephotos/librephotos_cache:/root/.cache # CHANGE ME

Logged in as admin but the link to set the scan directory is missing. librephotos_no_directory

Not sure if this helps but found this issue in the backend logs on running docker logs librephotos-backend

Traceback (most recent call last): File "/miniconda/lib/python3.8/site-packages/gunicorn/workers/base_async.py", line 55, in handle self.handle_request(listener_name, req, client, addr) File "/miniconda/lib/python3.8/site-packages/gunicorn/workers/ggevent.py", line 143, in handle_request super().handle_request(listener_name, req, sock, addr) File "/miniconda/lib/python3.8/site-packages/gunicorn/workers/base_async.py", line 106, in handle_request respiter = self.wsgi(environ, resp.start_response) File "/miniconda/lib/python3.8/site-packages/django/core/handlers/wsgi.py", line 133, in call response = self.get_response(request) File "/miniconda/lib/python3.8/site-packages/django/core/handlers/base.py", line 75, in get_response response = self._middleware_chain(request) File "/miniconda/lib/python3.8/site-packages/django/core/handlers/exception.py", line 36, in inner response = response_for_exception(request, exc) File "/miniconda/lib/python3.8/site-packages/django/core/handlers/exception.py", line 90, in response_for_exception response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info()) File "/miniconda/lib/python3.8/site-packages/django/core/handlers/exception.py", line 125, in handle_uncaught_exception return debug.technical_500_response(request, *exc_info) File "/miniconda/lib/python3.8/site-packages/django/views/debug.py", line 91, in technical_500_response text = reporter.get_traceback_text() File "/miniconda/lib/python3.8/site-packages/django/views/debug.py", line 341, in get_traceback_text return t.render(c) File "/miniconda/lib/python3.8/site-packages/django/template/base.py", line 171, in render return self._render(context) File "/miniconda/lib/python3.8/site-packages/django/template/base.py", line 163, in _render return self.nodelist.render(context) File "/miniconda/lib/python3.8/site-packages/django/template/base.py", line 936, in render bit = node.render_annotated(context) File "/miniconda/lib/python3.8/site-packages/django/template/base.py", line 903, in render_annotated return self.render(context) File "/miniconda/lib/python3.8/site-packages/django/template/base.py", line 986, in render output = self.filter_expression.resolve(context) File "/miniconda/lib/python3.8/site-packages/django/template/base.py", line 693, in resolve obj = template_localtime(obj, context.use_tz) File "/miniconda/lib/python3.8/site-packages/django/utils/timezone.py", line 186, in template_localtime return localtime(value) if should_convert else value File "/miniconda/lib/python3.8/site-packages/django/utils/timezone.py", line 204, in localtime timezone = get_current_timezone() File "/miniconda/lib/python3.8/site-packages/django/utils/timezone.py", line 97, in get_current_timezone return getattr(_active, "value", get_default_timezone()) File "/miniconda/lib/python3.8/site-packages/django/utils/timezone.py", line 83, in get_default_timezone return pytz.timezone(settings.TIME_ZONE) File "/miniconda/lib/python3.8/site-packages/pytz/init.py", line 181, in timezone raise UnknownTimeZoneError(zone) pytz.exceptions.UnknownTimeZoneError: '' `

derneuere commented 3 years ago

I have found the issue. Please add at a timezone to TIME_ZONE or use the default America/Chicago. Does this fix your issue?

92Magnum commented 3 years ago

Thanks for the quick response. Setting the TIME_ZONE fixed the issue. I am now able to see the link to the change the directory. I see that there is another issue. Once i select the scan directory and hit scan photos, it shows "11 items processed" (I had 11 images) but there are no photos under the "Photos" or "Albums" section. Also, I noticed that the scan happened too quickly (as compared to hooram/ownphotos which I tried earlier, took 10 seconds approx.)

librephotos_scan_photos

This is what I see in the backend logs after hitting "scan photos"

[2020-12-29 19:33:21 +0000] [116] [INFO] Starting gunicorn 20.0.4 [2020-12-29 19:33:21 +0000] [116] [INFO] Listening at: http://0.0.0.0:8001 (116) [2020-12-29 19:33:21 +0000] [116] [INFO] Using worker: gevent [2020-12-29 19:33:21 +0000] [120] [INFO] Booting worker with pid: 120 [2020-12-29 19:33:21 +0000] [121] [INFO] Booting worker with pid: 121 19:33:36 Worker rq:worker:157901144ee446eeb871591551bedbdc: started, version 1.6.1 19:33:36 Subscribing to channel rq:pubsub:157901144ee446eeb871591551bedbdc 19:33:36 *** Listening on default... 19:33:36 Cleaning registries for queue: default Bad Request: /api/nextcloud/listdir/ Not Found: /api/jobs/ Not Found: /api/jobs/ Bad Request: /api/nextcloud/listdir/ Not Found: /api/jobs/ 127.0.0.1 - - [2020-12-29 19:33:57] "POST /build/ HTTP/1.1" 200 139 0.001662 Not Found: /api/jobs/ Not Found: /api/jobs/ Bad Request: /api/nextcloud/listdir/ 127.0.0.1 - - [2020-12-29 19:35:47] "POST /build/ HTTP/1.1" 200 139 0.001184 Not Found: /api/jobs/ Bad Request: /api/nextcloud/listdir/ Bad Request: /api/nextcloud/listdir/ 127.0.0.1 - - [2020-12-29 19:37:27] "POST /build/ HTTP/1.1" 200 139 0.001161 Bad Request: /api/nextcloud/listdir/ Bad Request: /api/nextcloud/listdir/ Not Found: /api/jobs/ Not Found: /api/jobs/ Bad Request: /api/nextcloud/listdir/ Not Found: /api/jobs/ Not Found: /api/jobs/ Not Found: /api/jobs/ Bad Request: /api/nextcloud/listdir/ Not Found: /api/jobs/ Not Found: /api/jobs/

derneuere commented 3 years ago

Are the items photos that are .jpg, .png, .gif or .bmp? If that isn't the case could you maybe send me the ownphotos.log file? It is in the mapped logs folder.

92Magnum commented 3 years ago

I think the issue was with how I provided the path to the volume. Earlier when I ran docker-compose with $HOME/... in volume paths, which did not create any files(logs etc) inside the local volumes. I changed the path to absolute (/home/username/) and ran docker-compose. Everything seems to be working fine now. Docker container was pointing to root (with $HOME) whereas my images were in the default user directory.

derneuere commented 3 years ago

Ah okay! I will close the issue then.