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

immich_auto_album.py error #104

Closed
mharvey500 opened this issue Jan 8, 2025 · 17 comments
Closed

immich_auto_album.py error #104

mharvey500 opened this issue Jan 8, 2025 · 17 comments

Comments

@mharvey500
Copy link

I get error in immich_auto_album.py downloaded today Jan 8, 2025
Running in Windows 11 Ubuntu

python3 ./immich_auto_album.py -h

Traceback (most recent call last):
File "./immich_auto_album.py", line 57, in
class AlbumModel:
File "./immich_auto_album.py", line 128, in AlbumModel
def find_incompatible_properties(self, other) -> list[str]:
TypeError: 'type' object is not subscriptable

@Salvoxia
Copy link
Owner

Salvoxia commented Jan 8, 2025

What Python version are you running?

@mharvey500
Copy link
Author

mharvey500 commented Jan 8, 2025 via email

@Salvoxia
Copy link
Owner

Salvoxia commented Jan 8, 2025

I think the style of type-documentation in method headers require at least Python 3.9, developed and tested with Python >= Python 3.11

@mharvey500
Copy link
Author

mharvey500 commented Jan 10, 2025 via email

@Salvoxia
Copy link
Owner

I don't think bare python script is for the Truenas immich as pip3 is needed and not available.

That's true, for TrueNAS the Docker container is ideal. I'm running it myself in my TrueNAS installation.
Let me know if I can be of any help setting it up.

@Salvoxia
Copy link
Owner

I get this message:
Max retries exceeded with url: /api/server/version (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1000)')))

This command:
docker run
-e API_URL="https://192.168.1.111:443/api/"
-e API_KEY="the key"
-e ROOT_PATH="/external_libs/photos"
salvoxia/immich-folder-album-creator:latest
/script/immich_auto_album.sh

I have tested with openssl and it connects.
I am doing this from a powershell terminal window in Docker Desktop in Windows

For some reason this reply didn't make it to the issue (or you deleted it in the meantime?).

Just to make sure:
If you're using self-signed certificates (as the error message implies), you need to set environment variable INSECURE to true.

@mharvey500
Copy link
Author

mharvey500 commented Jan 12, 2025 via email

@Salvoxia
Copy link
Owner

No worries. Have you had a chance to test it with INSECURE: true ?

@mharvey500
Copy link
Author

The IP address 192.168.1.111 and port 443 on the previous test belong to the Truenas server. That's why I said question was not properly formed. But anyways here is result of INSECURE="true". It appears it passed through the SSL negotiation but ran into other errors.
docker run -e API_URL="https://192.168.1.111:443/api/" -e API_KEY="U6pKOslpDeEKC7vAoswe9VmWsmtimPqn564K7GogOQ" -e ROOT_PATH="/external/dig" -e INSECURE="true" salvoxia/immich-folder-album-creator:latest /script/immich_auto_album.sh
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 974, in json
return complexjson.loads(self.text, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/json/init.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/json/decoder.py", line 338, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/json/decoder.py", line 356, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/script/immich_auto_album.py", line 1855, in
version = fetch_server_version()
^^^^^^^^^^^^^^^^^^^^^^
File "/script/immich_auto_album.py", line 677, in fetch_server_version
server_version = r.json()
^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 978, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

@Salvoxia
Copy link
Owner

If 192.168.1.111 is the IP if your TrueNAS box, then https://192.168.1.111:443/api/ links to your TrueNAS webinterface, to the api folder, not to Immich.
If you can access Immich on https://192.168.1.111:2283, then try https://192.168.1.111:2283/api for your API_URL.

@mharvey500
Copy link
Author

https://192.168.1.111:2283 gives
ERR_CONNECTION_REFUSED

@Salvoxia
Copy link
Owner

How do you access Immich?

@mharvey500
Copy link
Author

By the immich Android app, or Immich WEB UI through the Truenas WEB UI.

@Salvoxia
Copy link
Owner

Salvoxia commented Jan 14, 2025

Ok, I meant what URL do use for accessing the Immich Web UI? That's the one to use for API_URL as well (with /api added to it).

@mharvey500
Copy link
Author

The port is 30041, but when I try that through Chrome it says ERR_SSL_PROTOCOL_ERROR.

@Salvoxia
Copy link
Owner

That's indicative of Immich not using https (but maybe Chrome trying to use https), can you run the container with API_URL="http://192.168.1.111:30041/api"?

@mharvey500
Copy link
Author

It's working now with http. Thanks a ton.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants