Salvoxia / immich-folder-album-creator

Automatically create and populate albums in Immich from a folder structure in external libraries
https://hub.docker.com/r/salvoxia/immich-folder-album-creator
222 stars 13 forks source link

Error "No connection adapters were found for.." with Immich 1.106.4 #18

Closed cetorr closed 4 months ago

cetorr commented 4 months ago

I can't get the script to work. Possibly has to do with the latest version I'm guessing. I'm on the (current) version: 1.106.4. If I go to the URL that it spits out (https://xx.com/api/server-info/version), I get the version of Immich in the browser.

The error is:

Traceback (most recent call last): File "/home/cetorr/immich_auto_album.py", line 296, in <module> version = fetchServerVersion() ^^^^^^^^^^^^^^^^^^^^ File "/home/cetorr/immich_auto_album.py", line 159, in fetchServerVersion r = requests.get(root_url+'server-info/version', **requests_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/requests/api.py", line 73, in get return request("get", url, params=params, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/requests/api.py", line 59, in request return session.request(method=method, url=url, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/requests/sessions.py", line 587, in request resp = self.send(prep, **send_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/requests/sessions.py", line 695, in send adapter = self.get_adapter(url=request.url) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/requests/sessions.py", line 792, in get_adapter raise InvalidSchema(f"No connection adapters were found for {url!r}") requests.exceptions.InvalidSchema: No connection adapters were found for 'api_url=https://xx.com/api/server-info/version'

Anyone knows the fix for this? Thanks in advance!

Salvoxia commented 4 months ago

Hi,

judging from the error my guess is the way the script is called is not correct. The error No connection adapters were found for 'api_url=https://xx.com/api/server-info/version' indicates the script interprets api_url=https://xx.com/... as the actual API url, whereas it should only be https://xx.com/.... You do not pass the API url to the script by supplying an api_url option, but API URL is a positional argument. So the call should look like this: python3 ./immich_auto_album.py /my/path/to/external/lib https://xx.com/api thisIsMyAPIKey

If that doesn't resolve your issue, please share the exact command you called the script with.

Best Regards, Salvoxia

cetorr commented 4 months ago

Thank you so much, that was indeed my problem. Noob error.

Keep it up!