这是indexloc提供的服务,不要输入任何密码
Skip to content

Reboot Enables Nginx instead of Caddy #5846

@MECU

Description

@MECU

Description of problem

Upon rebooting my server, dokku comes up with nginx running instead of caddy.

I expect caddy to be used if it has been enabled upon a reboot.

Steps to reproduce

  1. A running website with caddy enabled and nginx disabled.
  2. reboot server reboot
  3. verify website not able to be loaded
  4. Run commands:
    a. dokku nginx:stop
    b. dokku caddy:start
  5. website now works

dokku report $APP_NAME

-----> uname: Linux track 5.4.0-148-generic #165-Ubuntu SMP Tue Apr 18 08:53:12 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
-----> memory:
                     total        used        free      shared  buff/cache   available
       Mem:            976         384          58          15         533         425
       Swap:          2047           5        2042
-----> docker version:
       Client: Docker Engine - Community
        Version:           23.0.6
        API version:       1.42
        Go version:        go1.19.9
        Git commit:        ef23cbc
        Built:             Fri May  5 21:18:22 2023
        OS/Arch:           linux/amd64
        Context:           default

       Server: Docker Engine - Community
        Engine:
         Version:          23.0.6
         API version:      1.42 (minimum version 1.12)
         Go version:       go1.19.9
         Git commit:       9dbdbd4
         Built:            Fri May  5 21:18:22 2023
         OS/Arch:          linux/amd64
         Experimental:     false
        containerd:
         Version:          1.6.21
         GitCommit:        3dce8eb055cbb6872793272b4f20ed16117344f8
        runc:
         Version:          1.1.7
         GitCommit:        v1.1.7-0-g860f061
        docker-init:
         Version:          0.19.0
         GitCommit:        de40ad0
-----> docker daemon info:
       Client:
        Context:    default
        Debug Mode: true
        Plugins:
         buildx: Docker Buildx (Docker Inc.)
           Version:  v0.10.4
           Path:     /usr/libexec/docker/cli-plugins/docker-buildx
         compose: Docker Compose (Docker Inc.)
           Version:  v2.17.3
           Path:     /usr/libexec/docker/cli-plugins/docker-compose
         scan: Docker Scan (Docker Inc.)
           Version:  v0.23.0
           Path:     /usr/libexec/docker/cli-plugins/docker-scan

       Server:
        Containers: 5
         Running: 4
         Paused: 0
         Stopped: 1
        Images: 11
        Server Version: 23.0.6
        Storage Driver: overlay2
         Backing Filesystem: extfs
         Supports d_type: true
         Using metacopy: false
         Native Overlay Diff: true
         userxattr: false
        Logging Driver: json-file
        Cgroup Driver: cgroupfs
        Cgroup Version: 1
        Plugins:
         Volume: local
         Network: bridge host ipvlan macvlan null overlay
         Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
        Swarm: inactive
        Runtimes: io.containerd.runc.v2 runc
        Default Runtime: runc
        Init Binary: docker-init
        containerd version: 3dce8eb055cbb6872793272b4f20ed16117344f8
        runc version: v1.1.7-0-g860f061
        init version: de40ad0
        Security Options:
         apparmor
         seccomp
          Profile: builtin
        Kernel Version: 5.4.0-148-generic
        Operating System: Ubuntu 20.04.6 LTS
        OSType: linux
        Architecture: x86_64
        CPUs: 1
        Total Memory: 976.8MiB
        Name: track
        ID: C7EG:AOBK:QFID:P7N2:Q3OG:3OR7:4I57:3Y26:J3NB:B6WO:NDLR:GRGG
        Docker Root Dir: /var/lib/docker
        Debug Mode: false
        Registry: https://index.docker.io/v1/
        Experimental: false
        Insecure Registries:
         127.0.0.0/8
        Live Restore Enabled: false

-----> git version: git version 2.25.1
-----> sigil version: 0.9.0build+bc921b7
-----> herokuish version:
 !     Herokuish image gliderlabs/herokuish:latest-20 is not available
-----> dokku version: dokku version 0.30.3
-----> plugn version: plugn: 0.12.0build+3a27594
-----> dokku plugins:
         00_dokku-standard    0.30.3 enabled    dokku core standard plugin
         20_events            0.30.3 enabled    dokku core events logging plugin
         app-json             0.30.3 enabled    dokku core app-json plugin
         apps                 0.30.3 enabled    dokku core apps plugin
         builder              0.30.3 enabled    dokku core builder plugin
         builder-dockerfile   0.30.3 enabled    dokku core builder-dockerfile plugin
         builder-herokuish    0.30.3 enabled    dokku core builder-herokuish plugin
         builder-lambda       0.30.3 enabled    dokku core builder-lambda plugin
         builder-null         0.30.3 enabled    dokku core builder-null plugin
         builder-pack         0.30.3 enabled    dokku core builder-pack plugin
         buildpacks           0.30.3 enabled    dokku core buildpacks plugin
         caddy-vhosts         0.30.3 enabled    dokku core caddy-vhosts plugin
         certs                0.30.3 enabled    dokku core certificate management plugin
         checks               0.30.3 enabled    dokku core checks plugin
         common               0.30.3 enabled    dokku core common plugin
         config               0.30.3 enabled    dokku core config plugin
         cron                 0.30.3 enabled    dokku core cron plugin
         docker-options       0.30.3 enabled    dokku core docker-options plugin
         domains              0.30.3 enabled    dokku core domains plugin
         enter                0.30.3 enabled    dokku core enter plugin
         git                  0.30.3 enabled    dokku core git plugin
         haproxy-vhosts       0.30.3 enabled    dokku core haproxy-vhosts plugin
         logs                 0.30.3 enabled    dokku core logs plugin
         network              0.30.3 enabled    dokku core network plugin
         nginx-vhosts         0.30.3 enabled    dokku core nginx-vhosts plugin
         plugin               0.30.3 enabled    dokku core plugin plugin
         postgres             1.33.0 enabled    dokku postgres service plugin
         proxy                0.30.3 enabled    dokku core proxy plugin
         ps                   0.30.3 enabled    dokku core ps plugin
         redis                1.32.4 enabled    dokku redis service plugin
         registry             0.30.3 enabled    dokku core registry plugin
         repo                 0.30.3 enabled    dokku core repo plugin
         resource             0.30.3 enabled    dokku core resource plugin
         run                  0.30.3 enabled    dokku core run plugin
         scheduler            0.30.3 enabled    dokku core scheduler plugin
         scheduler-docker-local 0.30.3 enabled    dokku core scheduler-docker-local plugin
         scheduler-null       0.30.3 enabled    dokku core scheduler-null plugin
         shell                0.30.3 enabled    dokku core shell plugin
         ssh-keys             0.30.3 enabled    dokku core ssh-keys plugin
         storage              0.30.3 enabled    dokku core storage plugin
         trace                0.30.3 enabled    dokku core trace plugin
         traefik-vhosts       0.30.3 enabled    dokku core traefik-vhosts plugin
=====> tractrak app-json information
       App json computed selected:    app.json
       App json global selected:      app.json
       App json selected:
=====> tractrak app information
       App created at:                1682003444
       App deploy source:             git-push
       App deploy source metadata:    71d72e351d2cd3726556550ccf922869ce520064
       App dir:                       /home/dokku/tractrak
       App locked:                    false
=====> tractrak builder information
       Builder build dir:
       Builder computed build dir:
       Builder computed selected:
       Builder global build dir:
       Builder global selected:
       Builder selected:
=====> tractrak builder-dockerfile information
       Builder dockerfile computed dockerfile path: Dockerfile
       Builder dockerfile global dockerfile path: Dockerfile
       Builder dockerfile dockerfile path:
=====> tractrak builder-lambda information
       Builder lambda computed lambdayml path: lambda.yml
       Builder lambda global lambdayml path: lambda.yml
       Builder lambda lambdayml path:
=====> tractrak builder-pack information
       Builder pack computed projecttoml path: project.toml
       Builder pack global projecttoml path: project.toml
       Builder pack projecttoml path:
=====> tractrak buildpacks information
       Buildpacks computed stack:     gliderlabs/herokuish:latest-20
       Buildpacks global stack:
       Buildpacks list:
       Buildpacks stack:
=====> tractrak ssl information
       Ssl dir:                       /home/dokku/tractrak/tls
       Ssl enabled:                   true
       Ssl hostnames:                 tractrak.com
       Ssl expires at:                Jul 19 14:20:41 2023 GMT
       Ssl issuer:                    C = US, O = Let's Encrypt, CN = R3
       Ssl starts at:                 Apr 20 14:20:42 2023 GMT
       Ssl subject:                   subject=CN = tractrak.com
       Ssl verified:                  self signed
=====> tractrak checks information
       Checks disabled list:          none
       Checks skipped list:           none
       Checks computed wait to retire: 60
       Checks global wait to retire:  60
       Checks wait to retire:
=====> tractrak cron information
       Cron task count:               0
=====> tractrak docker options information
       Docker options build:          --link dokku.postgres.db:dokku-postgres-db --link dokku.redis.redis:dokku-redis-redis
       Docker options deploy:         --link dokku.postgres.db:dokku-postgres-db --link dokku.redis.redis:dokku-redis-redis --restart=on-failure:10
       Docker options run:            --link dokku.postgres.db:dokku-postgres-db --link dokku.redis.redis:dokku-redis-redis
=====> tractrak domains information
       Domains app enabled:           true
       Domains app vhosts:            tractrak.com
       Domains global enabled:        true
       Domains global vhosts:         track
=====> tractrak git information
       Git deploy branch:             main
       Git global deploy branch:      master
       Git keep git dir:              false
       Git rev env var:               GIT_REV
       Git sha:
       Git source image:
       Git last updated at:           1682999172
=====> tractrak logs information
       Logs computed max size:        10m
       Logs global max size:          10m
       Logs global vector sink:
       Logs max size:
       Logs vector sink:
=====> tractrak network information
       Network attach post create:
       Network attach post deploy:
       Network bind all interfaces:          false
       Network computed attach post create:
       Network computed attach post deploy:
       Network computed bind all interfaces: false
       Network computed initial network:
       Network computed tld:
       Network global attach post create:
       Network global attach post deploy:
       Network global bind all interfaces:   false
       Network global initial network:
       Network global tld:
       Network initial network:
       Network static web listener:
       Network tld:
       Network web listeners:                172.17.0.5:3000
=====> tractrak nginx information
       Nginx access log format:
       Nginx access log path:         /var/log/nginx/tractrak-access.log
       Nginx bind address ipv4:
       Nginx bind address ipv6:       ::
       Nginx client max body size:
       Nginx disable custom config:   false
       Nginx error log path:          /var/log/nginx/tractrak-error.log
       Nginx global hsts:             true
       Nginx computed hsts:           true
       Nginx hsts:
       Nginx hsts include subdomains: true
       Nginx hsts max age:            15724800
       Nginx hsts preload:            false
       Nginx computed nginx conf sigil path: nginx.conf.sigil
       Nginx global nginx conf sigil path: nginx.conf.sigil
       Nginx nginx conf sigil path:
       Nginx proxy buffer size:       4096
       Nginx proxy buffering:         on
       Nginx proxy buffers:           8 4096
       Nginx proxy busy buffers size: 8192
       Nginx proxy read timeout:      60s
       Nginx last visited at:         1683831256
       Nginx x forwarded for value:   $remote_addr
       Nginx x forwarded port value:  $server_port
       Nginx x forwarded proto value: $scheme
       Nginx x forwarded ssl:
=====> tractrak proxy information
       Proxy enabled:                 true
       Proxy port map:                http:80:3000 https:443:3000
       Proxy type:                    caddy
=====> tractrak ps information
       Deployed:                      true
       Processes:                     1
       Ps can scale:                  true
       Ps computed procfile path:     Procfile
       Ps global procfile path:       Procfile
       Ps procfile path:
       Ps restart policy:             on-failure:10
       Restore:                       true
       Running:                       true
       Status web 1:                  running (CID: eb057488d74)
=====> tractrak registry information
       Registry computed image repo:      dokku/tractrak
       Registry computed push on release: false
       Registry computed server:
       Registry global push on release:
       Registry global server:
       Registry image repo:
       Registry push on release:
       Registry server:
       Registry tag version:
=====> tractrak resource information
=====> tractrak scheduler information
       Scheduler computed selected:   docker-local
       Scheduler global selected:     docker-local
       Scheduler selected:
=====> tractrak scheduler-docker-local information
       Scheduler docker local disable chown:
       Scheduler docker local init process: true
       Scheduler docker local parallel schedule count:
=====> tractrak storage information
       Storage build mounts:
       Storage deploy mounts:
       Storage run mounts:

Additional information

dokku nginx:show-config tractrak

server {
  listen      [::]:80;
  listen      80;
  server_name tractrak.com;
  access_log  /var/log/nginx/tractrak-access.log;
  error_log   /var/log/nginx/tractrak-error.log;

  include /home/dokku/tractrak/nginx.conf.d/*.conf;
  location / {
    return 301 https://$host:443$request_uri;
  }

}

server {
  listen      [::]:443 ssl http2;
  listen      443 ssl http2;

  server_name tractrak.com;
  access_log  /var/log/nginx/tractrak-access.log;
  error_log   /var/log/nginx/tractrak-error.log;

  ssl_certificate           /home/dokku/tractrak/tls/server.crt;
  ssl_certificate_key       /home/dokku/tractrak/tls/server.key;
  ssl_protocols             TLSv1.2 TLSv1.3;
  ssl_prefer_server_ciphers off;

  keepalive_timeout   70;

  location    / {

    gzip on;
    gzip_min_length  1100;
    gzip_buffers  4 32k;
    gzip_types    text/css text/javascript text/xml text/plain text/x-component application/javascript application/x-javascript application/json application/xml  application/rss+xml font/truetype application/x-font-ttf font/opentype application/vnd.ms-fontobject image/svg+xml;
    gzip_vary on;
    gzip_comp_level  6;

    proxy_pass  http://tractrak-3000;
    http2_push_preload on;
    proxy_http_version 1.1;
    proxy_read_timeout 60s;
    proxy_buffer_size 4096;
    proxy_buffering on;
    proxy_buffers 8 4096;
    proxy_busy_buffers_size 8192;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $http_connection;
    proxy_set_header Host $http_host;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header X-Forwarded-Port $server_port;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Request-Start $msec;

  }



  error_page 400 401 402 403 405 406 407 408 409 410 411 412 413 414 415 416 417 418 420 422 423 424 426 428 429 431 444 449 450 451 /400-error.html;
  location /400-error.html {
    root /var/lib/dokku/data/nginx-vhosts/dokku-errors;
    internal;
  }

  error_page 404 /404-error.html;
  location /404-error.html {
    root /var/lib/dokku/data/nginx-vhosts/dokku-errors;
    internal;
  }

  error_page 500 501 503 504 505 506 507 508 509 510 511 /500-error.html;
  location /500-error.html {
    root /var/lib/dokku/data/nginx-vhosts/dokku-errors;
    internal;
  }

  error_page 502 /502-error.html;
  location /502-error.html {
    root /var/lib/dokku/data/nginx-vhosts/dokku-errors;
    internal;
  }
  include /home/dokku/tractrak/nginx.conf.d/*.conf;
}

upstream tractrak-3000 {

  server 172.17.0.5:3000;
}

dokku caddy:show-config tractrak

---
version: "3.7"

services:
  caddy:
    image: "lucaslorentz/caddy-docker-proxy:2.7"

    environment:
      - CADDY_INGRESS_NETWORKS=bridge
      - CADDY_DOCKER_POLLING_INTERVAL=5s

    labels: # Global options
      - caddy.log.format=json
      - caddy.log.level=ERROR

      - "caddy.email=<redacted>@tractrak.com"
      - "caddy.acme_ca=https://acme-v02.api.letsencrypt.org/directory"

    network_mode: bridge

    ports:
      - "80:80"
      - "443:443"

    restart: unless-stopped

    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - "/var/lib/dokku/data/caddy:/data"

Output of failing commands after running: dokku trace:off

No response

Output of failing commands after running: dokku trace:on

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions