Immich: Difference between revisions

34j (talk | contribs)
Tea (talk | contribs)
m fix missing closing pointy bracket in placeholder
 
(2 intermediate revisions by 2 users not shown)
Line 9: Line 9:
{{file|/etc/nixos/configuration.nix|nix|3=services.immich.host = "0.0.0.0";
{{file|/etc/nixos/configuration.nix|nix|3=services.immich.host = "0.0.0.0";
services.immich.openFirewall = true;}}
services.immich.openFirewall = true;}}
More options are available: {{nixos:option|services.immich.}}  
 
To change Immich’s default log verbosity, you can set the [https://docs.immich.app/install/environment-variables#general <code>IMMICH_LOG_LEVEL</code>] environment variable:
{{file|/etc/nixos/configuration.nix|nix|3=services.immich.environment.IMMICH_LOG_LEVEL = "warn";}}
More options are available: {{nixos:option|services.immich.}}


== Tips and Tricks ==
== Tips and Tricks ==
=== Reducing Log Verbosity Of Redis ===
As noted in the [https://docs.immich.app/FAQ/#how-can-i-reduce-the-log-verbosity-of-redis Immich FAQ], you can reduce Redis log verbosity by setting the log level to warning. In NixOS this is done with the [https://search.nixos.org/options?show=services.redis.servers.%3Cname%3E.logLevel log Level option] of the Redis server that Immich uses:
{{file|/etc/nixos/configuration.nix|nix|3=services.redis.servers.immich.logLevel = "warning";}}
{{info|Valid log levels for Redis are <code>debug</code>, <code>verbose</code>, <code>notice</code>, and <code>warning</code>.}}


=== Custom Media Location ===
=== Custom Media Location ===
Line 67: Line 77:
   };
   };
};|name=/etc/nixos/configuration.nix|lang=nix}}
};|name=/etc/nixos/configuration.nix|lang=nix}}
Make sure to manually create a borg repo at the desired location beforehand with <code>sudo borg init --encryption=none <path-to-borg-repo</code>
Make sure to manually create a borg repo at the desired location beforehand with <code>sudo borg init --encryption=none <path-to-borg-repo></code>


== Troubleshooting ==
== Troubleshooting ==


=== Fixing postgresql database issue after 25.05 upgrade ===
=== Fixing PostgreSQL database issue after 25.05 upgrade ===


==== Postgresql collation version mismatch ====
==== PostgreSQL collation version mismatch ====
After upgrading you might run into an issue like this, leading to immich-server continuously failing and restarting: <syntaxhighlight>Jul 01 14:23:12 server2 immich[178592]: Postgres notice: {
After upgrading you might run into an issue like this, leading to immich-server continuously failing and restarting: <syntaxhighlight>Jul 01 14:23:12 server2 immich[178592]: Postgres notice: {
Jul 01 14:23:12 server2 immich[178592]:  severity_local: 'WARNING',
Jul 01 14:23:12 server2 immich[178592]:  severity_local: 'WARNING',
Line 88: Line 98:
REINDEX DATABASE immich;
REINDEX DATABASE immich;
</syntaxhighlight>
</syntaxhighlight>
==== Upgrading pgvecto.rs ====
If you still run into issues after restarting postgresql and immich-server services, some additional postgresql database changes might be necessary to [https://web.archive.org/web/20240910231531/https://docs.pgvecto.rs/admin/upgrading.html#upgrading upgrade pgvecto.rs table]:
Run <code>sudo -u postgres psql</code> and execute consecutively:<syntaxhighlight lang="sql" line="1">
CREATE EXTENSION IF NOT EXISTS unaccent;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE EXTENSION IF NOT EXISTS vectors;
CREATE EXTENSION IF NOT EXISTS cube;
CREATE EXTENSION IF NOT EXISTS earthdistance;
CREATE EXTENSION IF NOT EXISTS pg_trgm;
ALTER EXTENSION vectors UPDATE;
SELECT pgvectors_upgrade();
</syntaxhighlight>Finally, restart postgresql and immich: <code>systemctl restart postgresql && systemctl restart immich-server</code>


=== Immich server too old on NixOS stable ===
=== Immich server too old on NixOS stable ===