Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to add/delete albums after upgrade not working #84

Open
machitza opened this issue Dec 16, 2024 · 3 comments
Open

Trying to add/delete albums after upgrade not working #84

machitza opened this issue Dec 16, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@machitza
Copy link

machitza commented Dec 16, 2024

I am trying to delete albums. I have updated immich to latest distribution... before it was working.
Immich version - server version 1.122.3

root@71b3513bd270:/usr/src/app# telnet localhost 2283
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

------------------------------------------ deleting
root@71b3513bd270:/usr/src/app# my-venv/bin/python3 ./immich_auto_album.py /media http://localhost:2283/api 123 -m DELETE_ALL --album-levels=4 --delete-confirm
time=2024-12-16T13:19:47.809+02:00 level=INFO msg=Detected Immich server version 1.122.3
Traceback (most recent call last):
File "/usr/src/app/my-venv/lib/python3.11/site-packages/urllib3/connectionpool.py", line 536, in _make_request
response = conn.getresponse()
^^^^^^^^^^^^^^^^^^
File "/usr/src/app/my-venv/lib/python3.11/site-packages/urllib3/connection.py", line 507, in getresponse
httplib_response = super().getresponse()
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/http/client.py", line 1374, in getresponse
response.begin()
File "/usr/lib/python3.11/http/client.py", line 318, in begin
version, status, reason = self._read_status()
^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/http/client.py", line 279, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/socket.py", line 706, in readinto
return self._sock.recv_into(b)
^^^^^^^^^^^^^^^^^^^^^^^
TimeoutError: timed out

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/src/app/my-venv/lib/python3.11/site-packages/requests/adapters.py", line 667, in send
resp = conn.urlopen(
^^^^^^^^^^^^^
File "/usr/src/app/my-venv/lib/python3.11/site-packages/urllib3/connectionpool.py", line 843, in urlopen
retries = retries.increment(
^^^^^^^^^^^^^^^^^^
File "/usr/src/app/my-venv/lib/python3.11/site-packages/urllib3/util/retry.py", line 474, in increment
raise reraise(type(error), error, _stacktrace)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/app/my-venv/lib/python3.11/site-packages/urllib3/util/util.py", line 39, in reraise
raise value
File "/usr/src/app/my-venv/lib/python3.11/site-packages/urllib3/connectionpool.py", line 789, in urlopen
response = self._make_request(
^^^^^^^^^^^^^^^^^^^
File "/usr/src/app/my-venv/lib/python3.11/site-packages/urllib3/connectionpool.py", line 538, in _make_request
self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
File "/usr/src/app/my-venv/lib/python3.11/site-packages/urllib3/connectionpool.py", line 369, in _raise_timeout
raise ReadTimeoutError(
urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='localhost', port=2283): Read timed out. (read timeout=5)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/src/app/./immich_auto_album.py", line 1020, in
albums = fetch_albums()
^^^^^^^^^^^^^^
File "/usr/src/app/./immich_auto_album.py", line 524, in fetch_albums
r = requests.get(root_url+api_endpoint, **requests_kwargs, timeout=REQUEST_TIMEOUT)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/app/my-venv/lib/python3.11/site-packages/requests/api.py", line 73, in get
return request("get", url, params=params, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/app/my-venv/lib/python3.11/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/app/my-venv/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/app/my-venv/lib/python3.11/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/app/my-venv/lib/python3.11/site-packages/requests/adapters.py", line 713, in send
raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPConnectionPool(host='localhost', port=2283): Read timed out. (read timeout=5)

------------------------------------------ adding
root@71b3513bd270:/usr/src/app# my-venv/bin/python3 ./immich_auto_album.py /media http://localhost:2283/api 12345 -i /pwg_representative/:/out/:/mov/:/*.heic:/*.HEIC:/heic/ --album-levels=4 --set-album-thumbnail=random
time=2024-12-16T13:47:44.034+02:00 level=INFO msg=Detected Immich server version 1.122.3
time=2024-12-16T13:47:44.034+02:00 level=INFO msg=Requesting all assets
time=2024-12-16T13:47:44.248+02:00 level=INFO msg=22 photos found
time=2024-12-16T13:47:44.248+02:00 level=INFO msg=Sorting assets to corresponding albums using folder name
time=2024-12-16T13:47:44.250+02:00 level=INFO msg=16 albums identified
time=2024-12-16T13:47:44.250+02:00 level=INFO msg=Album list: ['2004 mifune', '2007 15.12.2007.acasa moviez', '2008 Diverse acasa', '2014 09.06.2014.banchet.octavian poze.miha.upet', '2020 07.07.2020.piti', '2020 22.09.2020.piti', '2020 31.07.2020.alin', '2021 09.05.2021-Potlogi', '2021 Diverse poante', '2021 Diverse targoviste', '2021 Piti 02.12.2021.Piti', '2022 29.10.2022-Intilnire.colegi.liceu', '2022 Diverse moviez', '2023 12.03.2023-Piatra.Craiului-Piatra.Mica-Vf.Ascutit', 'poze-dvd poze-2013-FR.Deu best.of', 'poze-dvd poze-2014-Greece 06.09.2014.atena']
Press enter to create these albums, Ctrl+C to abort

time=2024-12-16T13:47:46.537+02:00 level=INFO msg=Listing existing albums on immich
Traceback (most recent call last):
File "/usr/src/app/my-venv/lib/python3.11/site-packages/urllib3/connectionpool.py", line 536, in _make_request
response = conn.getresponse()
^^^^^^^^^^^^^^^^^^
File "/usr/src/app/my-venv/lib/python3.11/site-packages/urllib3/connection.py", line 507, in getresponse
httplib_response = super().getresponse()

@Salvoxia
Copy link
Owner

Huh, maybe I set the timeout a bit too restrictively. Since you're using the bare python script, would you mind editing line 90 to increase the timeout to, say, 20 and try again?

@machitza
Copy link
Author

fixed

@Salvoxia
Copy link
Owner

Thanks for testing.
I'll update the default and add an option to override it if necessary.

@Salvoxia Salvoxia self-assigned this Dec 16, 2024
@Salvoxia Salvoxia added the bug Something isn't working label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants