after each restart, all files are recreated #2

Closed
opened 2026-06-23 17:58:31 +02:00 by Griefed · 15 comments
Owner

@uFojun on GitHub · https://github.com/Griefed/docker-SUI/issues/1

  • What is the current behavior?

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

  • What is the expected behavior?

  • What is the motivation / use case for changing the behavior?

  • Please tell us about your environment:

    • Docker Image: griefed/image:tag e.g. griefed/d-zone:proxy
    • docker & docker-compose Version: Use docker version && docker-compose version
Client: Docker Engine - Community
 Version:           19.03.13
 API version:       1.40
 Go version:        go1.13.15
 Git commit:        4484c46d9d
 Built:             Wed Sep 16 17:02:52 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.13
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       4484c46d9d
  Built:            Wed Sep 16 17:01:20 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.3.7
  GitCommit:        8fba4e9a7d01810a393d5d25a3621dc101981175
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683
docker-compose version 1.25.0, build unknown
docker-py version: 4.1.0
CPython version: 3.8.5
OpenSSL version: OpenSSL 1.1.1f  31 Mar 2020
  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)
<!-- repoman:origin --> > **@uFojun** on **GitHub** · https://github.com/Griefed/docker-SUI/issues/1 * **What is the current behavior?** * **If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem** * **What is the expected behavior?** * **What is the motivation / use case for changing the behavior?** * **Please tell us about your environment:** - Docker Image: griefed/image:tag e.g. griefed/d-zone:proxy - docker & docker-compose Version: Use `docker version && docker-compose version` ``` Client: Docker Engine - Community Version: 19.03.13 API version: 1.40 Go version: go1.13.15 Git commit: 4484c46d9d Built: Wed Sep 16 17:02:52 2020 OS/Arch: linux/amd64 Experimental: false Server: Docker Engine - Community Engine: Version: 19.03.13 API version: 1.40 (minimum version 1.12) Go version: go1.13.15 Git commit: 4484c46d9d Built: Wed Sep 16 17:01:20 2020 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.3.7 GitCommit: 8fba4e9a7d01810a393d5d25a3621dc101981175 runc: Version: 1.0.0-rc10 GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd docker-init: Version: 0.18.0 GitCommit: fec3683 docker-compose version 1.25.0, build unknown docker-py version: 4.1.0 CPython version: 3.8.5 OpenSSL version: OpenSSL 1.1.1f 31 Mar 2020 ``` - Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ] * **Other information** (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)
Author
Owner

@Griefed on GitHub

What's the configuration you're starting the container with? Docker-compose?
How did you map the volume for the container? If the files are always recreated whenever you restart the container, it may be due to a incorrect mapping of the volume where the data is stored to.

<!-- repoman:origin --> > **@Griefed** on **GitHub** What's the configuration you're starting the container with? Docker-compose? How did you map the volume for the container? If the files are always recreated whenever you restart the container, it may be due to a incorrect mapping of the volume where the data is stored to.
Author
Owner

@uFojun on GitHub

the data is mapped, I can edit it on the host machine - everything is ok.
But as soon as I do restart or down of the container. All data in volume is overwritten with new files
my docker-compose (default)
version: "2"
services:
sui:
image: griefed/sui:latest
container_name: sui
restart: unless-stopped
environment:
- TZ=Europe/Minsk
- PUID=1005
- PROTOCOL=https
- PGID=100
- DOMAIN=my domain
volumes:
-./config:/config
ports:
- 443:443/tcp # https
- 80:80/tcp # http

<!-- repoman:origin --> > **@uFojun** on **GitHub** the data is mapped, I can edit it on the host machine - everything is ok. But as soon as I do restart or down of the container. All data in volume is overwritten with new files my docker-compose (default) version: "2" services: sui: image: griefed/sui:latest container_name: sui restart: unless-stopped environment: - TZ=Europe/Minsk - PUID=1005 - PROTOCOL=https - PGID=100 - DOMAIN=my domain volumes: -./config:/config ports: - 443:443/tcp # https - 80:80/tcp # http
Author
Owner

@uFojun on GitHub

WARNING: The Docker Engine you're using is running in swarm mode.

Compose does not use swarm mode to deploy services to multiple nodes in a swarm. All containers will be scheduled on the current node.

To deploy your application across the swarm, use docker stack deploy.

Creating sui ... done
Attaching to sui
sui | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
sui | [s6-init] ensuring user provided files have correct perms...exited 0.
sui | [fix-attrs.d] applying ownership & permissions fixes...
sui | [fix-attrs.d] done.
sui | [cont-init.d] executing container initialization scripts...
sui | [cont-init.d] 01-envfile: executing...
sui | [cont-init.d] 01-envfile: exited 0.
sui | [cont-init.d] 10-adduser: executing...
sui |
sui | -------------------------------------
sui | _ ()
sui | | | ___ _ __
sui | | | / | | | / \
sui | | | _
\ | | | () |
sui | || |
/ || __/
sui |
sui |
sui | Brought to you by linuxserver.io
sui | -------------------------------------
sui |
sui | To support LSIO projects visit:
sui | https://www.linuxserver.io/donate/
sui | -------------------------------------
sui | GID/UID
sui | -------------------------------------
sui |
sui | User uid: 1005
sui | User gid: 100
sui | -------------------------------------
sui |
sui | [cont-init.d] 10-adduser: exited 0.
sui | [cont-init.d] 20-config: executing...
sui | [cont-init.d] 20-config: exited 0.
sui | [cont-init.d] 30-install: executing...
sui | **** Installing SUI ****
sui | rm: cannot remove '/config/www/assets': Is a directory
sui | Cloning into '/tmp/sui'...
sui | [cont-init.d] 30-install: exited 0.
sui | [cont-init.d] 30-keygen: executing...
sui | using keys found in /config/keys
sui | [cont-init.d] 30-keygen: exited 0.
sui | [cont-init.d] 40-config: executing...
sui | [cont-init.d] 40-config: exited 0.
sui | [cont-init.d] 99-custom-files: executing...
sui | [custom-init] no custom files found exiting...
sui | [cont-init.d] 99-custom-files: exited 0.
sui | [cont-init.d] done.
sui | [services.d] starting services
sui | [services.d] done.

<!-- repoman:origin --> > **@uFojun** on **GitHub** WARNING: The Docker Engine you're using is running in swarm mode. Compose does not use swarm mode to deploy services to multiple nodes in a swarm. All containers will be scheduled on the current node. To deploy your application across the swarm, use `docker stack deploy`. Creating sui ... done Attaching to sui sui | [s6-init] making user provided files available at /var/run/s6/etc...exited 0. sui | [s6-init] ensuring user provided files have correct perms...exited 0. sui | [fix-attrs.d] applying ownership & permissions fixes... sui | [fix-attrs.d] done. sui | [cont-init.d] executing container initialization scripts... sui | [cont-init.d] 01-envfile: executing... sui | [cont-init.d] 01-envfile: exited 0. sui | [cont-init.d] 10-adduser: executing... sui | sui | ------------------------------------- sui | _ () sui | | | ___ _ __ sui | | | / __| | | / \ sui | | | \__ \ | | | () | sui | |_| |___/ |_| \__/ sui | sui | sui | Brought to you by linuxserver.io sui | ------------------------------------- sui | sui | To support LSIO projects visit: sui | https://www.linuxserver.io/donate/ sui | ------------------------------------- sui | GID/UID sui | ------------------------------------- sui | sui | User uid: 1005 sui | User gid: 100 sui | ------------------------------------- sui | sui | [cont-init.d] 10-adduser: exited 0. sui | [cont-init.d] 20-config: executing... sui | [cont-init.d] 20-config: exited 0. sui | [cont-init.d] 30-install: executing... sui | **** Installing SUI **** sui | rm: cannot remove '/config/www/assets': Is a directory sui | Cloning into '/tmp/sui'... sui | [cont-init.d] 30-install: exited 0. sui | [cont-init.d] 30-keygen: executing... sui | using keys found in /config/keys sui | [cont-init.d] 30-keygen: exited 0. sui | [cont-init.d] 40-config: executing... sui | [cont-init.d] 40-config: exited 0. sui | [cont-init.d] 99-custom-files: executing... sui | [custom-init] no custom files found exiting... sui | [cont-init.d] 99-custom-files: exited 0. sui | [cont-init.d] done. sui | [services.d] starting services sui | [services.d] done.
Author
Owner

@uFojun on GitHub

Description: Debian GNU/Linux 10 (buster)
Debian 5.10.13-1~bpo10+1 (2021-02-11) x86_64 GNU/Linux

Docker version 20.10.6, build 370c289
docker-compose version 1.25.4, build 8d51620a

<!-- repoman:origin --> > **@uFojun** on **GitHub** Description: Debian GNU/Linux 10 (buster) Debian 5.10.13-1~bpo10+1 (2021-02-11) x86_64 GNU/Linux Docker version 20.10.6, build 370c289 docker-compose version 1.25.4, build 8d51620a
Author
Owner

@Griefed on GitHub

Thanks for providing this additional information. I'll look into it and try to figure out why this is happening to you. I have a suspicion that this behaviour is due to you running in Swarm Mode, but I am not quite sure, because I not fully familiar with Swarm Mode. I'll see what I can do and get back to you. 🙂

<!-- repoman:origin --> > **@Griefed** on **GitHub** Thanks for providing this additional information. I'll look into it and try to figure out why this is happening to you. I have a suspicion that this behaviour is due to you running in Swarm Mode, but I am not quite sure, because I not fully familiar with Swarm Mode. I'll see what I can do and get back to you. 🙂
Author
Owner

@uFojun on GitHub

Yes, this host is added to swarm, but I'm not running through swarm. Therefore, there is this warning. At the moment, I am deploying it locally on my laptop to exclude this assumption.
Thank you also for your prompt reply. It is very pleasant and important.

<!-- repoman:origin --> > **@uFojun** on **GitHub** Yes, this host is added to swarm, but I'm not running through swarm. Therefore, there is this warning. At the moment, I am deploying it locally on my laptop to exclude this assumption. Thank you also for your prompt reply. It is very pleasant and important.
Author
Owner

@uFojun on GitHub

I see in this repository you have it in cont-init.d / 40-config
if [! -a /config/www/apps.json];
and here
https://github.com/Griefed/docker-App-Collection/blob/main/root/etc/cont-init.d/40-config
if [ ! -f /config/www/apps.json ];

this is not critical?

<!-- repoman:origin --> > **@uFojun** on **GitHub** I see in this repository you have it in cont-init.d / 40-config if [**! -a** /config/www/apps.json]; and here https://github.com/Griefed/docker-App-Collection/blob/main/root/etc/cont-init.d/40-config if [ **! -f** /config/www/apps.json ]; this is not critical?
Author
Owner

@Griefed on GitHub

I've tried reproducing your issue (albeit not in a swarm environment, as I don't have one) and am having at least similar log output:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing...
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing...

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/


Brought to you by linuxserver.io
-------------------------------------

To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    1003
User gid:    998
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-config: executing...
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-install: executing...
**** Installing SUI  ****
rm: cannot remove '/config/www/assets': Is a directory
Cloning into '/tmp/sui'...
[cont-init.d] 30-install: exited 0.
[cont-init.d] 30-keygen: executing...
using keys found in /config/keys
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 40-config: executing...
[cont-init.d] 40-config: exited 0.
[cont-init.d] 99-custom-files: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.

The troublesome lines are

**** Installing SUI  ****
rm: cannot remove '/config/www/assets': Is a directory

as they should only be displayed if the sui.lock file could not be found within /config/www/ inside the container. Thing is, said file is there but the container can't seem to find it, which is most troubling to say the least.

root/etc/cont-init.d/30-install checks for existence of sui.lock via [ ! -a /config/www/sui.lock ]. That means the code inside that block should only be executed if said file does not exist, yet it enters the block even if it exists.

That would explain why your files vanish everytime you restart the container. The container wants to re-install the software even though it is not supposed to.

lolwhoops.

<!-- repoman:origin --> > **@Griefed** on **GitHub** I've tried reproducing your issue (albeit not in a swarm environment, as I don't have one) and am having at least similar log output: ``` [s6-init] making user provided files available at /var/run/s6/etc...exited 0. [s6-init] ensuring user provided files have correct perms...exited 0. [fix-attrs.d] applying ownership & permissions fixes... [fix-attrs.d] done. [cont-init.d] executing container initialization scripts... [cont-init.d] 01-envfile: executing... [cont-init.d] 01-envfile: exited 0. [cont-init.d] 10-adduser: executing... ------------------------------------- _ () | | ___ _ __ | | / __| | | / \ | | \__ \ | | | () | |_| |___/ |_| \__/ Brought to you by linuxserver.io ------------------------------------- To support LSIO projects visit: https://www.linuxserver.io/donate/ ------------------------------------- GID/UID ------------------------------------- User uid: 1003 User gid: 998 ------------------------------------- [cont-init.d] 10-adduser: exited 0. [cont-init.d] 20-config: executing... [cont-init.d] 20-config: exited 0. [cont-init.d] 30-install: executing... **** Installing SUI **** rm: cannot remove '/config/www/assets': Is a directory Cloning into '/tmp/sui'... [cont-init.d] 30-install: exited 0. [cont-init.d] 30-keygen: executing... using keys found in /config/keys [cont-init.d] 30-keygen: exited 0. [cont-init.d] 40-config: executing... [cont-init.d] 40-config: exited 0. [cont-init.d] 99-custom-files: executing... [custom-init] no custom files found exiting... [cont-init.d] 99-custom-files: exited 0. [cont-init.d] done. [services.d] starting services [services.d] done. ``` The troublesome lines are ``` **** Installing SUI **** rm: cannot remove '/config/www/assets': Is a directory ``` as they should only be displayed if the `sui.lock` file could not be found within `/config/www/` inside the container. Thing is, said file *is there* but the container can't seem to find it, which is most troubling to say the least. `root/etc/cont-init.d/30-install` checks for existence of `sui.lock` via [ ! -a /config/www/sui.lock ]. That means the code inside that block should only be executed if said file *does not* exist, yet it enters the block even if it exists. That would explain why your files vanish everytime you restart the container. The container wants to re-install the software even though it is not supposed to. lolwhoops.
Author
Owner

@Griefed on GitHub

Sorry for closing your issue. It appears pull requests can close issues all by themselves. I did not know that.

Anyway.

I have implemented a change which appears to have fixed the issue you reported.

Recreating sui ... done
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing...
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing...

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/


Brought to you by linuxserver.io
-------------------------------------

To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    1003
User gid:    998
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-config: executing...
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-install: executing...
[cont-init.d] 30-install: exited 0.
[cont-init.d] 30-keygen: executing...
using keys found in /config/keys
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 40-config: executing...
[cont-init.d] 40-config: exited 0.
[cont-init.d] 99-custom-files: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.

Looks good!
Try pulling the latest image again, or 1.0.2, and see whether this fixed your issue. 😊

<!-- repoman:origin --> > **@Griefed** on **GitHub** Sorry for closing your issue. It appears pull requests can close issues all by themselves. I did not know that. Anyway. I have implemented a change which appears to have fixed the issue you reported. ``` Recreating sui ... done [s6-init] making user provided files available at /var/run/s6/etc...exited 0. [s6-init] ensuring user provided files have correct perms...exited 0. [fix-attrs.d] applying ownership & permissions fixes... [fix-attrs.d] done. [cont-init.d] executing container initialization scripts... [cont-init.d] 01-envfile: executing... [cont-init.d] 01-envfile: exited 0. [cont-init.d] 10-adduser: executing... ------------------------------------- _ () | | ___ _ __ | | / __| | | / \ | | \__ \ | | | () | |_| |___/ |_| \__/ Brought to you by linuxserver.io ------------------------------------- To support LSIO projects visit: https://www.linuxserver.io/donate/ ------------------------------------- GID/UID ------------------------------------- User uid: 1003 User gid: 998 ------------------------------------- [cont-init.d] 10-adduser: exited 0. [cont-init.d] 20-config: executing... [cont-init.d] 20-config: exited 0. [cont-init.d] 30-install: executing... [cont-init.d] 30-install: exited 0. [cont-init.d] 30-keygen: executing... using keys found in /config/keys [cont-init.d] 30-keygen: exited 0. [cont-init.d] 40-config: executing... [cont-init.d] 40-config: exited 0. [cont-init.d] 99-custom-files: executing... [custom-init] no custom files found exiting... [cont-init.d] 99-custom-files: exited 0. [cont-init.d] done. [services.d] starting services [services.d] done. ``` Looks good! Try pulling the latest image again, or 1.0.2, and see whether this fixed your issue. 😊
Author
Owner

@uFojun on GitHub

Alas, everything also rewrites apps.json

can change here?
https://github.com/Griefed/docker-SUI/blob/lsiobase/nginx/root/etc/cont-init.d/40-config

! -a on ! -f

p.s: and so YES!
the current error is gone
"rm: cannot remove '/config/www/assets': Is a directory"

<!-- repoman:origin --> > **@uFojun** on **GitHub** Alas, everything also rewrites apps.json can change here? https://github.com/Griefed/docker-SUI/blob/lsiobase/nginx/root/etc/cont-init.d/40-config ! -a on ! -f p.s: and so YES! the current error is gone "rm: cannot remove '/config/www/assets': Is a directory"
Author
Owner

@Griefed on GitHub

Oh, so the error regarding rm: cannot remove '/config/www/assets': Is a directory is gone, but apps.json, links.json & index.html are still being replaced with their defaults?
Alrighty, I'll take another look. I have a suspicion where the error lies already.

<!-- repoman:origin --> > **@Griefed** on **GitHub** Oh, so the error regarding `rm: cannot remove '/config/www/assets': Is a directory` is gone, but `apps.json`, `links.json` & `index.html` are still being replaced with their defaults? Alrighty, I'll take another look. I have a suspicion where the error lies already.
Author
Owner

@uFojun on GitHub

Yes, that is right

<!-- repoman:origin --> > **@uFojun** on **GitHub** Yes, that is right
Author
Owner

@Griefed on GitHub

Right, please try again with latest or 1.0.3 as I've changed the checks for the affected three files and added some log output with github.com/Griefed/docker-SUI@33349382ca

<!-- repoman:origin --> > **@Griefed** on **GitHub** Right, please try again with latest or 1.0.3 as I've changed the checks for the affected three files and added some log output with https://github.com/Griefed/docker-SUI/commit/33349382cadb45577a2823b6364f9985add91fe3
Author
Owner

@uFojun on GitHub

!!!!Everything works now 1.0.3 !!!!!
Cool
Thank you
For the support.
Will put things in order and beauty at home

<!-- repoman:origin --> > **@uFojun** on **GitHub** !!!!Everything works now 1.0.3 !!!!! Cool Thank you For the support. Will put things in order and beauty at home
Author
Owner

@Griefed on GitHub

Awesome! Glad to hear that it works now! Sorry for the trouble you had to go through. 😅 But thank you for reporting this issue to me.

Have a good one and have fun. :)
I'll close this issue now.

<!-- repoman:origin --> > **@Griefed** on **GitHub** Awesome! Glad to hear that it works now! Sorry for the trouble you had to go through. 😅 But thank you for reporting this issue to me. Have a good one and have fun. :) I'll close this issue now.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Griefed/docker-SUI#2
No description provided.