Skip to content
This repository was archived by the owner on Jul 27, 2024. It is now read-only.
This repository was archived by the owner on Jul 27, 2024. It is now read-only.

librephotos-backend start error: TypeError: 'type' object is not subscriptable #56

Description

@cahaya42

To install librephotos, I made a fresh install of Ubuntu 20.04.5 LTS in VirtualBox.
I solved a couple of issues (postgresql user & secret.key) but now I'm stuck on TypeError: 'type' object is not subscriptable error.

# service librephotos-backend status
● librephotos-backend.service - librephotos-backend
     Loaded: loaded (/etc/systemd/system/librephotos-backend.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2023-02-09 15:57:48 ACDT; 5h 57min ago
       Docs: https://github.com/LibrePhotos/librephotos
   Main PID: 1038 (bash)
      Tasks: 7 (limit: 38428)
     Memory: 495.2M
     CGroup: /system.slice/librephotos-backend.service
             ├─1038 bash /usr/lib/librephotos/bin/librephotos-backend
             ├─1614 /usr/bin/python3 /usr/bin/gunicorn --workers=2 --worker-class=gevent --timeout 3600 --bind 127.0.0.1:8001 --log-level=info ownphotos.wsgi
             ├─1615 tee /var/log/librephotos//gunicorn_django.log
             ├─1617 /usr/bin/python3 /usr/bin/gunicorn --workers=2 --worker-class=gevent --timeout 3600 --bind 127.0.0.1:8001 --log-level=info ownphotos.wsgi
             └─1618 /usr/bin/python3 /usr/bin/gunicorn --workers=2 --worker-class=gevent --timeout 3600 --bind 127.0.0.1:8001 --log-level=info ownphotos.wsgi

Feb 09 16:16:54 photos librephotos-backend[1615]:     from api.serializers.album_auto import AlbumAutoListSerializer, AlbumAutoSerializer
Feb 09 16:16:54 photos librephotos-backend[1615]:   File "/usr/lib/librephotos/backend/api/serializers/album_auto.py", line 4, in <module>
Feb 09 16:16:54 photos librephotos-backend[1615]:     from api.serializers.person import PersonSerializer
Feb 09 16:16:54 photos librephotos-backend[1615]:   File "/usr/lib/librephotos/backend/api/serializers/person.py", line 5, in <module>
Feb 09 16:16:54 photos librephotos-backend[1615]:     from api.serializers.photos import GroupedPhotosSerializer
Feb 09 16:16:54 photos librephotos-backend[1615]:   File "/usr/lib/librephotos/backend/api/serializers/photos.py", line 133, in <module>
Feb 09 16:16:54 photos librephotos-backend[1615]:     class PhotoSerializer(serializers.ModelSerializer):
Feb 09 16:16:54 photos librephotos-backend[1615]:   File "/usr/lib/librephotos/backend/api/serializers/photos.py", line 209, in PhotoSerializer
Feb 09 16:16:54 photos librephotos-backend[1615]:     def get_image_path(self, obj) -> list[str]:
Feb 09 16:16:54 photos librephotos-backend[1615]: TypeError: 'type' object is not subscriptable

The same error occurs in the /var/log/librephotos/gunicorn_django.log file when launch the site for the first time in a web browser.

2023-02-09 05:46:54 +0000] [1617] [ERROR] Error handling request /api/firsttimesetup/
Traceback (most recent call last):
  File "/usr/lib/librephotos/.local/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/usr/lib/librephotos/.local/lib/python3.8/site-packages/django/core/handlers/base.py", line 167, in _get_response
    callback, callback_args, callback_kwargs = self.resolve_request(request)
  File "/usr/lib/librephotos/.local/lib/python3.8/site-packages/django/core/handlers/base.py", line 290, in resolve_request
    resolver_match = resolver.resolve(request.path_info)
  File "/usr/lib/librephotos/.local/lib/python3.8/site-packages/django/urls/resolvers.py", line 549, in resolve
    for pattern in self.url_patterns:
  File "/usr/lib/librephotos/.local/lib/python3.8/site-packages/django/utils/functional.py", line 48, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/usr/lib/librephotos/.local/lib/python3.8/site-packages/django/urls/resolvers.py", line 593, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/usr/lib/librephotos/.local/lib/python3.8/site-packages/django/utils/functional.py", line 48, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/usr/lib/librephotos/.local/lib/python3.8/site-packages/django/urls/resolvers.py", line 586, in urlconf_module
    return import_module(self.urlconf_name)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/lib/librephotos/backend/ownphotos/urls.py", line 30, in <module>
    from api.views import (
  File "/usr/lib/librephotos/backend/api/views/album_auto.py", line 11, in <module>
    from api.serializers.album_auto import AlbumAutoListSerializer, AlbumAutoSerializer
  File "/usr/lib/librephotos/backend/api/serializers/album_auto.py", line 4, in <module>
    from api.serializers.person import PersonSerializer
  File "/usr/lib/librephotos/backend/api/serializers/person.py", line 5, in <module>
    from api.serializers.photos import GroupedPhotosSerializer
  File "/usr/lib/librephotos/backend/api/serializers/photos.py", line 133, in <module>
    class PhotoSerializer(serializers.ModelSerializer):
  File "/usr/lib/librephotos/backend/api/serializers/photos.py", line 209, in PhotoSerializer
    def get_image_path(self, obj) -> list[str]:
TypeError: 'type' object is not subscriptable

Any suggestions on how to investigate this further?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions