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

[BUG] After shutting down the container and restarting I often find my darktable DB locked #13

Closed
1 task done
ovizii opened this issue Feb 20, 2024 · 10 comments
Closed
1 task done
Assignees

Comments

@ovizii
Copy link

ovizii commented Feb 20, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I start the container, work with it, end my work with a docker compose down and when I restart the container I see an error:

image

Expected Behavior

The DB locks should be removed when doing a docker compose down

Steps To Reproduce

Please see "current behaviour".

Environment

- OS:Debian bookworm
- How docker service was installed: via Docker's apt repository

CPU architecture

x86-64

Docker creation

services:

# github.com/linuxserver/docker-darktable

  darktable:
    image: lscr.io/linuxserver/darktable:latest
    container_name: darktable
    hostname: darktable
    security_opt:
      - seccomp:unconfined #optional
    networks:
      darktable:
        ipv4_address: 192.168.192.98
      traefik_darktable:
#    mac_address: replace
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Berlin
      - DOCKER_MODS=linuxserver/mods:universal-git
    volumes:
      - ./config:/config
    ports:
      - 3000:3000
      - 3001:3001
    restart: "no"
    labels:
      # enable Traefik
      - "traefik.enable=true"
      # Network
      - "traefik.docker.network=traefik_darktable"
      # Router
      - "traefik.http.routers.darktable.tls=true"
      - "traefik.http.routers.darktable.entrypoints=websecure"
      - "traefik.http.routers.darktable.rule=Host(`photography.domain.tld`)"
      - "traefik.http.routers.darktable.middlewares=darktable-headers,localIPsOnly@file,authentik@docker"
      - "traefik.http.routers.darktable.service=darktable"
      # Middleware
      # copying default headers, special headers later
      - "traefik.http.middlewares.darktable-headers.headers.browserXssFilter=true"
      - "traefik.http.middlewares.darktable-headers.headers.contentTypeNosniff=true"
      - "traefik.http.middlewares.darktable-headers.headers.frameDeny=false"
      - "traefik.http.middlewares.darktable-headers.headers.stsIncludeSubdomains=true"
      - "traefik.http.middlewares.darktable-headers.headers.stsPreload=true"
      - "traefik.http.middlewares.darktable-headers.headers.stsSeconds=31536000"
      - "traefik.http.middlewares.darktable-headers.headers.customFrameOptionsValue=SAMEORIGIN"
      - "traefik.http.middlewares.darktable-headers.headers.customRequestHeaders.Cache-Control=no-cache, no-store, must-revalidate"
      - "traefik.http.middlewares.darktable-headers.headers.customResponseHeaders.Cache-Control=no-cache, no-store, must-revalidate"
      - "traefik.http.middlewares.darktable-headers.headers.contentSecurityPolicy=default-src https: data: wss: blob: 'self' 'unsafe-inline' 'unsafe-eval' *>
      - "traefik.http.middlewares.darktable-headers.headers.referrerPolicy=same-origin"
      # specific headers for lossless VNC connection see: https://www.kasmweb.com/docs/latest/how_to/lossless.html#technical-background
      - "traefik.http.middlewares.darktable-headers.headers.customRequestHeaders.Cross-Origin-Embedder-Policy=require-corp"
      - "traefik.http.middlewares.darktable-headers.headers.customRequestHeaders.Cross-Origin-Opener-Policy=same-origin"
      - "traefik.http.middlewares.darktable-headers.headers.customRequestHeaders.Cross-Origin-Resource-Policy=same-site"
      # Service
      - "traefik.http.services.darktable.loadbalancer.server.port=3000"
      - "traefik.http.services.darktable.loadbalancer.server.scheme=http"



networks:

  darktable:
    name: darktable
    driver: macvlan
    ipam:
      config:
        - subnet: 192.168.192.96/30
          gateway: 192.168.192.97
    driver_opts:
      parent: vmbr1.1022
    external: false


  traefik_darktable:
    external: true
    internal: true
    name: traefik_darktable

Container logs

docker compose logs -f
...
...
...
darktable  | glx: failed to create drisw screen
darktable  | failed to load driver: zink
darktable  |      0.1126 [init] the database lock file contains a pid that seems to be alive in your system: 358
darktable  |      0.1126 [init] database is locked, probably another process is already using it
darktable  |      0.1126 [dt_init] trying to open the images in the running instance
@ovizii
Copy link
Author

ovizii commented Feb 20, 2024

A most probably related issue I observed is that none of the changed preferences within darktable are saved.

i.e. access darktable, go to preferences and change the theme or the language. Do a docker compose down followed by a docker compose up -d and see that none of the changed preferences was saved.

@LinuxServer-CI
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

@ovizii
Copy link
Author

ovizii commented Mar 22, 2024

This might be due to missing feedback from OP.

Let me laugh a little about that. Here is OP's feedback. Still waiting for any reaction :-)

@j0nnymoe
Copy link
Member

What's your full path for your /config mount?

@ovizii
Copy link
Author

ovizii commented Mar 23, 2024

My compose stacks are inside /sgate18TB01/docker within one folder per project, so this would make:

     volumes:
      - ./config:/config

the same as this:

    volumes:
      - /sgate18TB01/docker/darktable/config:/config

I hope this answers the question.

@homerr homerr self-assigned this Apr 6, 2024
@homerr
Copy link
Member

homerr commented Apr 6, 2024

I've been trying to reproduce this, but cannot... I'd recommend not doing a docker compose down whenever you are finished with the container. If you are tight on resources it may be better to do a docker compose stop in stead (which should really do the same thing, in theory)

Are there any specific processes you are doing before this happens when you stop the container? Is there the potential a longer running process is going on in the background? What kind of resource does the system have?

@homerr homerr closed this as completed Apr 6, 2024
@LinuxServer-CI LinuxServer-CI moved this from Issues to Done in Issue & PR Tracker Apr 6, 2024
@homerr homerr reopened this Apr 6, 2024
@LinuxServer-CI LinuxServer-CI moved this from Done to Issues in Issue & PR Tracker Apr 6, 2024
@ovizii
Copy link
Author

ovizii commented Apr 6, 2024

Thanks for looking into this. I have long tried to get a photo editor working via docker, so I am just testing this image. I created a compose file, fired it up, had a look around the GUI, changed some settings, did a docker compose down to do some cosmetic changes to my compose file and was surprised by the above error when starting it up again.

I'll try to give the default compose file a go these days, just to make sure it's not related to my compose file somehow.

@homerr
Copy link
Member

homerr commented Apr 7, 2024

Fair enough, give it a go and let us know if you have any further experiences with this. I can't get it to break and I've put some pictures in my test instance/edited them etc and then actively tried to break the container by closing things etc.

If it plays up come visit us in discord.

@homerr homerr closed this as completed Apr 7, 2024
@LinuxServer-CI LinuxServer-CI moved this from Issues to Done in Issue & PR Tracker Apr 7, 2024
@ovizii
Copy link
Author

ovizii commented Apr 16, 2024

Very weird. I tested with the minimal compose file further down on this page: https://github.com/linuxserver/docker-darktable

The only changes I had to make to that were changing the volume to be a relative path:

    volumes:
      - ./config:/config

and change the ports as 3000/3001 are already in use so it now reads:

    ports:
      - 3010:3000
      - 3011:3001
  • I do a docker compose up -d
  • access via GUI
  • go to settings, general, change the theme to a darker one
  • close the settings
  • do a docker compose down OR a docker compose stop (it didn't make any difference in my test)
  • follow that up with a docker compose up -d
  • most of the time, I get a warning by darktable about the DB files being locked, I can then unlock them and have to restart the containers after which I can again access the darktable GUI
  • access the GUI and the theme is back to default and NOT the one I selected

Just documenting the last test with your sample docker-compsoe.yml file. Will reach out via discord.

@ovizii
Copy link
Author

ovizii commented Jun 19, 2024

I just wanted to add that we had taken this issue into the linuxserver Discord, and it was solved there.

I quote:

Looks like Darktable on saves its settings on clean exit not on sigterm. You would have to close the app to save your settings. it also does not clear locks consitently on sigterm

Solution for the saving of settings:

Close Darktable by clicking on the X (top, right) then right-click the black screen and open Darktable again.

Solution for the locked DB:

add this to your autostart file in you home directory
/config/.config/openbox/autostart
https://github.com/linuxserver/docker-darktable/pull/14/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

4 participants