friendlyFriend4000 / prometheus-immich-exporter

A prometheus exporter for immich written in Python. Docker image
https://github.com/immich-app/immich#demo
GNU General Public License v3.0
26 stars 9 forks source link

Docker won't start #2

Closed Jaonea closed 1 year ago

Jaonea commented 1 year ago

Docker won't start on Unraid

tried different ports (web, api etc.) no luck here are the logs:

01.04.2023 14:25:52

asctime= 2023-04-01 12:25:52levelname= INFOmessage= Exporter is starting up

01.04.2023 14:25:52 Traceback (most recent call last): 01.04.2023 14:25:52 File "/usr/bin/immich_exporter", line 33, in 01.04.2023 14:25:52 sys.exit(load_entry_point('prometheus-immich-exporter==1.0.0', 'console_scripts', 'immich_exporter')()) 01.04.2023 14:25:52 File "/usr/lib/python3.9/site-packages/immich_exporter/exporter.py", line 315, in main 01.04.2023 14:25:52 REGISTRY.register(ImmichMetricsCollector(config)) 01.04.2023 14:25:52 File "/usr/lib/python3.9/site-packages/prometheus_client/registry.py", line 26, in register 01.04.2023 14:25:52 names = self._get_names(collector) 01.04.2023 14:25:52 File "/usr/lib/python3.9/site-packages/prometheus_client/registry.py", line 66, in _get_names 01.04.2023 14:25:52 for metric in desc_func(): 01.04.2023 14:25:52 File "/usr/lib/python3.9/site-packages/immich_exporter/exporter.py", line 25, in collect 01.04.2023 14:25:52 metrics = self.get_immich_metrics() 01.04.2023 14:25:52 File "/usr/lib/python3.9/site-packages/immich_exporter/exporter.py", line 43, in get_immich_metrics 01.04.2023 14:25:52 metrics.extend(self.get_immich_server_version_number()) 01.04.2023 14:25:52 File "/usr/lib/python3.9/site-packages/immich_exporter/exporter.py", line 223, in get_immich_server_version_number 01.04.2023 14:25:52 server_version_number = (str(response_server_version.json()["major"]) + "." + 01.04.2023 14:25:52 KeyError: 'major' Container stopped

happy to provide any other logs

friendlyFriend4000 commented 1 year ago

Sorry for the late reply. The error is thrown if grafana or prometheus or immich cannot be reached internally. Double check all ports and also the immich api key.

Allram commented 1 year ago

Getting the same issues. This is supposed to be pointed to the Immich_server docker, correct? With port 3001?

{"asctime": "2023-05-26 09:50:55", "levelname": "INFO", "message": "Exporter is starting up"} Traceback (most recent call last): File "/usr/bin/immich_exporter", line 33, in <module> sys.exit(load_entry_point('prometheus-immich-exporter==1.0.0', 'console_scripts', 'immich_exporter')()) File "/usr/lib/python3.9/site-packages/immich_exporter/exporter.py", line 315, in main REGISTRY.register(ImmichMetricsCollector(config)) File "/usr/lib/python3.9/site-packages/prometheus_client/registry.py", line 26, in register names = self._get_names(collector) File "/usr/lib/python3.9/site-packages/prometheus_client/registry.py", line 66, in _get_names for metric in desc_func(): File "/usr/lib/python3.9/site-packages/immich_exporter/exporter.py", line 25, in collect metrics = self.get_immich_metrics() File "/usr/lib/python3.9/site-packages/immich_exporter/exporter.py", line 43, in get_immich_metrics metrics.extend(self.get_immich_server_version_number()) File "/usr/lib/python3.9/site-packages/immich_exporter/exporter.py", line 223, in get_immich_server_version_number server_version_number = (str(response_server_version.json()["major"]) + "." + KeyError: 'major'

friendlyFriend4000 commented 1 year ago

You need to point it at the internal web ui port which means you need to point it to IMMICH_PROXY if you are using docker compose. The default value is 2283.

Allram commented 1 year ago

Seems like it manages to connect with the latest changes you did, but now i'm getting errors about "diskAvailableRaw":

{"asctime": "2023-07-18 17:16:39", "levelname": "INFO", "message": "Exporter is starting up"}
Traceback (most recent call last):
  File "/usr/bin/immich_exporter", line 33, in <module>
    sys.exit(load_entry_point('prometheus-immich-exporter==1.0.0', 'console_scripts', 'immich_exporter')())
  File "/usr/lib/python3.9/site-packages/immich_exporter/exporter.py", line 302, in main
    REGISTRY.register(ImmichMetricsCollector(config))
  File "/usr/lib/python3.9/site-packages/prometheus_client/registry.py", line 26, in register
    names = self._get_names(collector)
  File "/usr/lib/python3.9/site-packages/prometheus_client/registry.py", line 66, in _get_names
    for metric in desc_func():
  File "/usr/lib/python3.9/site-packages/immich_exporter/exporter.py", line 25, in collect
    metrics = self.get_immich_metrics()
  File "/usr/lib/python3.9/site-packages/immich_exporter/exporter.py", line 44, in get_immich_metrics
    metrics.extend(self.get_immich_server_info())
  File "/usr/lib/python3.9/site-packages/immich_exporter/exporter.py", line 172, in get_immich_server_info
    "value": (response_server_info.json()["diskAvailableRaw"]),
KeyError: 'diskAvailableRaw'
friendlyFriend4000 commented 1 year ago

Seems like it manages to connect with the latest changes you did, but now i'm getting errors about "diskAvailableRaw":

{"asctime": "2023-07-18 17:16:39", "levelname": "INFO", "message": "Exporter is starting up"}
Traceback (most recent call last):
  File "/usr/bin/immich_exporter", line 33, in <module>
    sys.exit(load_entry_point('prometheus-immich-exporter==1.0.0', 'console_scripts', 'immich_exporter')())
  File "/usr/lib/python3.9/site-packages/immich_exporter/exporter.py", line 302, in main
    REGISTRY.register(ImmichMetricsCollector(config))
  File "/usr/lib/python3.9/site-packages/prometheus_client/registry.py", line 26, in register
    names = self._get_names(collector)
  File "/usr/lib/python3.9/site-packages/prometheus_client/registry.py", line 66, in _get_names
    for metric in desc_func():
  File "/usr/lib/python3.9/site-packages/immich_exporter/exporter.py", line 25, in collect
    metrics = self.get_immich_metrics()
  File "/usr/lib/python3.9/site-packages/immich_exporter/exporter.py", line 44, in get_immich_metrics
    metrics.extend(self.get_immich_server_info())
  File "/usr/lib/python3.9/site-packages/immich_exporter/exporter.py", line 172, in get_immich_server_info
    "value": (response_server_info.json()["diskAvailableRaw"]),
KeyError: 'diskAvailableRaw'

Thank you for reporting! There was indeed an error with the api authorization. I haven't noticed the api changes. Should be fixed with the latest version.

Allram commented 1 year ago

Thank you. It works now :)