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] env injector IMMICH_CONFIG_FILE no longer working #1785

Open
jdumeez opened this issue Feb 22, 2025 · 2 comments
Open

🐛 [Immich] env injector IMMICH_CONFIG_FILE no longer working #1785

jdumeez opened this issue Feb 22, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@jdumeez
Copy link

jdumeez commented Feb 22, 2025

Description

Hey Alex,

I have been using your env injector feature to point IMMICH_CONFIG_FILE to a specific JSON file.
Since the last version update it fails to read the file it points to.
I tried another directory but i still get 'no such file or directory'

Unfortunately my immich setup has a wrong external domain url configured which blocks the add-on from booting. I need the JSON file to overrule it otherwise i can't boot up.

thx!
joost

Reproduction steps

update to last version 
configure the env injector with IMMICH_CONFIG_FILE = 'file location'
Boot the add-on

Addon Logs

Starting api worker
[Nest] 1499  - 02/22/2025, 9:24:23 PM     LOG [Api:EventRepository] Initialized websocket server
[Nest] 1499  - 02/22/2025, 9:24:23 PM   ERROR [Api:ServerService] Unable to load configuration file: /addons_config/db21ed7f_immich/immich.json
[Nest] 1499  - 02/22/2025, 9:24:23 PM   ERROR [Api:ServerService] Error: ENOENT: no such file or directory, open '/addons_config/db21ed7f_immich/immich.json'
    at async open (node:internal/fs/promises:639:25)
    at async readFile (node:internal/fs/promises:1246:14)
    at async loadFromFile (/app/immich/server/dist/utils/config.js:90:22)
    at async buildConfig (/app/immich/server/dist/utils/config.js:103:11)
    at async /app/immich/server/dist/utils/config.js:63:26 {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/addons_config/db21ed7f_immich/immich.json'
}

Architecture

amd64

OS

HAos

@jdumeez jdumeez added the bug Something isn't working label Feb 22, 2025
@alexbelgium
Copy link
Owner

Hi, please show the full log to see how the script goes. I modified the /config structure according to new HA guidelines. There should have been an automatic copy of the files, but if not you can use the Filebrowser app, fetch the file in /homeassistant/addons_config/immich/config.yall and copy it in /addon_configs/xxx-immich/

@jdumeez
Copy link
Author

jdumeez commented Feb 23, 2025

Hey alex, the config file is in the new location, and the script does seem to pick up the variable and the location i am pointing it to.
it just can't seem to read the file


Add-on: Immich
Self-hosted photo and video backup solution directly from your mobile phone

Add-on version: 1.126.1-14
You are running the latest version of this add-on.
System: Home Assistant OS 14.2
Architecture: amd64 / qemux86-64
Home Assistant Core: 2025.2.5
Home Assistant Supervisor: 2025.02.1

Please, share the above information when looking for help
or support in, e.g., GitHub, forums

Provided by: https://github.com/alexbelgium/hassio-addons

/etc/cont-init.d/00-global_var.sh: executing
DB_DATABASE_NAME='postgres'
DB_HOSTNAME='192.168.10.7'
DB_PASSWORD=******
DB_PORT='5432'
DB_ROOT_PASSWORD=******
DB_USERNAME='postgres'
DISABLE_MACHINE_LEARNING='false'
JWT_SECRET='j....w='
TZ='Europe/Paris'
cifspassword=******
cifsusername='j...'
data_location='/share/immich'
networkdisks='//192.168.10.3/....SSD'
/etc/cont-init.d/00-local_mounts.sh: executing
/etc/cont-init.d/00-smb_mounts.sh: executing
Mounting smb share(s)...
... mounting //192.168.10.3/...SSD
[09:27:45] INFO: ...... //192.168.10.3/...SSD successfully mounted to /mnt/....SSD with options rw,file_mode=0775,dir_mode=0775,username=j...,password=XXXXXXXXXX,nobrl,uid=0,gid=0,iocharset=utf8
/etc/cont-init.d/01-config_yaml.sh: executing
Setting permissions for the config.yaml directory
Load environment variables from /config/config.yaml if existing
If accessing the file with filebrowser it should be mapped to /addon_configs/db21ed7f_immich/config.yaml

Wiki here on how to use : github.com/alexbelgium/hassio-addons/wiki/Add‐ons-feature-:-add-env-variables
IMMICH_CONFIG_FILE='/addons_config/db21ed7f_immich/immich.json'
/etc/cont-init.d/01-custom_script.sh: executing
Execute /addon_configs/db21ed7f_immich/immich.sh if existing
Wiki here : github.com/alexbelgium/hassio-addons/wiki/Add-ons-feature-:-customisation
/etc/cont-init.d/01-migrate.sh: executing
/etc/cont-init.d/20-folders.sh: executing
[09:27:45] INFO: Setting data location
... check /share/immich folder exists
... setting permissions
... correcting official script
/etc/cont-init.d/99-run.sh: executing
[09:28:15] INFO: Exporting addon options from /data/options.json
DB_DATABASE_NAME='postgres'
DB_HOSTNAME='192.168.10.7'
DB_PASSWORD=******
DB_PORT='5432'
DB_ROOT_PASSWORD=******
DB_USERNAME='postgres'
DISABLE_MACHINE_LEARNING='false'
JWT_SECRET='jt...4w='
TZ='Europe/Paris'
cifspassword='Hiezei7s'
cifsusername='...'
data_location='/share/immich'
networkdisks='//192.168.10.3/...SSD'
192.168.10.7 is reachable.
[09:28:15] WARNING: Previous database export found at /share/postgresql_immich.tar.gz
[09:28:16] INFO: Root user exists with a non-default password. No migration needed.
[09:28:16] INFO: Setting up external PostgreSQL database...
[09:28:16] INFO: Database postgres already exists. Ensuring it is configured correctly.
DO
GRANT
[09:28:16] INFO: Database setup completed successfully.
Checking if 'vectors' extension is enabled...
✅ 'vectors' extension is enabled.
Starting the upstream container
[mod-init] Running Docker Modification Logic
[mod-init] Adding imagegenius/mods:universal-redis to container
[mod-init] Downloading imagegenius/mods:universal-redis from registry-1.docker.io
[mod-init] Installing imagegenius/mods:universal-redis
[mod-init] imagegenius/mods:universal-redis applied to container
[migrations] started
[migrations] no migrations found
╔═══════════════════════════════╗
__ _____ _____ __
/ / |_ / | / /
/ / | || | __ / /
/ / | || | |
| / /
/ / | || |__| | / /
/
/ |______
| /_/
Baseimage from linuxserver.io
╠═══════════════════════════════╣
User/Group ID:
User UID: 0
User GID: 0
╚═══════════════════════════════╝
**** permissions for /dev/dri/card0 are good ****
**** Adding redis to package install list ****
[pkg-install-init] **** Installing all mod packages ****
Hit:1 http://archive.ubuntu.com/ubuntu noble InRelease
Get:2 http://archive.ubuntu.com/ubuntu noble-updates InRelease [126 kB]
Get:3 http://apt.postgresql.org/pub/repos/apt noble-pgdg InRelease [129 kB]
Get:4 http://archive.ubuntu.com/ubuntu noble-security InRelease [126 kB]
Hit:5 http://archive.ubuntu.com/ubuntu oracular InRelease
Get:6 http://archive.ubuntu.com/ubuntu noble-updates/universe Sources [515 kB]
Get:7 http://archive.ubuntu.com/ubuntu noble-updates/main Sources [476 kB]
Get:8 http://archive.ubuntu.com/ubuntu noble-updates/universe amd64 Packages [1,318 kB]
Get:9 http://apt.postgresql.org/pub/repos/apt noble-pgdg/main amd64 Packages [500 kB]
Get:10 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages [1,100 kB]
Get:11 http://archive.ubuntu.com/ubuntu noble-security/main Sources [182 kB]
Get:12 http://archive.ubuntu.com/ubuntu noble-security/universe amd64 Packages [1,039 kB]
Get:13 http://archive.ubuntu.com/ubuntu noble-security/main amd64 Packages [778 kB]
Fetched 6,290 kB in 2s (2,543 kB/s)
Reading package lists...
W: http://apt.postgresql.org/pub/repos/apt/dists/noble-pgdg/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
libatomic1 libjemalloc2 liblzf1 redis-tools
Suggested packages:
ruby-redis
The following NEW packages will be installed:
libatomic1 libjemalloc2 liblzf1 redis-server redis-tools
0 upgraded, 5 newly installed, 0 to remove and 23 not upgraded.
Need to get 1,491 kB of archives.
After this operation, 7,608 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 libatomic1 amd64 14.2.0-4ubuntu224.04 [10.5 kB]
Get:2 http://archive.ubuntu.com/ubuntu noble/universe amd64 libjemalloc2 amd64 5.3.0-2build1 [256 kB]
Get:3 http://archive.ubuntu.com/ubuntu noble/universe amd64 liblzf1 amd64 3.6-4 [7,624 B]
Get:4 http://archive.ubuntu.com/ubuntu noble/universe amd64 redis-tools amd64 5:7.0.15-1build2 [1,165 kB]
Get:5 http://archive.ubuntu.com/ubuntu noble/universe amd64 redis-server amd64 5:7.0.15-1build2 [51.7 kB]
Fetched 1,491 kB in 1s (1,662 kB/s)
Selecting previously unselected package libatomic1:amd64.
(Reading database ...
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 23546 files and directories currently installed.)
Preparing to unpack .../libatomic1_14.2.0-4ubuntu2
24.04_amd64.deb ...
Unpacking libatomic1:amd64 (14.2.0-4ubuntu224.04) ...
Selecting previously unselected package libjemalloc2:amd64.
Preparing to unpack .../libjemalloc2_5.3.0-2build1_amd64.deb ...
Unpacking libjemalloc2:amd64 (5.3.0-2build1) ...
Selecting previously unselected package liblzf1:amd64.
Preparing to unpack .../liblzf1_3.6-4_amd64.deb ...
Unpacking liblzf1:amd64 (3.6-4) ...
Selecting previously unselected package redis-tools.
Preparing to unpack .../redis-tools_5%3a7.0.15-1build2_amd64.deb ...
Unpacking redis-tools (5:7.0.15-1build2) ...
Selecting previously unselected package redis-server.
Preparing to unpack .../redis-server_5%3a7.0.15-1build2_amd64.deb ...
Unpacking redis-server (5:7.0.15-1build2) ...
Setting up libjemalloc2:amd64 (5.3.0-2build1) ...
Setting up liblzf1:amd64 (3.6-4) ...
Setting up libatomic1:amd64 (14.2.0-4ubuntu2
24.04) ...
Setting up redis-tools (5:7.0.15-1build2) ...
Setting up redis-server (5:7.0.15-1build2) ...
invoke-rc.d: could not determine current runlevel
invoke-rc.d: policy-rc.d denied execution of start.
Processing triggers for libc-bin (2.39-0ubuntu8.4) ...
[custom-init] No custom files found, skipping...
Starting api worker
[Nest] 1408 - 02/23/2025, 9:28:55 AM LOG [Api:EventRepository] Initialized websocket server
[Nest] 1408 - 02/23/2025, 9:28:55 AM ERROR [Api:ServerService] Unable to load configuration file: /addons_config/db21ed7f_immich/immich.json
[Nest] 1408 - 02/23/2025, 9:28:55 AM ERROR [Api:ServerService] Error: ENOENT: no such file or directory, open '/addons_config/db21ed7f_immich/immich.json'
at async open (node:internal/fs/promises:639:25)
at async readFile (node:internal/fs/promises:1246:14)
at async loadFromFile (/app/immich/server/dist/utils/config.js:90:22)
at async buildConfig (/app/immich/server/dist/utils/config.js:103:11)
at async /app/immich/server/dist/utils/config.js:63:26 {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/addons_config/db21ed7f_immich/immich.json'
}
Error: ENOENT: no such file or directory, open '/addons_config/db21ed7f_immich/immich.json'
at async open (node:internal/fs/promises:639:25)
at async readFile (node:internal/fs/promises:1246:14)
at async loadFromFile (/app/immich/server/dist/utils/config.js:90:22)
at async buildConfig (/app/immich/server/dist/utils/config.js:103:11)
at async /app/immich/server/dist/utils/config.js:63:26 {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/addons_config/db21ed7f_immich/immich.json'
}

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