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

Warning since last update #14

Closed
speendo opened this issue Mar 8, 2022 · 28 comments
Closed

Warning since last update #14

speendo opened this issue Mar 8, 2022 · 28 comments

Comments

@speendo
Copy link

speendo commented Mar 8, 2022

Since my recent pull I get these Warnings in Mainsail

image

I couldn't tack down the source of this message but I think that they are again imposed by recent changes in Moonraker.

@mkuf
Copy link
Owner

mkuf commented Mar 8, 2022

These warnings were introduced with Arksine/moonraker@3a384e6.

Looking at the underlying function, it seems that Moonraker gets these paths from klippy via the socket and there currently is no way of overwriting these locations within moonraker.cfg.

https://github.com/Arksine/moonraker/blob/0d93cf2c398e0ef0b1ff9dc98f81bc30d4804aec/moonraker/components/file_manager/file_manager.py#L131-L138

-Markus

@mkuf mkuf closed this as completed Mar 8, 2022
@mkuf
Copy link
Owner

mkuf commented Mar 8, 2022

I'll reopen this, as i might have a possible solution to monkey patch the running Moonraker instance to contain the requested directories.

-Markus

@mkuf mkuf reopened this Mar 8, 2022
@mkuf
Copy link
Owner

mkuf commented Mar 9, 2022

Have a look at this Branch: moonraker-init
The init-moonraker service copies the klipper directory from the klipper service, so it should always contain the right files for your current deployment.

Imho this is just a dirty hack.
The directories are not essential for using moonraker and therefore only generate a warning.
I guess there was a change in Mainsail, so that these warnings now get propagated to the UI. Which might be useful if they had any impact on the functionality of moonraker.

@speendo
Copy link
Author

speendo commented Mar 10, 2022

Well, this sounds better than my approach: I was about to just create the directories at their default location (where they make absolutely no sense).

I will try that soon.

@mkuf
Copy link
Owner

mkuf commented Mar 12, 2022

With fluidd-core/fluidd#505 this is now also present in fluidd.

@speendo
Copy link
Author

speendo commented Mar 14, 2022

Do you still need me to test it? It's not as easy to install as I would have to change my docker-compose file.

So, if you are convenient it doesn't break anything I would wait until this comes to upstream. However, if you need someone to test it, I can try.

@mkuf
Copy link
Owner

mkuf commented Mar 16, 2022

It would be great if you could give it a try.
Have a look at the diff here 13f31e2
It's basically just an extra service and a new dependency for the moonraker service. The other lines just rename the existing init service, which is not necessary for testing this change.

-Markus

@speendo
Copy link
Author

speendo commented Mar 17, 2022

I just tried it out. If I didn't make a mistake, the warnings are still there. Maybe I misconfigured something?

@mkuf
Copy link
Owner

mkuf commented Mar 18, 2022

Mind sharing your compose file?
Did the init-moonraker service produce any logs?

docker logs init-moonraker

Have any klipper files been copied to the moonraker container?

docker exec -it moonraker ls -al /opt

@speendo
Copy link
Author

speendo commented Mar 19, 2022

Here's my compose file

~/docker-compose/3dprinter/prind2/prind$ cat docker-compose.yaml 
## Common Templates
x-klipper-svc: &klipper-svc
  image: mkuf/klipper:nightly
  container_name: klipper
  restart: unless-stopped
  logging:
    driver: none
  depends_on:
    init-config:
      condition: service_completed_successfully
  command:
    - "-I"
    - "run/klipper.tty"
    - "-a"
    - "run/klipper.sock"
    - "cfg/printer.cfg"
    - "-l"
    - "log/klippy.log"

## Service Definitions
services:

  ## Klippy Services
  ##
  klipper:
    <<: *klipper-svc
    volumes:
      - ./config:/opt/cfg
      - run:/opt/run
      - gcode:/opt/gcode
      - log:/opt/log
    profiles:
      - fluidd
      - mainsail

  klipper-priv:
    <<: *klipper-svc
    privileged: true
    volumes:
      - /dev:/dev
      - ./config:/opt/cfg
      - run:/opt/run
      - gcode:/opt/gcode
      - log:/opt/log
    profiles:
      - octoprint

  ## WebApi
  ##
  moonraker:
    image: mkuf/moonraker:nightly
    container_name: moonraker
    restart: unless-stopped
    logging:
      driver: none
    command:
      - "-c"
      - "cfg/moonraker.cfg"
      - "-l"
      - "log/moonraker.log"
    depends_on:
      init-config:
        condition: service_completed_successfully
      klipper:
        condition: service_started
      init-moonraker:
        condition: service_completed_successfully
    volumes:
      - ./config:/opt/cfg
      - run:/opt/run
      - gcode:/opt/gcode
      - log:/opt/log
      - moonraker-db:/opt/db
    profiles:
      - fluidd
      - mainsail
    labels:
      - "traefik.enable=true"
      - "traefik.http.services.moonraker.loadbalancer.server.port=7125"
      - "traefik.http.routers.moonraker.rule=PathPrefix(`/websocket`,`/printer`,`/api`,`/access`,`/machine`,`/server`)"
      - "traefik.http.routers.moonraker.entrypoints=web"

  ## Frontends
  ##
  octoprint:
    image: octoprint/octoprint:minimal
    container_name: octoprint
    restart: unless-stopped
    depends_on:
      klipper-priv:
        condition: service_started
    privileged: true
    volumes:
      - /dev:/dev
      - run:/opt/run
      - octoprint:/octoprint
    profiles:
      - octoprint
    labels:
      - "traefik.enable=true"
      - "traefik.http.services.octoprint.loadbalancer.server.port=5000"
      - "traefik.http.routers.octoprint.rule=PathPrefix(`/`)"
      - "traefik.http.routers.octoprint.entrypoints=web"

  fluidd:
    image: cadriel/fluidd:latest
    container_name: fluidd
    restart: unless-stopped
    profiles:
      - fluidd
    labels:
      - "traefik.enable=true"
      - "traefik.http.services.fluidd.loadbalancer.server.port=80"
      - "traefik.http.routers.fluidd.rule=PathPrefix(`/`)"
      - "traefik.http.routers.fluidd.entrypoints=web"

  mainsail:
    image: mkuf/mainsail:nightly
    container_name: mainsail
    restart: unless-stopped
    profiles:
      - mainsail
    labels:
      - "traefik.enable=true"
      - "traefik.http.services.mainsail.loadbalancer.server.port=80"
      - "traefik.http.routers.mainsail.rule=PathPrefix(`/`)"
      - "traefik.http.routers.mainsail.entrypoints=web"

  ## Accompanying Services/Infra
  ##

  ## Config dir needs to be writable by uid/gid 1000
  ## This container sets the right permissions and exits
  init-config:
    image: busybox:latest
    container_name: init-config
    volumes: [".:/prind"]
    command: chown -R 1000:1000 /prind/config

  ## Moonraker warns, if certain klipper directories are not accessible
  ## This container copies /opt/klipper from the klipper service to moonraker
  ## https://github.com/mkuf/prind/issues/14
  init-moonraker:
    image: docker:latest
    container_name: init-moonraker
    entrypoint: []
    volumes: ["/var/run/docker.sock:/var/run/docker.sock"]
    command: |
      /bin/sh -c "
        docker cp klipper:/opt/klipper /tmp
        docker cp /tmp/klipper moonraker:/opt
      "

  ## Loadbalancer/Proxy
  traefik:
    image: "traefik:v2.5"
    container_name: "traefik"
    hostname: "traefik"
    command:
      - "--accesslog"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
    ports:
      - "3434:80"
    restart: unless-stopped
    volumes:
        - "/var/run/docker.sock:/var/run/docker.sock:ro"

volumes:
  run:
    driver_opts:
      type: tmpfs
      device: tmpfs
  gcode:
  octoprint:
  moonraker-db:
  log:
    driver_opts:
      type: tmpfs
      device: tmpfs

I also would like to provide docker logs, however, after pulling the images again, I cannot get moonraker to start.
[edit]
This was a heisenbug. I tried it again, now it started.

$ docker-compose --profile=mainsail up -d
Recreating mainsail     ... done
Starting traefik        ... done
Creating init-moonraker ... done
Creating init-config    ... done
Recreating klipper      ... done
Recreating moonraker    ... done

However, init-moonraker didn't create any logs.

Here's the other output:

$ docker exec -it moonraker ls -al /opt
total 36
drwxr-xr-x 1 root      root      4096 Mar 11 02:45 .
drwxr-xr-x 1 root      root      4096 Mar 19 10:45 ..
drwxr-xr-x 2 moonraker moonraker 4096 Mar 17 21:23 cfg
drwxr-xr-x 2 moonraker moonraker 4096 Mar 19 10:43 db
drwxr-xr-x 2 moonraker moonraker 4096 Mar 11 02:45 gcode
drwxr-xr-x 2 moonraker moonraker   80 Mar 19 10:45 log
drwxr-xr-x 1 moonraker moonraker 4096 Mar 11 02:45 moonraker
drwxr-xr-x 2 moonraker moonraker   80 Mar 19 10:45 run
drwxr-xr-x 1 moonraker moonraker 4096 Mar 11 02:45 venv

Seems nothing has been created, or has it?

Here are all logs

$ docker-compose logs
Attaching to moonraker, klipper, mainsail, init-config, init-moonraker, traefik
mainsail          | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
mainsail          | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
mainsail          | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
mainsail          | 10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
mainsail          | 10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
mainsail          | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
mainsail          | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
mainsail          | /docker-entrypoint.sh: Configuration complete; ready for start up
mainsail          | 2022/03/19 10:45:32 [notice] 1#1: using the "epoll" event method
mainsail          | 2022/03/19 10:45:32 [notice] 1#1: nginx/1.21.6
mainsail          | 2022/03/19 10:45:32 [notice] 1#1: built by gcc 10.3.1 20211027 (Alpine 10.3.1_git20211027) 
mainsail          | 2022/03/19 10:45:32 [notice] 1#1: OS: Linux 5.10.0-11-amd64
mainsail          | 2022/03/19 10:45:32 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
mainsail          | 2022/03/19 10:45:32 [notice] 1#1: start worker processes
mainsail          | 2022/03/19 10:45:32 [notice] 1#1: start worker process 32
mainsail          | 2022/03/19 10:45:32 [notice] 1#1: start worker process 33
mainsail          | 2022/03/19 10:45:32 [notice] 1#1: start worker process 34
mainsail          | 2022/03/19 10:45:32 [notice] 1#1: start worker process 35
mainsail          | 172.27.0.2 - - [19/Mar/2022:10:46:52 +0000] "GET / HTTP/1.1" 200 1814 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:98.0) Gecko/20100101 Firefox/98.0" "172.27.0.1"
mainsail          | 172.27.0.2 - - [19/Mar/2022:10:46:52 +0000] "GET /assets/index.8da812c7.js HTTP/1.1" 200 1167389 "http://3dprint.server/" "Mozilla/5.0 (X11; Linux x86_64; rv:98.0) Gecko/20100101 Firefox/98.0" "172.27.0.1"
mainsail          | 172.27.0.2 - - [19/Mar/2022:10:46:52 +0000] "GET /assets/vendor.d5cd1c3a.css HTTP/1.1" 200 528964 "http://3dprint.server/" "Mozilla/5.0 (X11; Linux x86_64; rv:98.0) Gecko/20100101 Firefox/98.0" "172.27.0.1"
mainsail          | 172.27.0.2 - - [19/Mar/2022:10:46:52 +0000] "GET /assets/index.1149e25c.css HTTP/1.1" 200 41691 "http://3dprint.server/" "Mozilla/5.0 (X11; Linux x86_64; rv:98.0) Gecko/20100101 Firefox/98.0" "172.27.0.1"
mainsail          | 172.27.0.2 - - [19/Mar/2022:10:46:52 +0000] "GET /assets/vendor.101268b7.js HTTP/1.1" 200 1480132 "http://3dprint.server/assets/index.8da812c7.js" "Mozilla/5.0 (X11; Linux x86_64; rv:98.0) Gecko/20100101 Firefox/98.0" "172.27.0.1"
mainsail          | 172.27.0.2 - - [19/Mar/2022:10:46:52 +0000] "GET /assets/vendor.101268b7.js HTTP/1.1" 304 0 "http://3dprint.server/" "Mozilla/5.0 (X11; Linux x86_64; rv:98.0) Gecko/20100101 Firefox/98.0" "172.27.0.1"
mainsail          | 172.27.0.2 - - [19/Mar/2022:10:46:52 +0000] "GET /config.json HTTP/1.1" 200 5 "http://3dprint.server/" "Mozilla/5.0 (X11; Linux x86_64; rv:98.0) Gecko/20100101 Firefox/98.0" "172.27.0.1"
mainsail          | 172.27.0.2 - - [19/Mar/2022:10:46:52 +0000] "GET /img/icons/apple-touch-icon-152x152.png HTTP/1.1" 200 4364 "http://3dprint.server/" "Mozilla/5.0 (X11; Linux x86_64; rv:98.0) Gecko/20100101 Firefox/98.0" "172.27.0.1"
mainsail          | 172.27.0.2 - - [19/Mar/2022:10:46:52 +0000] "GET /img/icons/favicon-16x16.png HTTP/1.1" 200 546 "http://3dprint.server/" "Mozilla/5.0 (X11; Linux x86_64; rv:98.0) Gecko/20100101 Firefox/98.0" "172.27.0.1"
mainsail          | 172.27.0.2 - - [19/Mar/2022:10:46:53 +0000] "GET /img/sidebar-background.svg HTTP/1.1" 200 4588 "http://3dprint.server/" "Mozilla/5.0 (X11; Linux x86_64; rv:98.0) Gecko/20100101 Firefox/98.0" "172.27.0.1"
traefik           | time="2022-03-19T10:43:28Z" level=info msg="Configuration loaded from flags."
traefik           | time="2022-03-19T10:45:07Z" level=error msg="accept tcp [::]:80: use of closed network connection" entryPointName=web
traefik           | time="2022-03-19T10:45:07Z" level=error msg="close tcp [::]:80: use of closed network connection" entryPointName=web
traefik           | time="2022-03-19T10:45:32Z" level=info msg="Configuration loaded from flags."
traefik           | 172.27.0.1 - - [19/Mar/2022:10:46:52 +0000] "GET / HTTP/1.1" 200 1814 "-" "-" 1 "mainsail@docker" "http://172.27.0.4:80" 1ms
traefik           | 172.27.0.1 - - [19/Mar/2022:10:46:52 +0000] "GET /assets/index.8da812c7.js HTTP/1.1" 200 1167389 "-" "-" 2 "mainsail@docker" "http://172.27.0.4:80" 4ms
traefik           | 172.27.0.1 - - [19/Mar/2022:10:46:52 +0000] "GET /assets/vendor.d5cd1c3a.css HTTP/1.1" 200 528964 "-" "-" 3 "mainsail@docker" "http://172.27.0.4:80" 2ms
traefik           | 172.27.0.1 - - [19/Mar/2022:10:46:52 +0000] "GET /assets/index.1149e25c.css HTTP/1.1" 200 41691 "-" "-" 4 "mainsail@docker" "http://172.27.0.4:80" 1ms
traefik           | 172.27.0.1 - - [19/Mar/2022:10:46:52 +0000] "GET /assets/vendor.101268b7.js HTTP/1.1" 200 1480132 "-" "-" 5 "mainsail@docker" "http://172.27.0.4:80" 9ms
traefik           | 172.27.0.1 - - [19/Mar/2022:10:46:52 +0000] "GET /assets/vendor.101268b7.js HTTP/1.1" 304 0 "-" "-" 6 "mainsail@docker" "http://172.27.0.4:80" 0ms
traefik           | 172.27.0.1 - - [19/Mar/2022:10:46:52 +0000] "GET /config.json HTTP/1.1" 200 5 "-" "-" 7 "mainsail@docker" "http://172.27.0.4:80" 1ms
traefik           | 172.27.0.1 - - [19/Mar/2022:10:46:52 +0000] "GET /img/icons/apple-touch-icon-152x152.png HTTP/1.1" 200 4364 "-" "-" 8 "mainsail@docker" "http://172.27.0.4:80" 0ms
traefik           | 172.27.0.1 - - [19/Mar/2022:10:46:52 +0000] "GET /img/icons/favicon-16x16.png HTTP/1.1" 200 546 "-" "-" 9 "mainsail@docker" "http://172.27.0.4:80" 0ms
traefik           | 172.27.0.1 - - [19/Mar/2022:10:46:53 +0000] "GET /img/sidebar-background.svg HTTP/1.1" 200 4588 "-" "-" 11 "mainsail@docker" "http://172.27.0.4:80" 0ms
traefik           | 172.27.0.1 - - [19/Mar/2022:10:46:53 +0000] "GET /server/files/config/.theme/default.json?time=1647686813413 HTTP/1.1" 404 517 "-" "-" 12 "moonraker@docker" "http://172.27.0.5:7125" 5ms
traefik           | 172.27.0.1 - - [19/Mar/2022:10:46:53 +0000] "POST /server/database/item HTTP/1.1" 200 77 "-" "-" 13 "moonraker@docker" "http://172.27.0.5:7125" 14ms

@mkuf
Copy link
Owner

mkuf commented Mar 22, 2022

Your compose file looks fine to me.
I can't recreate this issue and can't pin down what is causing this behaviour for you.

Here are a few things you could try.

Option 1: (preferred) Trigger the init Service again

  1. Start the init-moonraker service after the stack has started
docker compose start init-moonraker
  1. Inspect the init services' logs and check if klipper directory has been copied
docker compose logs init-moonraker
docker compose exec moonraker ls /opt
  1. If the files have been copied, restart the moonraker service
docker compose restart moonraker

Option 2: Manually Copy Files

  1. Copy Files to your local disk and then into the moonraker service
docker compose cp klipper:/opt/klipper /tmp
docker compose cp /tmp/klipper moonraker:/opt
  1. Restart the moonraker service
docker compose restart moonraker

On an unrelated note, I noticed that the docker:dind Image is only available for x64 and arm64 architectures. This would manifest in an error, if you were on a unsupported arch. I am personally using this Stack on arm/v7 which would not be able to start with this init service.
To circumvent this, we could probably build an image that contains docker ourselves.

@speendo
Copy link
Author

speendo commented Mar 26, 2022

hm. I use my home server which runs a amd64 architecture.

I can still try to put the directories where Moonraker expects them. It just doesn't seem "correct" but, maybe that's the easiest way...

Still have to try to start init-moonraker manually.

Or maybe it would make sense to raise a feature request in the moonraker repo to get the possibility to configure the path?

@mkuf
Copy link
Owner

mkuf commented Mar 26, 2022

The options I mentioned above are meant as troubleshooting steps, as I could not reproduce your described behaviour. Manually copying the Files is not the correct long-term solution.

At the moment I would like to bother the Maintainers of the packaged software as little as possible as long as there are viable Workarounds for running their projects in Docker.

@gminadak
Copy link

Sorry to jump in but i have similar problems after updating to latest docker 20.10.14 today, everything worked perfectly before the update.
I also had problem with Pi-hole (irrelevant but worth mentioning)
I'm using debian (bullseye) on an old laptop.

And i have the following errors after replacing my docker-compose.yaml and adding docker-compose.override.yaml
Screenshot 2022-03-26 231724
And this with my old docker-compose.yaml
Screenshot 2022-03-26 233653
docker-compose.yaml.old.txt
docker-compose.yaml.current.txt
docker-compose.override.yaml.current.txt

@mkuf
Copy link
Owner

mkuf commented Mar 27, 2022

@gminadak please share your moonraker.cfg and a full moonraker log.

@gminadak
Copy link

@mkuf thank you for your reply
moonraker.cfg.txt
moonraker.log.txt

@mkuf
Copy link
Owner

mkuf commented Mar 27, 2022

@gminadak
those Policykit Warnings are probably caused my a missing setting.
Have a look at the example:

[machine]
provider: systemd_cli

Also, make sure to use mkuf/moonraker:4b27e5e or later, as described in the v0.5.0 Releasenotes

@gminadak
Copy link

@mkuf by adding
[machine]
provider: systemd_cli

The PolicyKit warnings have gone, after some researching i come across this on GitHub
but as mentioned this feature will be deprecated in the future and the correct solution is to run the
~/moonraker/scripts/set-policykit-rules.sh
I won't lie to you i tried to execute this from docker but it asked for root password for moonraker and I stopped the procedure.
I'm by no means an expert in Docker, klipper or linux.

Thank you for your help.
ps: The suppliedpath errors are still in place

@mkuf
Copy link
Owner

mkuf commented Mar 27, 2022

Thanks for pointing this out. I did not consider this when implementing the features for v0.5.0.
I'll have to look into handling this with dbus and policykit to be compatible with future moonraker releases, but this will be a separate issue.

Did you test the moonraker-init branch to get rid of the directory warnings, @gminadak?

@gminadak
Copy link

gminadak commented Mar 27, 2022

@mkuf
Just now but with no luck

gminadak@linux-server:~/prind-init$ docker-compose --profile fluidd up
Starting init-moonraker ...
ustreamer is up-to-date
Starting init-config ...
Starting init-moonraker ... done
Starting init-config ... done
klipper is up-to-date

ERROR: for moonraker Container "c25c9310faed" exited with code 1.
ERROR: Encountered errors while bringing up the project.
gminadak@linux-server:~/prind-init$

Edit forgot to mention the container ID

gminadak@linux-server:~/prind-init$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8d078e1d7c89 mkuf/klipper:nightly "/opt/venv/bin/pytho…" 7 minutes ago Up 6 minutes klipper
c25c9310faed docker:latest "/bin/sh -c '\n dock…" 9 minutes ago Exited (1) 19 seconds ago init-moonraker
59fa5f6986ef cadriel/fluidd:latest "/docker-entrypoint.…" 9 minutes ago Up 9 minutes 80/tcp fluidd
a0d764436689 mkuf/ustreamer:nightly "/opt/ustreamer/ustr…" 9 minutes ago Up 9 minutes 8080/tcp ustreamer
56969784dfc1 busybox:latest "chown -R 1000:1000 …" 9 minutes ago Exited (0) 24 seconds ago init-config
9b0053cdee5a traefik:v2.5 "/entrypoint.sh --ac…" 9 minutes ago Up 9 minutes 0.0.0.0:81->80/tcp, :::81->80/tcp traefik

@mkuf
Copy link
Owner

mkuf commented Mar 28, 2022

So the init-moonraker container failed.
What logs did it output?

On which architecture are you running?

@gminadak
Copy link

gminadak commented Mar 28, 2022

@mkuf

gminadak@linux-server:~/prind-init$ uname -a
Linux linux-server 5.10.0-13-amd64 #1 SMP Debian 5.10.106-1 (2022-03-17) x86_64 GNU/Linux

gminadak@linux-server:~/prind-init$ docker logs init-moonraker

Error: No such container:path: moonraker:/
Error: No such container:path: moonraker:/
gminadak@linux-server:~/prind-init$

This is better i think
gminadak@linux-server:~/prind-init$ docker-compose logs
Attaching to klipper, traefik, init-config, init-moonraker, ustreamer, fluidd
init-moonraker | Error: No such container:path: moonraker:/
init-moonraker | Error: No such container:path: moonraker:/
fluidd | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
fluidd | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
fluidd | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
fluidd | 10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
fluidd | 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
fluidd | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
fluidd | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
fluidd | /docker-entrypoint.sh: Configuration complete; ready for start up
fluidd | 2022/03/28 19:21:43 [notice] 1#1: using the "epoll" event method
fluidd | 2022/03/28 19:21:43 [notice] 1#1: nginx/1.21.6
fluidd | 2022/03/28 19:21:43 [notice] 1#1: built by gcc 10.3.1 20211027 (Alpine 10.3.1_git20211027)
fluidd | 2022/03/28 19:21:43 [notice] 1#1: OS: Linux 5.10.0-13-amd64
fluidd | 2022/03/28 19:21:43 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
fluidd | 2022/03/28 19:21:43 [notice] 1#1: start worker processes
fluidd | 2022/03/28 19:21:43 [notice] 1#1: start worker process 31
fluidd | 2022/03/28 19:21:43 [notice] 1#1: start worker process 32
ustreamer | -- INFO [177070.576 main] -- Using internal blank placeholder
ustreamer | -- INFO [177070.576 main] -- Listening HTTP on [0.0.0.0]:8080
ustreamer | -- INFO [177070.576 http] -- Starting HTTP eventloop ...
ustreamer | -- INFO [177070.579 stream] -- Using V4L2 device: /dev/webcam
ustreamer | -- INFO [177070.579 stream] -- Using desired FPS: 30
ustreamer | ================================================================================
ustreamer | -- INFO [177070.651 stream] -- Device fd=8 opened
ustreamer | -- INFO [177070.651 stream] -- Using input channel: 0
ustreamer | -- ERROR [177070.659 stream] -- Requested resolution=1280x960 is unavailable
ustreamer | -- INFO [177070.667 stream] -- Using resolution: 1280x720
ustreamer | -- INFO [177070.667 stream] -- Using pixelformat: MJPEG
ustreamer | -- INFO [177070.674 stream] -- Using HW FPS: 30
ustreamer | -- ERROR [177070.674 stream] -- Device does not support setting of HW encoding quality parameters
ustreamer | -- INFO [177070.674 stream] -- Using IO method: MMAP
ustreamer | -- INFO [177070.676 stream] -- Requested 3 device buffers, got 3
ustreamer | -- INFO [177070.680 stream] -- Capturing started
ustreamer | -- INFO [177070.680 stream] -- Switching to HW encoder: the input is (M)JPEG ...
ustreamer | -- INFO [177070.680 stream] -- Using JPEG quality: encoder default
ustreamer | -- INFO [177070.680 stream] -- Creating pool JPEG with 1 workers ...
ustreamer | -- INFO [177070.680 stream] -- Capturing ...
traefik | time="2022-03-28T19:21:44Z" level=info msg="Configuration loaded from flags."

@mkuf
Copy link
Owner

mkuf commented Mar 28, 2022

The errors in init-moonrakers logs indicate that the containers are not available.
From your output, it seems that the moonraker container is missing at the time the init container tries to copy the files.

markus@colossus:~/prind$ docker ps -a
CONTAINER ID   IMAGE                           COMMAND                   CREATED              STATUS                          PORTS                               NAMES
908b26fae6a8   mkuf/moonraker:nightly          "/opt/venv/bin/pytho…"    About a minute ago   Up About a minute               7125/tcp                            moonraker
34204551e883   docker:latest                   "/bin/sh -c '\n  set …"   About a minute ago   Exited (0) About a minute ago                                       init-moonraker
5832ca2cadf6   mkuf/klipper:nightly            "/opt/venv/bin/pytho…"    2 minutes ago        Up 2 minutes                                                        klipper
ee652c8071a9   busybox:latest                  "chown -R 1000:1000 …"    3 minutes ago        Exited (0) About a minute ago                                       init-config
5511e9b5ab99   cadriel/fluidd:latest           "/docker-entrypoint.…"    11 minutes ago       Up 11 minutes                   80/tcp                              fluidd
32901bf69963   simulavr                        "klipper/scripts/avr…"    11 minutes ago       Up 11 minutes                                                       simulavr
5510e44de016   traefik:v2.5                    "/entrypoint.sh --ac…"    11 minutes ago       Up 11 minutes                   0.0.0.0:80->80/tcp, :::80->80/tcp   traefik
96337df5dd3a   busybox:latest                  "chown -R 1000:1000 …"    11 minutes ago       Exited (0) 8 minutes ago                                            init

Which docker compose version are you using?

@gminadak
Copy link

@mkuf

gminadak@linux-server:~/prind-init$ docker-compose version
docker-compose version 1.29.2, build 5becea4c
docker-py version: 5.0.0
CPython version: 3.7.10
OpenSSL version: OpenSSL 1.1.0l 10 Sep 2019

@mkuf
Copy link
Owner

mkuf commented Mar 28, 2022

Thats quite old. v1 might handle container creation in a different way, so that moonraker does not exist at the time we try to copy files into it.
Please give it a try with v2, as mentioned in the Readme: https://github.com/mkuf/prind#getting-started

@gminadak
Copy link

I'm still wondering how did i miss this step.
Thank you for your help, the problem is now solved.
Worth to mention that the main version still have this problem even after the update.

gminadak@linux-server:~/prind-init$ docker-compose version
Docker Compose version v2.3.4

gminadak@linux-server:~/prind-init$ docker-compose --profile fluidd up -d

[+] Running 9/9
⠿ Network prind-init_default Created 0.2s
⠿ Volume "prind-init_run" Created 0.0s
⠿ Container fluidd Started 4.4s
⠿ Container traefik Started 4.8s
⠿ Container ustreamer Started 4.7s
⠿ Container init-config Exited 3.6s
⠿ Container init-moonraker Exited 15.2s
⠿ Container klipper Started 4.1s
⠿ Container moonraker Started 14.9s
gminadak@linux-server:~/prind-init$ docker ps -a

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
246f3474b6cf mkuf/moonraker:nightly "/opt/venv/bin/pytho…" 20 seconds ago Up 5 seconds 7125/tcp moonraker
f553409ca5e9 mkuf/klipper:nightly "/opt/venv/bin/pytho…" 20 seconds ago Up 15 seconds klipper
fdc98100f47d docker:latest "/bin/sh -c '\n dock…" 21 seconds ago Exited (0) 6 seconds ago init-moonraker
d0d87b42086c mkuf/ustreamer:nightly "/opt/ustreamer/ustr…" 21 seconds ago Up 16 seconds 8080/tcp ustreamer
eb01f16469e5 traefik:v2.5 "/entrypoint.sh --ac…" 21 seconds ago Up 16 seconds 0.0.0.0:81->80/tcp, :::81->80/tcp traefik
15296a5827df cadriel/fluidd:latest "/docker-entrypoint.…" 21 seconds ago Up 16 seconds 80/tcp fluidd
7011fdfb6f4e busybox:latest "chown -R 1000:1000 …" 21 seconds ago Exited (0) 18 seconds ago init-config

@mkuf
Copy link
Owner

mkuf commented Mar 29, 2022

Great, these changes will soon be merged into main.
Thanks for testing this @gminadak

@speendo
I noticed you use the docker-compose command instead of docker compose. Are you also on compose v1?

@mkuf
Copy link
Owner

mkuf commented Mar 30, 2022

I gave this a try on my printer, which is equipped with a fairly old udoo quad.
Thanks to its very limited computing power paired with a micro-sd, starting the stack was painfully slow.
The init-moonraker service took almost two minutes to complete. This is way to long, considering it is executed every time the stack is brought up.

So I went ahead and mounted /dev/null in those places where moonraker expects a directory.
This renders the docs and example endpoints of moonraker useless, but gets rid of the Warnings.

@mkuf mkuf closed this as completed in 78f39da Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants