Invalid URL error in v1.125.1 #5196

Closed
opened 2026-02-05 11:14:15 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @suderman on GitHub (Jan 23, 2025).

The bug

Getting an "Invalid URL" error in v1.125.1. Rolled back to v1.124.2 without trouble.

My setup uses the provided Docker containers on NixOS, but intead of the provided docker-compse.yml, it's orchestrated with my own NixOS module (predates the module now available on nixpkgs):

  services.immich = {
    enable = true;
    photosDir = "/data/photos/immich";
    externalDir = "/data/photos/collections";
    alias = "immich.suderman.org"; 
  };

The OS that Immich Server is running on

NixOS

Version of Immich Server

v1.125.1

Version of Immich Mobile App

1.124.2 (n/a to this running the server)

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

{ config, lib, pkgs, ... }:

let

  cfg = config.services.immich;
  inherit (lib) mkIf;
  inherit (config.services.traefik.lib) mkAlias mkLabels;

in {

  config = mkIf cfg.enable {

    # Server back-end
    virtualisation.oci-containers.containers.immich-server = {
      image = "ghcr.io/immich-app/immich-server:v${cfg.version}";
      autoStart = false;

      # Run as immich user
      user = "${cfg.environment.PUID}:${cfg.environment.PGID}";

      # Environment variables
      environment = cfg.environment;

      # Map volumes to host
      volumes = [ 
        "/run/postgresql:/run/postgresql"
        "/run/redis-immich:/run/redis-immich"
      ] ++ [
        "${cfg.dataDir}/geocoding:/usr/src/app/geocoding"
      ] ++ [
        "${cfg.dataDir}:/usr/src/app/upload"
      ] ++ (if cfg.photosDir == "" then [] else [
        "${cfg.photosDir}:/usr/src/app/upload/library" 
      ]) ++ (if cfg.externalDir == "" then [] else [
        "${cfg.externalDir}:/external:ro" 
      ]);

      # Traefik labels
      extraOptions = mkLabels cfg.name

      # Networking for docker containers
      ++ [
        "--network=immich"
        # https://github.com/immich-app/immich/blob/main/docker/hwaccel.yml
        "--device=/dev/dri:/dev/dri" 
      ];

    };

    # Enable reverse proxy
    services.traefik = {
      enable = true;
      proxy = mkAlias cfg.name cfg.alias;
    };

    # Extend systemd service
    systemd.services.docker-immich-server = {
      requires = [ "immich.service" ];

      # Container will not stop gracefully, so kill it
      serviceConfig = {
        KillSignal = "SIGKILL";
        SuccessExitStatus = "0 SIGKILL";
      };

    };

  };

}

Your .env content

environment = mkOption { 
      description = "Shared environment across Immich services";
      type = types.anything; 
      default = {
        PUID = toString config.ids.uids.immich;
        PGID = toString config.ids.gids.immich;
        DB_URL = "socket://immich:@/run/postgresql?db=immich";
        REDIS_SOCKET = "/run/redis-immich/redis.sock";
        REVERSE_GEOCODING_DUMP_DIRECTORY = "/usr/src/app/geocoding";
      };
    };

Reproduction steps

  1. docker pull ghcr.io/immich-app/immich-server:v1.125.1
  2. sudo systemctl status docker-immich-server.service

...

Relevant log output

Jan 23 11:34:30 lux systemd[1]: Started docker-immich-server.service.
Jan 23 11:34:30 lux docker-immich-server-start[3073069]: Initializing Immich v1.125.1
Jan 23 11:34:30 lux docker-immich-server-start[3073069]: Detected CPU Cores: 8
Jan 23 11:34:32 lux docker-immich-server-start[3073069]: node:internal/url:818
Jan 23 11:34:32 lux docker-immich-server-start[3073069]:       href = bindingUrl.parse(input, base, true);
Jan 23 11:34:32 lux docker-immich-server-start[3073069]:                         ^
Jan 23 11:34:32 lux docker-immich-server-start[3073069]: TypeError: Invalid URL
Jan 23 11:34:32 lux docker-immich-server-start[3073069]:     at new URL (node:internal/url:818:25)
Jan 23 11:34:32 lux docker-immich-server-start[3073069]:     at parseUrl (/usr/src/app/node_modules/postgres/cjs/src/index.js>
Jan 23 11:34:32 lux docker-immich-server-start[3073069]:     at parseOptions (/usr/src/app/node_modules/postgres/cjs/src/inde>
Jan 23 11:34:32 lux docker-immich-server-start[3073069]:     at Postgres (/usr/src/app/node_modules/postgres/cjs/src/index.js>
Jan 23 11:34:32 lux docker-immich-server-start[3073069]:     at getEnv (/usr/src/app/dist/repositories/config.repository.js:1>
Jan 23 11:34:32 lux docker-immich-server-start[3073069]:     at ConfigRepository.getEnv (/usr/src/app/dist/repositories/confi>
Jan 23 11:34:32 lux docker-immich-server-start[3073069]:     at Object.<anonymous> (/usr/src/app/dist/app.module.js:54:56)
Jan 23 11:34:32 lux docker-immich-server-start[3073069]:     at Module._compile (node:internal/modules/cjs/loader:1562:14)
Jan 23 11:34:32 lux docker-immich-server-start[3073069]:     at Object..js (node:internal/modules/cjs/loader:1699:10)
Jan 23 11:34:32 lux docker-immich-server-start[3073069]:     at Module.load (node:internal/modules/cjs/loader:1313:32) {
Jan 23 11:34:32 lux docker-immich-server-start[3073069]:   code: 'ERR_INVALID_URL',
Jan 23 11:34:32 lux docker-immich-server-start[3073069]:   input: 'socket://immich:@/run/postgresql?db=immich'
Jan 23 11:34:32 lux docker-immich-server-start[3073069]: }
Jan 23 11:34:32 lux docker-immich-server-start[3073069]: Node.js v22.13.1
Jan 23 11:34:32 lux systemd[1]: docker-immich-server.service: Main process exited, code=exited, status=1/FAILURE

Additional information

No response

Originally created by @suderman on GitHub (Jan 23, 2025). ### The bug Getting an "Invalid URL" error in `v1.125.1`. Rolled back to `v1.124.2` without trouble. My setup uses the provided Docker containers on NixOS, but intead of the provided docker-compse.yml, it's orchestrated with my own NixOS module (predates the module now available on nixpkgs): - https://github.com/suderman/nixos/blob/main/modules/immich/nixos.nix - https://github.com/suderman/nixos/blob/main/modules/immich/immich-server.nix - https://github.com/suderman/nixos/blob/main/configurations/systems/lux/configuration.nix ```nix services.immich = { enable = true; photosDir = "/data/photos/immich"; externalDir = "/data/photos/collections"; alias = "immich.suderman.org"; }; ``` ### The OS that Immich Server is running on NixOS ### Version of Immich Server v1.125.1 ### Version of Immich Mobile App 1.124.2 (n/a to this running the server) ### Platform with the issue - [x] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML { config, lib, pkgs, ... }: let cfg = config.services.immich; inherit (lib) mkIf; inherit (config.services.traefik.lib) mkAlias mkLabels; in { config = mkIf cfg.enable { # Server back-end virtualisation.oci-containers.containers.immich-server = { image = "ghcr.io/immich-app/immich-server:v${cfg.version}"; autoStart = false; # Run as immich user user = "${cfg.environment.PUID}:${cfg.environment.PGID}"; # Environment variables environment = cfg.environment; # Map volumes to host volumes = [ "/run/postgresql:/run/postgresql" "/run/redis-immich:/run/redis-immich" ] ++ [ "${cfg.dataDir}/geocoding:/usr/src/app/geocoding" ] ++ [ "${cfg.dataDir}:/usr/src/app/upload" ] ++ (if cfg.photosDir == "" then [] else [ "${cfg.photosDir}:/usr/src/app/upload/library" ]) ++ (if cfg.externalDir == "" then [] else [ "${cfg.externalDir}:/external:ro" ]); # Traefik labels extraOptions = mkLabels cfg.name # Networking for docker containers ++ [ "--network=immich" # https://github.com/immich-app/immich/blob/main/docker/hwaccel.yml "--device=/dev/dri:/dev/dri" ]; }; # Enable reverse proxy services.traefik = { enable = true; proxy = mkAlias cfg.name cfg.alias; }; # Extend systemd service systemd.services.docker-immich-server = { requires = [ "immich.service" ]; # Container will not stop gracefully, so kill it serviceConfig = { KillSignal = "SIGKILL"; SuccessExitStatus = "0 SIGKILL"; }; }; }; } ``` ### Your .env content ```Shell environment = mkOption { description = "Shared environment across Immich services"; type = types.anything; default = { PUID = toString config.ids.uids.immich; PGID = toString config.ids.gids.immich; DB_URL = "socket://immich:@/run/postgresql?db=immich"; REDIS_SOCKET = "/run/redis-immich/redis.sock"; REVERSE_GEOCODING_DUMP_DIRECTORY = "/usr/src/app/geocoding"; }; }; ``` ### Reproduction steps 1. docker pull ghcr.io/immich-app/immich-server:v1.125.1 2. sudo systemctl status docker-immich-server.service 3. ... ### Relevant log output ```shell Jan 23 11:34:30 lux systemd[1]: Started docker-immich-server.service. Jan 23 11:34:30 lux docker-immich-server-start[3073069]: Initializing Immich v1.125.1 Jan 23 11:34:30 lux docker-immich-server-start[3073069]: Detected CPU Cores: 8 Jan 23 11:34:32 lux docker-immich-server-start[3073069]: node:internal/url:818 Jan 23 11:34:32 lux docker-immich-server-start[3073069]: href = bindingUrl.parse(input, base, true); Jan 23 11:34:32 lux docker-immich-server-start[3073069]: ^ Jan 23 11:34:32 lux docker-immich-server-start[3073069]: TypeError: Invalid URL Jan 23 11:34:32 lux docker-immich-server-start[3073069]: at new URL (node:internal/url:818:25) Jan 23 11:34:32 lux docker-immich-server-start[3073069]: at parseUrl (/usr/src/app/node_modules/postgres/cjs/src/index.js> Jan 23 11:34:32 lux docker-immich-server-start[3073069]: at parseOptions (/usr/src/app/node_modules/postgres/cjs/src/inde> Jan 23 11:34:32 lux docker-immich-server-start[3073069]: at Postgres (/usr/src/app/node_modules/postgres/cjs/src/index.js> Jan 23 11:34:32 lux docker-immich-server-start[3073069]: at getEnv (/usr/src/app/dist/repositories/config.repository.js:1> Jan 23 11:34:32 lux docker-immich-server-start[3073069]: at ConfigRepository.getEnv (/usr/src/app/dist/repositories/confi> Jan 23 11:34:32 lux docker-immich-server-start[3073069]: at Object.<anonymous> (/usr/src/app/dist/app.module.js:54:56) Jan 23 11:34:32 lux docker-immich-server-start[3073069]: at Module._compile (node:internal/modules/cjs/loader:1562:14) Jan 23 11:34:32 lux docker-immich-server-start[3073069]: at Object..js (node:internal/modules/cjs/loader:1699:10) Jan 23 11:34:32 lux docker-immich-server-start[3073069]: at Module.load (node:internal/modules/cjs/loader:1313:32) { Jan 23 11:34:32 lux docker-immich-server-start[3073069]: code: 'ERR_INVALID_URL', Jan 23 11:34:32 lux docker-immich-server-start[3073069]: input: 'socket://immich:@/run/postgresql?db=immich' Jan 23 11:34:32 lux docker-immich-server-start[3073069]: } Jan 23 11:34:32 lux docker-immich-server-start[3073069]: Node.js v22.13.1 Jan 23 11:34:32 lux systemd[1]: docker-immich-server.service: Main process exited, code=exited, status=1/FAILURE ``` ### Additional information _No response_
Author
Owner

@bo0tzz commented on GitHub (Jan 23, 2025):

The error is warning that your db url is invalid, and that is indeed the case.

@bo0tzz commented on GitHub (Jan 23, 2025): The error is warning that your db url is invalid, and that is indeed the case.
Author
Owner

@suderman commented on GitHub (Jan 23, 2025):

Thanks for pointing that out. What's the correct DB_URL syntax for Immich to use a socket connection to postgres? The documentation only has network examples.

Curious my DB_URL worked fine for over a year (since at least v1.93.3) and still works on v1.124.2 but v1.125.1 is what killed it.

@suderman commented on GitHub (Jan 23, 2025): Thanks for pointing that out. What's the correct `DB_URL` syntax for Immich to use a socket connection to postgres? The documentation only has network examples. Curious my `DB_URL` worked fine for over a year (since at least `v1.93.3`) and _still_ works on `v1.124.2` but `v1.125.1` is what killed it.
Author
Owner

@bo0tzz commented on GitHub (Jan 23, 2025):

Turns out we did change the client library actually. Tracking in #15566

@bo0tzz commented on GitHub (Jan 23, 2025): Turns out we did change the client library actually. Tracking in #15566
Author
Owner

@suderman commented on GitHub (Jan 24, 2025):

v1.125.2 fixed my socket connection. :-)

@suderman commented on GitHub (Jan 24, 2025): v1.125.2 fixed my socket connection. :-)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#5196