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

ps:rebuild doesn't use the proper start configuration when Procfile is present #7226

Open
adamgyulavari opened this issue Oct 1, 2024 · 1 comment

Comments

@adamgyulavari
Copy link

adamgyulavari commented Oct 1, 2024

Description of problem

I might be doing something wrong, but it seems like that ps:rebuild sometimes forgets the build configuration.
normally when I deploy using git:from-image , the proper start command is used that’s defined in the Procfile:

836786eda342   dokku/staging-api:latest         "poetry run uvicorn …"   19 minutes ago   Up 19 minutes              staging-api.web.1

but when I use dokku ps:rebuild staging-api it fails, because it starts with this:

58ab94084a24   dokku/staging-api:latest         "python"             About an hour ago   Up About an hour              staging-api.web.1

There’s also an app.json with health checks defined for the web process, which is executed successfully when using git:from-image , but in case of rebuild:

#6 naming to docker.io/dokku/staging-api:latest done
#6 DONE 0.0s
-----> Releasing staging-api...
-----> Checking for predeploy task
       No predeploy task found, skipping
-----> Checking for release task
       No release task found, skipping
=====> Processing deployment checks
 !     No healthchecks found in app.json for web process type
       No web healthchecks found in app.json. Simple container checks will be performed.
       For more efficient zero downtime deployments, add healthchecks to your app.json. See https://dokku.com/docs/deployment/zero-downtime-deploys/ for examples
-----> Deploying staging-api via the docker-local scheduler...
-----> Deploying web (count=1)
       Attempting pre-flight checks (web.1)
 !     Container state: exited
75102ac96f67ff08f4f6cedaa5e6c4a474e9f550b2425b4dfcab32423a13ae8a
 !     Could not start due to 1 failed checks (web.1)

Steps to reproduce

Not exactly sure how to reproduce, but I'd consider these steps:

  • Create a docker image with a web app where the Procfile defines the start command instead of the Dockerfile directly
  • dokku git:from-image app docker-image
  • dokku ps:rebuild app

dokku report $APP_NAME

root@polygence-staging-dokku:~# dokku report staging-api
-----> uname: Linux polygence-staging-dokku 5.15.0-106-generic #116-Ubuntu SMP Wed Apr 17 09:17:56 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
-----> memory:
                      total        used        free      shared  buff/cache   available
       Mem:            7937        5902         184         151        1850        1576
       Swap:              0           0           0
-----> disk utilization:
       Filesystem      Size  Used Avail Use% Mounted on
       /dev/vda1       117G   41G   76G  35% /
       /dev/vda15      105M  6.1M   99M   6% /boot/efi
-----> disk inode utilization:
       Filesystem     Inodes IUsed IFree IUse% Mounted on
       /dev/vda1         15M  372K   15M    3% /
       /dev/vda15          0     0     0     - /boot/efi
-----> docker version:
       Client: Docker Engine - Community
        Version:           24.0.2
        API version:       1.43
        Go version:        go1.20.4
        Git commit:        cb74dfc
        Built:             Thu May 25 21:51:00 2023
        OS/Arch:           linux/amd64
        Context:           default

       Server: Docker Engine - Community
        Engine:
         Version:          24.0.2
         API version:      1.43 (minimum version 1.12)
         Go version:       go1.20.4
         Git commit:       659604f
         Built:            Thu May 25 21:51:00 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: Docker Engine - Community
        Version:    24.0.2
        Context:    default
        Debug Mode: true
        Plugins:
         buildx: Docker Buildx (Docker Inc.)
           Version:  v0.10.5
           Path:     /usr/libexec/docker/cli-plugins/docker-buildx
         compose: Docker Compose (Docker Inc.)
           Version:  v2.18.1
           Path:     /usr/libexec/docker/cli-plugins/docker-compose

       Server:
        Containers: 14
         Running: 14
         Paused: 0
         Stopped: 0
        Images: 10
        Server Version: 24.0.2
        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: systemd
        Cgroup Version: 2
        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
         cgroupns
        Kernel Version: 5.15.0-106-generic
        Operating System: Ubuntu 22.04.2 LTS
        OSType: linux
        Architecture: x86_64
        CPUs: 4
        Total Memory: 7.751GiB
        Name: polygence-staging-dokku
        ID: 96fddca3-0ed0-4664-b453-70d5b5033ded
        Docker Root Dir: /var/lib/docker
        Debug Mode: false
        Username: polygencedevelopers
        Experimental: false
        Insecure Registries:
         127.0.0.0/8
        Live Restore Enabled: false

-----> herokuish version:
 !     Herokuish image gliderlabs/herokuish:latest-22 is not available
-----> dokku version: dokku version 0.34.9
-----> dokku-event-listener version: v0.17.0
-----> dokku-update version: dokku-update v0.9.4
-----> docker-container-healthchecker version: v0.11.0
-----> docker-image-labeler version: v0.8.0
-----> git version: git version 2.34.1
-----> lambda-builder version:        v0.8.0
-----> netrc version: v0.10.0
 !     pack binary is not available
-----> plugn version: plugn: v0.16.0
-----> sigil version: v0.11.0
-----> sshcommand version: sshcommand v0.18.0
-----> dokku plugins:
         00_dokku-standard    0.34.9 enabled    dokku core standard plugin
         20_events            0.34.9 enabled    dokku core events logging plugin
         app-json             0.34.9 enabled    dokku core app-json plugin
         apps                 0.34.9 enabled    dokku core apps plugin
         builder              0.34.9 enabled    dokku core builder plugin
         builder-dockerfile   0.34.9 enabled    dokku core builder-dockerfile plugin
         builder-herokuish    0.34.9 enabled    dokku core builder-herokuish plugin
         builder-lambda       0.34.9 enabled    dokku core builder-lambda plugin
         builder-nixpacks     0.34.9 enabled    dokku core builder-nixpacks plugin
         builder-null         0.34.9 enabled    dokku core builder-null plugin
         builder-pack         0.34.9 enabled    dokku core builder-pack plugin
         buildpacks           0.34.9 enabled    dokku core buildpacks plugin
         caddy-vhosts         0.34.9 enabled    dokku core caddy-vhosts plugin
         certs                0.34.9 enabled    dokku core certificate management plugin
         checks               0.34.9 enabled    dokku core checks plugin
         common               0.34.9 enabled    dokku core common plugin
         config               0.34.9 enabled    dokku core config plugin
         cron                 0.34.9 enabled    dokku core cron plugin
         docker-options       0.34.9 enabled    dokku core docker-options plugin
         domains              0.34.9 enabled    dokku core domains plugin
         enter                0.34.9 enabled    dokku core enter plugin
         git                  0.34.9 enabled    dokku core git plugin
         haproxy-vhosts       0.34.9 enabled    dokku core haproxy-vhosts plugin
         letsencrypt          0.20.3 enabled    Automated installation of let's encrypt TLS certificates
         logs                 0.34.9 enabled    dokku core logs plugin
         maintenance          0.8.0 enabled    Maintenance mode for apps
         mongo                1.36.11 enabled    dokku mongo service plugin
         mysql                1.40.1 enabled    dokku mysql service plugin
         network              0.34.9 enabled    dokku core network plugin
         nginx-vhosts         0.34.9 enabled    dokku core nginx-vhosts plugin
         openresty-vhosts     0.34.9 enabled    dokku core openresty-vhosts plugin
         plugin               0.34.9 enabled    dokku core plugin plugin
         ports                0.34.9 enabled    dokku core ports plugin
         postgres             1.36.4 enabled    dokku postgres service plugin
         proxy                0.34.9 enabled    dokku core proxy plugin
         ps                   0.34.9 enabled    dokku core ps plugin
         redis                1.37.4 enabled    dokku redis service plugin
         registry             0.34.9 enabled    dokku core registry plugin
         repo                 0.34.9 enabled    dokku core repo plugin
         resource             0.34.9 enabled    dokku core resource plugin
         run                  0.34.9 enabled    dokku core run plugin
         scheduler            0.34.9 enabled    dokku core scheduler plugin
         scheduler-docker-local 0.34.9 enabled    dokku core scheduler-docker-local plugin
         scheduler-k3s        0.34.9 enabled    dokku core scheduler-k3s plugin
         scheduler-null       0.34.9 enabled    dokku core scheduler-null plugin
         shell                0.34.9 enabled    dokku core shell plugin
         ssh-keys             0.34.9 enabled    dokku core ssh-keys plugin
         storage              0.34.9 enabled    dokku core storage plugin
         trace                0.34.9 enabled    dokku core trace plugin
         traefik-vhosts       0.34.9 enabled    dokku core traefik-vhosts plugin
=====> staging-api app-json information
       App json computed selected:    app.json
       App json global selected:      app.json
       App json selected:
=====> staging-api app information
       App created at:                1712928740
       App deploy source:             docker-image
       App deploy source metadata:    polygence/polygence-python-image-staging:14fede09288466d676836c64673981b4cb7fbb5c
       App dir:                       /home/dokku/staging-api
       App locked:                    false
=====> staging-api builder information
       Builder build dir:
       Builder computed build dir:
       Builder computed selected:
       Builder global build dir:
       Builder global selected:
       Builder selected:
=====> staging-api builder-dockerfile information
       Builder dockerfile computed dockerfile path: Dockerfile
       Builder dockerfile global dockerfile path: Dockerfile
       Builder dockerfile dockerfile path:
=====> staging-api builder-herokuish information
       Builder herokuish computed allowed: true
       Builder herokuish global allowed: true
       Builder herokuish allowed:
=====> staging-api builder-lambda information
       Builder lambda computed lambdayml path: lambda.yml
       Builder lambda global lambdayml path: lambda.yml
       Builder lambda lambdayml path:
=====> staging-api builder-nixpacks information
       Builder nixpacks computed nixpackstoml path: nixpacks.toml
       Builder nixpacks global nixpackstoml path: nixpacks.toml
       Builder nixpacks nixpackstoml path:
       Builder nixpacks computed no cache: false
       Builder nixpacks global no cache: false
       Builder nixpacks no cache:
=====> staging-api builder-pack information
       Builder pack computed projecttoml path: project.toml
       Builder pack global projecttoml path: project.toml
       Builder pack projecttoml path:
=====> staging-api buildpacks information
       Buildpacks computed stack:     gliderlabs/herokuish:latest-22
       Buildpacks global stack:
       Buildpacks list:
       Buildpacks stack:
=====> staging-api caddy information
       Caddy image:                   lucaslorentz/caddy-docker-proxy:2.9
       Caddy letsencrypt email:
       Caddy letsencrypt server:      https://acme-v02.api.letsencrypt.org/directory
       Caddy log level:               ERROR
       Caddy polling interval:        5s
       Caddy tls internal:            false
=====> staging-api ssl information
       Ssl dir:                       /home/dokku/staging-api/tls
       Ssl enabled:                   true
       Ssl hostnames:                 api.polygence.dev geo-api.polygence.dev
       Ssl expires at:                Dec  9 08:31:42 2024 GMT
       Ssl issuer:                    C = US, O = Let's Encrypt, CN = E6
       Ssl starts at:                 Sep 10 08:31:43 2024 GMT
       Ssl subject:                   subject=CN = api.polygence.dev
       Ssl verified:                  verified by a certificate authority
=====> staging-api 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:
=====> staging-api docker options information
       Docker options build:          --link dokku.postgres.staging-db:dokku-postgres-staging-db --link dokku.redis.staging-redis:dokku-redis-staging-redis
       Docker options deploy:         --link dokku.postgres.staging-db:dokku-postgres-staging-db --link dokku.redis.staging-redis:dokku-redis-staging-redis --restart=on-failure:10
       Docker options run:            --link dokku.postgres.staging-db:dokku-postgres-staging-db --link dokku.redis.staging-redis:dokku-redis-staging-redis
=====> staging-api domains information
       Domains app enabled:           true
       Domains app vhosts:            api.polygence.dev geo-api.polygence.dev
       Domains global enabled:        true
       Domains global vhosts:         polygence.dev
=====> staging-api git information
       Git deploy branch:             master
       Git global deploy branch:      master
       Git keep git dir:              false
       Git rev env var:               GIT_REV
       Git sha:                       73409a72f9824e255f8d11b135f81ee9f84d730b
       Git source image:              polygence/polygence-python-image-staging:14fede09288466d676836c64673981b4cb7fbb5c
       Git last updated at:           1727690537
=====> staging-api haproxy information
       Haproxy image:                 byjg/easy-haproxy:4.4.0
       Haproxy letsencrypt email:
       Haproxy letsencrypt server:    https://acme-v02.api.letsencrypt.org/directory
       Haproxy log level:             ERROR
=====> staging-api letsencrypt information
       Letsencrypt active:            true
       Letsencrypt autorenew:         false
       Letsencrypt computed dns provider:
       Letsencrypt global dns provider:
       Letsencrypt dns provider:
       Letsencrypt computed email:    adam@polygence.org
       Letsencrypt global email:      adam@polygence.org
       Letsencrypt email:
       Letsencrypt expiration:        1733733102
       Letsencrypt computed graceperiod: 2592000
       Letsencrypt global graceperiod:
       Letsencrypt graceperiod:
       Letsencrypt computed lego docker args:
       Letsencrypt global lego docker args:
       Letsencrypt lego docker args:
       Letsencrypt computed server:   https://acme-v02.api.letsencrypt.org/directory
       Letsencrypt global server:
       Letsencrypt server:
=====> staging-api logs information
       Logs computed max size:        10m
       Logs global max size:          10m
       Logs global vector sink:
       Logs max size:
       Logs vector global image:      timberio/vector:0.39.0-debian
       Logs vector sink:
=====> staging-api maintenance information
       Maintenance enabled:           false
=====> staging-api network information
       Network attach post create:           staging-network
       Network attach post deploy:
       Network bind all interfaces:          false
       Network computed attach post create:  staging-network
       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.9:5000
=====> staging-api nginx information
       Nginx access log format:
       Nginx computed access log format:
       Nginx global access log format:
       Nginx access log path:
       Nginx computed access log path: /var/log/nginx/staging-api-access.log
       Nginx global access log path:  /var/log/nginx/staging-api-access.log
       Nginx bind address ipv4:
       Nginx computed bind address ipv4:
       Nginx global bind address ipv4:
       Nginx bind address ipv6:
       Nginx computed bind address ipv6: ::
       Nginx global bind address ipv6: ::
       Nginx client max body size:    500m
       Nginx computed client max body size: 500m
       Nginx global client max body size: 1m
       Nginx disable custom config:
       Nginx computed disable custom config: false
       Nginx global disable custom config: false
       Nginx error log path:
       Nginx computed error log path: /var/log/nginx/staging-api-error.log
       Nginx global error log path:   /var/log/nginx/staging-api-error.log
       Nginx hsts include subdomains:
       Nginx computed hsts include subdomains: true
       Nginx global hsts include subdomains: true
       Nginx hsts max age:
       Nginx computed hsts max age:   15724800
       Nginx global hsts max age:     15724800
       Nginx hsts preload:
       Nginx computed hsts preload:   false
       Nginx global hsts preload:     false
       Nginx hsts:
       Nginx computed hsts:           true
       Nginx global hsts:             true
       Nginx last visited at:
       Nginx nginx conf sigil path:
       Nginx computed nginx conf sigil path: nginx.conf.sigil
       Nginx global nginx conf sigil path: nginx.conf.sigil
       Nginx proxy buffer size:
       Nginx computed proxy buffer size: 4k
       Nginx global proxy buffer size: 4k
       Nginx proxy buffering:
       Nginx computed proxy buffering: on
       Nginx global proxy buffering:  on
       Nginx proxy buffers:
       Nginx computed proxy buffers:  8 4k
       Nginx global proxy buffers:    8 4k
       Nginx proxy busy buffers size:
       Nginx computed proxy busy buffers size: 8k
       Nginx global proxy busy buffers size: 8k
       Nginx proxy read timeout:
       Nginx computed proxy read timeout: 60s
       Nginx global proxy read timeout: 60s
       Nginx underscore in headers:
       Nginx computed underscore in headers: off
       Nginx global underscore in headers: off
       Nginx x forwarded for value:
       Nginx computed x forwarded for value: $remote_addr
       Nginx global x forwarded for value: $remote_addr
       Nginx x forwarded port value:
       Nginx computed x forwarded port value: $server_port
       Nginx global x forwarded port value: $server_port
       Nginx x forwarded proto value:
       Nginx computed x forwarded proto value: $scheme
       Nginx global x forwarded proto value: $scheme
       Nginx x forwarded ssl:
       Nginx computed x forwarded ssl:
       Nginx global x forwarded ssl:
=====> staging-api openresty information
       Openresty access log format:
       Openresty access log path:     /var/log/nginx/staging-api-access.log
       Openresty allowed letsencrypt domains func base64: cmV0dXJuIHRydWUK
       Openresty bind address ipv4:
       Openresty bind address ipv6:   ::
       Openresty client max body size:
       Openresty error log path:      /var/log/nginx/staging-api-error.log
       Openresty global hsts:         true
       Openresty computed hsts:       true
       Openresty hsts:
       Openresty hsts include subdomains: true
       Openresty hsts max age:        15724800
       Openresty hsts preload:        false
       Openresty image:               dokku/openresty-docker-proxy:0.8.0
       Openresty letsencrypt email:
       Openresty letsencrypt server:  https://acme-v02.api.letsencrypt.org/directory
       Openresty proxy buffer size:   4k
       Openresty proxy buffering:     on
       Openresty proxy buffers:       8 4k
       Openresty proxy busy buffers size: 8k
       Openresty proxy read timeout:  60s
       Openresty underscore in headers: off
       Openresty x forwarded for value: $remote_addr
       Openresty x forwarded port value: $server_port
       Openresty x forwarded proto value: $scheme
       Openresty x forwarded ssl:
=====> staging-api ports information
       Ports map:
       Ports map detected:            http:80:5000 https:443:5000
=====> staging-api proxy information
       Proxy computed type:           nginx
       Proxy enabled:                 true
       Proxy global type:             nginx
       Proxy type:
=====> staging-api ps information
       Deployed:                      true
       Processes:                     3
       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 beat 1:                 running (CID: 467d5c7ee6e)
       Status web 1:                  running (CID: eabaa754d82)
       Status worker 1:               running (CID: 12029ca46b3)
=====> staging-api registry information
       Registry computed image repo:        dokku/staging-api
       Registry computed push on release:   false
       Registry computed server:
       Registry global image repo template:
       Registry global push on release:
       Registry global server:
       Registry image repo:
       Registry push extra tags:
       Registry push on release:
       Registry server:
       Registry tag version:
=====> staging-api resource information
=====> staging-api scheduler information
       Scheduler computed selected:   docker-local
       Scheduler global selected:     docker-local
       Scheduler selected:
=====> staging-api scheduler-docker-local information
       Scheduler docker local init process: true
       Scheduler docker local parallel schedule count:
=====> staging-api scheduler-k3s information
       Scheduler k3s computed deploy timeout:       300s
       Scheduler k3s computed image pull secrets:
       Scheduler k3s computed letsencrypt server:   prod
       Scheduler k3s computed namespace:            default
       Scheduler k3s computed rollback on failure:  false
       Scheduler k3s deploy timeout:
       Scheduler k3s global deploy timeout:         300s
       Scheduler k3s global image pull secrets:
       Scheduler k3s global ingress class:          nginx
       Scheduler k3s global kube context:
       Scheduler k3s global kubeconfig path:        /etc/rancher/k3s/k3s.yaml
       Scheduler k3s global letsencrypt email prod:
       Scheduler k3s global letsencrypt email stag:
       Scheduler k3s global letsencrypt server:     prod
       Scheduler k3s global namespace:              default
       Scheduler k3s global network interface:      eth0
       Scheduler k3s global rollback on failure:    false
       Scheduler k3s image pull secrets:
       Scheduler k3s letsencrypt server:
       Scheduler k3s namespace:
       Scheduler k3s rollback on failure:
=====> staging-api storage information
       Storage build mounts:
       Storage deploy mounts:
       Storage run mounts:
=====> staging-api traefik information
       Traefik api enabled:           false
       Traefik api vhost:             traefik.dokku.me
       Traefik basic auth password:
       Traefik basic auth username:
       Traefik dashboard enabled:     false
       Traefik image:                 traefik:2.11.2
       Traefik letsencrypt email:
       Traefik letsencrypt server:    https://acme-v02.api.letsencrypt.org/directory
       Traefik log level:             ERROR
       Traefik http entry point:      http
       Traefik https entry point:     https

Additional information

Successful deploy log with git:from-image:

Run ssh dokku@polygence.dev git:from-image staging-api polygence/polygence-python-image-staging:cbc663ab4a7b598a0db7a4703cef8b79c837cb9c
-----> Generating build context
       Setting Dockerfile
-----> Pulling image
cbc663ab4a7b598a0db7a4703cef8b79c837cb9c: Pulling from polygence/polygence-python-image-staging
a2318d6c47ec: Already exists
334af29dc78e: Already exists
d534b3df1e9e: Already exists
95b5b248c442: Already exists
98d167576f7c: Already exists
60387d2bdb8d: Already exists
2f513b3e06b5: Already exists
4f4fb700ef54: Already exists
220a4d4e7e77: Already exists
4c884a02d22d: Already exists
5df2a6f285d4: Pulling fs layer
30976e77cc14: Pulling fs layer
5df2a6f285d4: Verifying Checksum
5df2a6f285d4: Download complete
30976e77cc14: Verifying Checksum
30976e77cc14: Download complete
5df2a6f285d4: Pull complete
30976e77cc14: Pull complete
Digest: sha256:643c9a11d157c5911614b9042021c949e1d4635152617d84a349ac972e722a60
Status: Downloaded newer image for polygence/polygence-python-image-staging:cbc663ab4a7b598a0db7a4703cef8b79c837cb9c
docker.io/polygence/polygence-python-image-staging:cbc663ab4a7b598a0db7a4703cef8b79c837cb9c
-----> Updating git repository with specified build context
From /tmp/dokku-3093009-trigger-git-git-from-directory.8wOZJk
   83292e9..aadf819  master        -> master
   ac1b87f..83292e9  origin/master -> origin/master
-----> Cleaning up...
-----> Building staging-api from Dockerfile
#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 266B done
#1 DONE 0.0s

#2 [internal] load .dockerignore
#2 transferring context: 2B done
#2 DONE 0.0s

#3 [internal] load metadata for docker.io/polygence/polygence-python-image-staging:cbc663ab4a7b598a0db7a4703cef8b79c837cb9c
#3 DONE 0.0s

#4 [1/1] FROM docker.io/polygence/polygence-python-image-staging:cbc663ab4a7b598a0db7a4703cef8b79c837cb9c
#4 DONE 0.1s

#5 exporting to image
#5 exporting layers done
#5 writing image sha256:017917c1283a38f38ffeebd52710653fc415d07f55839c53eddfe7d11b530596 done
#5 naming to docker.io/dokku/staging-api:latest done
#5 DONE 0.0s
-----> Releasing staging-api...
-----> Checking for predeploy task
       No predeploy task found, skipping
-----> Checking for release task
       Executing release task from Procfile in ephemeral container: poetry run python manage.py migrate
=====> Start of staging-api release task (fd72edce9) output
 !     System check identified some issues:
 !     WARNINGS:
 !     backend.Invitation.products: (fields.W340) null has no effect on ManyToManyField.
         . sitecontent.tasks.check_published_project_links
         . sitecontent.tasks.check_team_members_anniversaries
         . survey.tasks.calculate_excellent_student_review_ratings_for
         . survey.tasks.handle_support_widget_submission
         . zeus.tasks.check_for_missing_interview_zoom_recordings
         . zeus.tasks.create_zendesk_ticket_on_free_pss_channel_change
         . zeus.tasks.notify_partnerships_on_student_converted_to_partner_pays_workflow
         . zeus.tasks.prospective_mentor_interview_invite_reminder
         . zeus.tasks.run_script
         . zeus.tasks.sync_prospective_student_to_hubspot
       [2024-09-30 08:39:47,945: INFO/MainProcess] Connected to redis://:**@dokku-redis-staging-redis:6379//
       [2024-09-30 08:39:47,946: INFO/MainProcess] mingle: searching for neighbors
       [2024-09-30 08:39:48,954: INFO/MainProcess] mingle: sync with 1 nodes
       [2024-09-30 08:39:48,955: INFO/MainProcess] mingle: sync complete
       [2024-09-30 08:39:49,197: INFO/MainProcess] celery@3c82585e0a35 ready.
=====> End of staging-api container output (3c82585e0a35 worker.1)
       Scheduling old container shutdown in 60 seconds (worker.1)
-----> Running post-deploy
-----> Ensuring network configuration is in sync for staging-api
-----> Configuring api.polygence.dev...(using built-in template)
-----> Configuring geo-api.polygence.dev...(using built-in template)
-----> Creating https nginx.conf
       Enabling HSTS (using built-in template)
       Reloading nginx
-----> Renaming containers
       Found previous container(s) (901af97cc03e) named staging-api.beat.1
       Renaming container (901af97cc03e) staging-api.beat.1 to staging-api.beat.1.1727685593
       Renaming container staging-api.beat.1.upcoming-10508 (dd2de2d81bae) to staging-api.beat.1
       Found previous container(s) (5d719967e957) named staging-api.web.1
       Renaming container (5d719967e957) staging-api.web.1 to staging-api.web.1.1727685593
       Renaming container staging-api.web.1.upcoming-3800 (bb1a3401136b) to staging-api.web.1
       Found previous container(s) (e49715af872a) named staging-api.worker.1
       Renaming container (e49715af872a) staging-api.worker.1 to staging-api.worker.1.1727685593
       Renaming container staging-api.worker.1.upcoming-7036 (3c82585e0a35) to staging-api.worker.1
-----> Checking for postdeploy task
       No postdeploy task found, skipping
-----> Shutting down old containers in 60 seconds
=====> Application deployed:
       http://api.polygence.dev/
       http://geo-api.polygence.dev/
       https://api.polygence.dev/
       https://geo-api.polygence.dev/

Output of failing commands after running: dokku trace:off

Run ssh dokku@polygence.dev ps:rebuild staging-api
-----> Cleaning up...
-----> Building staging-api from Dockerfile
#1 [internal] load .dockerignore
#1 transferring context: 2B done
#1 DONE 0.0s

#2 [internal] load build definition from Dockerfile
#2 transferring dockerfile: 266B done
#2 DONE 0.0s

#3 [internal] load metadata for docker.io/polygence/polygence-python-image-staging:cbc663ab4a7b598a0db7a4703cef8b79c837cb9c
#3 ...

#4 [auth] polygence/polygence-python-image-staging:pull token for registry-1.docker.io
#4 DONE 0.0s

#3 [internal] load metadata for docker.io/polygence/polygence-python-image-staging:cbc663ab4a7b598a0db7a4703cef8b79c837cb9c
#3 DONE 0.9s

#5 [1/1] FROM docker.io/polygence/polygence-python-image-staging:cbc663ab4a7b598a0db7a4703cef8b79c837cb9c@sha256:643c9a11d157c5911614b9042021c949e1d4635152617d84a349ac972e722a60
#5 resolve docker.io/polygence/polygence-python-image-staging:cbc663ab4a7b598a0db7a4703cef8b79c837cb9c@sha256:643c9a11d157c5911614b9042021c949e1d4635152617d84a349ac972e722a60 done
#5 sha256:643c9a11d157c5911614b9042021c949e1d4635152617d84a349ac972e722a60 2.85kB / 2.85kB done
#5 sha256:85a772fa0a36955f53f978fa5248ae3d460b35845ede7302278e411ee09a626a 10.06kB / 10.06kB done
#5 DONE 0.2s

#6 exporting to image
#6 exporting layers done
#6 writing image sha256:017917c1283a38f38ffeebd52710653fc415d07f55839c53eddfe7d11b530596 done
#6 naming to docker.io/dokku/staging-api:latest done
#6 DONE 0.0s
-----> Releasing staging-api...
-----> Checking for predeploy task
       No predeploy task found, skipping
-----> Checking for release task
       No release task found, skipping
=====> Processing deployment checks
 !     No healthchecks found in app.json for web process type
       No web healthchecks found in app.json. Simple container checks will be performed.
       For more efficient zero downtime deployments, add healthchecks to your app.json. See https://dokku.com/docs/deployment/zero-downtime-deploys/ for examples
-----> Deploying staging-api via the docker-local scheduler...
-----> Deploying web (count=1)
       Attempting pre-flight checks (web.1)
 !     Container state: exited
75102ac96f67ff08f4f6cedaa5e6c4a474e9f550b2425b4dfcab32423a13ae8a
 !     Could not start due to 1 failed checks (web.1)
=====> Start of staging-api container output (75102ac96f67 web.1)
=====> End of staging-api container output (75102ac96f67 web.1)
=====> Start of staging-api container output (75102ac96f67 web.1)
=====> End of staging-api container output (75102ac96f67 web.1)
parallel: This job failed:
/var/lib/dokku/plugins/available/scheduler-docker-local/bin/scheduler-deploy-process-container staging-api dockerfile dokku/staging-api:latest latest web 1 1
 !     #1 [internal] load .dockerignore
#1 transferring context: 2B done
#1 DONE 0.0s

#2 [internal] load build definition from Dockerfile
#2 transferring dockerfile: 266B done
#2 DONE 0.0s

#3 [internal] load metadata for docker.io/polygence/polygence-python-image-staging:cbc663ab4a7b598a0db7a4703cef8b79c837cb9c
#3 ...

#4 [auth] polygence/polygence-python-image-staging:pull token for registry-1.docker.io
#4 DONE 0.0s

#3 [internal] load metadata for docker.io/polygence/polygence-python-image-staging:cbc663ab4a7b598a0db7a4703cef8b79c837cb9c
#3 DONE 0.9s

#5 [1/1] FROM docker.io/polygence/polygence-python-image-staging:cbc663ab4a7b598a0db7a4703cef8b79c837cb9c@sha256:643c9a11d157c5911614b9042021c949e1d4635152617d84a349ac972e722a60
#5 resolve docker.io/polygence/polygence-python-image-staging:cbc663ab4a7b598a0db7a4703cef8b79c837cb9c@sha256:643c9a11d157c5911614b9042021c949e1d4635152617d84a349ac972e722a60 done
#5 sha256:643c9a11d157c5911614b9042021c949e1d4635152617d84a349ac972e722a60 2.85kB / 2.85kB done
#5 sha256:85a772fa0a36955f53f978fa5248ae3d460b35845ede7302278e411ee09a626a 10.06kB / 10.06kB done
#5 DONE 0.2s

#6 exporting to image
#6 exporting layers done
#6 writing image sha256:017917c1283a38f38ffeebd52710653fc415d07f55839c53eddfe7d11b530596 done
#6 naming to docker.io/dokku/staging-api:latest done
#6 DONE 0.0s
 !     No healthchecks found in app.json for web process type
 !     Container state: exited
 !     Could not start due to 1 failed checks (web.1)
parallel: This job failed:
/var/lib/dokku/plugins/available/scheduler-docker-local/bin/scheduler-deploy-process-container staging-api dockerfile dokku/staging-api:latest latest web 1 1

Output of failing commands after running: dokku trace:on

No response

@josegonzalez
Copy link
Member

Sample dockerfile:

ARG PYTHON_VERSION
FROM python:${PYTHON_VERSION}-slim-bookworm

ENV USER user
ENV WORKDIR /usr/user/workdir
ENV HOME /usr/user
ENV PATH ${HOME}/.local/bin:$PATH

RUN apt-get update && \
    apt-get upgrade --assume-yes && \
    apt-get install --assume-yes --no-install-recommends libpq-dev build-essential && \
    apt-get autoclean; apt-get autoremove && \
    useradd -d ${HOME} -m -s /bin/bash -r ${USER}

USER ${USER}

ARG POETRY_VERSION
RUN mkdir -p ${WORKDIR} && \
    pip install --user --prefer-binary --no-warn-script-location --disable-pip-version-check --no-cache-dir poetry==${POETRY_VERSION}

WORKDIR ${WORKDIR}

COPY --chown=user ./api/poetry.toml ./api/poetry.lock ./api/pyproject.toml ./

RUN poetry install

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

No branches or pull requests

3 participants
@josegonzalez @adamgyulavari and others