Skip to content

Latest version fails to start #672

Open

Description

@jcasarini

Hi, I just pulled the latest version and it won't start, rolling back to 0.43 works fine, I was running 0.41 before trying to upgrade.

Getting this error in the logs:

lightnvr  | [INFO] Initializing LightNVR configuration...
lightnvr  | [INFO] Creating directory structure...
lightnvr  | [INFO] Directory already exists: /etc/lightnvr
lightnvr  | [INFO] Directory already exists: /var/lib/lightnvr/data
lightnvr  | [INFO] Directory already exists: /var/lib/lightnvr/data/recordings
lightnvr  | [INFO] Directory already exists: /var/lib/lightnvr/data/recordings/mp4
lightnvr  | [INFO] Directory already exists: /var/lib/lightnvr/data/database
lightnvr  | [INFO] Directory already exists: /var/lib/lightnvr/data/models
lightnvr  | [INFO] Directory already exists: /var/log/lightnvr
lightnvr  | [INFO] Verifying web assets at /var/lib/lightnvr/www
lightnvr  | [INFO] Web assets present.
lightnvr  | [INFO] Configuration file already exists at /etc/lightnvr/lightnvr.ini
lightnvr  | /usr/local/bin/docker-entrypoint.sh: 207: cannot create /etc/lightnvr/go2rtc/go2rtc.yaml: Permission denied
lightnvr  | [INFO] Creating default go2rtc configuration...
lightnvr exited with code 2 (restarting)

Ran into the same issue on a second instance.

Let me know if you need any more data about it.

Joaquin

Activity

  1. TeeCodeDev commented on Oct 24, 2026

    @TeeCodeDev

    yes, second this. Same error!

  2. matteius commented on Oct 25, 2026

    @matteius
    Contributor

    The likely cause is the 0.44.0 switch to UID:GID 10001:10001. Existing volumes owned by root are no longer writable, so startup fails when creating /etc/lightnvr/go2rtc/go2rtc.yaml. The Dockerfile’s ownership changes cannot fix existing mounted volumes.

    The documented migration is to:

    • Stop the container and back up its data.
    • Change ownership of the dedicated LightNVR config/data/log directories to 10001:10001, preserving file permissions.
    • Update any old pid_file = /var/run/lightnvr.pid setting to /var/run/lightnvr/lightnvr.pid.
    • Restart the container.

    This is covered in the migration notes, but startup checks permissions after attempting the failing write, hiding the useful migration guidance.

  3. matteius commented on Oct 25, 2026

    @matteius
    Contributor

    Thanks, Joaquin, for the startup log — the permission error on /etc/lightnvr/go2rtc/go2rtc.yaml gives us a concrete place to investigate. @TeeCodeDev, could you check whether your failure is at that same path?

    The 0.44 image runs as UID:GID 10001:10001. Our working hypothesis is that an existing config mount (or its go2rtc subdirectory/file) is not writable by that identity. The image's ownership settings do not change an existing mounted volume. This works on our deployments, but we want to confirm what differs in yours before changing the implementation.

    Could each of you share:

    1. The image tag or digest and the relevant Compose volumes: and user: lines (or equivalent deployment settings). Please redact secrets and private host paths.
    2. The output of this read-only check from the Compose directory:
      docker compose run --rm --no-deps --entrypoint sh lightnvr -c 'id; ls -ldn /etc/lightnvr /etc/lightnvr/go2rtc /etc/lightnvr/go2rtc/go2rtc.yaml /var/lib/lightnvr/data /var/log/lightnvr'
      If your service is named something other than lightnvr, substitute its name.
    3. Whether you tried the 0.44 volume migration steps, and whether the error changes afterward.

    Please do not paste the contents of lightnvr.ini or go2rtc.yaml; those may contain credentials. If the directory or file ownership confirms the hypothesis, we can improve the startup diagnostic so it reports the needed migration before attempting that write. If ownership already looks right, the mount type and these checks will help us investigate the next cause.

  4. TeeCodeDev commented on Oct 25, 2026

    @TeeCodeDev

    I have switched back to 0.43 and that works. I have changed the folder to 10001:10001.
    I have updated the unraid template to 10001:10001. Still same error.
    I have deleted the lightnvr folder so I would be created again when starting the container but that also doesn't work.

  5. matteius commented on Oct 25, 2026

    @matteius
    Contributor

    0.44.0 was the result of a CVE report that I acted on within 1-hour of report which involved the root access vulnerability that first affected PHP and then many others in the past few days, so the first release had a webRTC regression and then 0.44.1 dropped soon after, but as part of the fix it was determined best practice to not run as root user in case of future vulnerability is discovered. I do not have the issue with my containers, but if anyone can provide more details I am happy to improve the implementation further.

    Image
  6. matteius commented on Oct 25, 2026

    @matteius
    Contributor

    if /etc/lightnvr/go2rtc/ is on the host system, or maybe even in the container, it probably has a permissions issue at the /etc/lightnvr directory -- is it owned by root or a different user?

  7. eadmar commented on Oct 26, 2026

    @eadmar

    6. if /etc/lightnvr/go2rtc/ is on the host system, or maybe even in the container, it probably has a permissions issue at the /etc/lightnvr directory -- is it owned by root or a different user?

    My /etc/lightnvr/go2rtc/ is on the host system. When I tried chown to normal user and chmod 777, it set my go2rtc.yaml back to defaults. Also keeps restarting with this error:
    [INFO] Testing write permissions...
    [ERROR] No write permission: /var/lib/lightnvr/data - prepare volume ownership for UID:GID 10001:10001

    Falling back to 0.43.4, everything works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions