[Bug] Deploying old app versions doesn't work if compose-files don't match with latest main commit #617

Closed
opened 2024-06-14 14:38:12 +00:00 by simon · 3 comments
Member

Issue

Deploying old app versions doesn't work if compose-files don't match with latest main commit.

Steps to reproduce

With: https://git.coopcloud.tech/coop-cloud/nextcloud

  1. Delete compose.apps.yml
  2. Perform a local commit
  3. app deploy -n --debug --force --no-converge-checks <domain> 5.0.3+27.0.1-fpm
  4. FATA[0001] stat /home/sth/.abra/recipes/nextcloud/compose.apps.yml: no such file or directory

What's happening?

DEBU[0003] COMPOSE_FILE detected (compose.yml:compose.mariadb.yml:compose.smtp.yml:compose.apps.yml:compose.authentik.yml), loading compose.yml, compose.mariadb.yml, compose.smtp.yml, compose.apps.yml, compose.authentik.yml  caller="/home/user/abra/pkg/config/app.go:514 GetComposeFiles"
DEBU[0003] retrieved /home/user/.abra/recipes/nextcloud/compose.yml, /home/user/.abra/recipes/nextcloud/compose.mariadb.yml, /home/user/.abra/recipes/nextcloud/compose.smtp.yml, /home/user/.abra/recipes/nextcloud/compose.apps.yml, /home/user/.abra/recipes/nextcloud/compose.authentik.yml configs for nextcloud  caller="/home/user/abra/pkg/config/app.go:515 GetComposeFiles"

is beeing executed before this happens:

DEBU[0003] successfully checked nextcloud out to 5.0.3+27.0.1-fpm in /home/user/.abra/recipes/nextcloud  caller="/home/user/abra/pkg/recipe/recipe.go:353 EnsureVersion"

Afterwards this is executed:

DEBU[0003] COMPOSE_FILE detected (compose.yml:compose.mariadb.yml:compose.smtp.yml:compose.apps.yml:compose.authentik.yml), loading compose.yml, compose.mariadb.yml, compose.smtp.yml, compose.apps.yml, compose.authentik.yml  caller="/home/user/abra/pkg/config/app.go:514 GetComposeFiles"
DEBU[0003] retrieved /home/user/.abra/recipes/nextcloud/compose.yml, /home/user/.abra/recipes/nextcloud/compose.mariadb.yml, /home/user/.abra/recipes/nextcloud/compose.smtp.yml, /home/user/.abra/recipes/nextcloud/compose.apps.yml, /home/user/.abra/recipes/nextcloud/compose.authentik.yml configs for nextcloud  caller="/home/user/abra/pkg/config/app.go:515 GetComposeFiles"
DEBU[0003] retrieved /home/user/.abra/recipes/nextcloud/compose.yml for files.dev.local-it.cloud  caller="/home/user/abra/pkg/config/app.go:529 GetAppComposeConfig"

Possible solution?

Don't call GetComposeFiles before EnsureVersion

## Issue Deploying old app versions doesn't work if compose-files don't match with latest main commit. ## Steps to reproduce With: https://git.coopcloud.tech/coop-cloud/nextcloud 1. Delete compose.apps.yml 2. Perform a local commit 3. `app deploy -n --debug --force --no-converge-checks <domain> 5.0.3+27.0.1-fpm` 4. `FATA[0001] stat /home/sth/.abra/recipes/nextcloud/compose.apps.yml: no such file or directory` ## What's happening? ``` DEBU[0003] COMPOSE_FILE detected (compose.yml:compose.mariadb.yml:compose.smtp.yml:compose.apps.yml:compose.authentik.yml), loading compose.yml, compose.mariadb.yml, compose.smtp.yml, compose.apps.yml, compose.authentik.yml caller="/home/user/abra/pkg/config/app.go:514 GetComposeFiles" DEBU[0003] retrieved /home/user/.abra/recipes/nextcloud/compose.yml, /home/user/.abra/recipes/nextcloud/compose.mariadb.yml, /home/user/.abra/recipes/nextcloud/compose.smtp.yml, /home/user/.abra/recipes/nextcloud/compose.apps.yml, /home/user/.abra/recipes/nextcloud/compose.authentik.yml configs for nextcloud caller="/home/user/abra/pkg/config/app.go:515 GetComposeFiles" ``` is beeing executed before this happens: ``` DEBU[0003] successfully checked nextcloud out to 5.0.3+27.0.1-fpm in /home/user/.abra/recipes/nextcloud caller="/home/user/abra/pkg/recipe/recipe.go:353 EnsureVersion" ``` Afterwards this is executed: ``` DEBU[0003] COMPOSE_FILE detected (compose.yml:compose.mariadb.yml:compose.smtp.yml:compose.apps.yml:compose.authentik.yml), loading compose.yml, compose.mariadb.yml, compose.smtp.yml, compose.apps.yml, compose.authentik.yml caller="/home/user/abra/pkg/config/app.go:514 GetComposeFiles" DEBU[0003] retrieved /home/user/.abra/recipes/nextcloud/compose.yml, /home/user/.abra/recipes/nextcloud/compose.mariadb.yml, /home/user/.abra/recipes/nextcloud/compose.smtp.yml, /home/user/.abra/recipes/nextcloud/compose.apps.yml, /home/user/.abra/recipes/nextcloud/compose.authentik.yml configs for nextcloud caller="/home/user/abra/pkg/config/app.go:515 GetComposeFiles" DEBU[0003] retrieved /home/user/.abra/recipes/nextcloud/compose.yml for files.dev.local-it.cloud caller="/home/user/abra/pkg/config/app.go:529 GetAppComposeConfig" ``` ## Possible solution? Don't call GetComposeFiles before EnsureVersion
simon added the
bug
label 2024-06-14 14:38:12 +00:00
simon added this to the (deleted) project 2024-06-14 14:38:13 +00:00
Owner

@simon I'm not sure I understand what you're goal was here. You make a local commit and then don't use --chaos but pass a version. Shouldn't abra check out 5.0.3+27.0.1-fpm and the files should all be there? If youre COMPOSE_FILES=... has a file that doesn't exist in the old version then I expect this error? Apologies, I think I'm missing something here.

Also, a note on process for using the "Critical fixes" project, please see R010: "The process for adding a ticket to the board requires getting confirmation from at least one other member of the federation." This is usually done in the Fedi/Tech chats on Matrix.

@simon I'm not sure I understand what you're goal was here. You make a local commit and then don't use `--chaos` but pass a version. Shouldn't `abra` check out `5.0.3+27.0.1-fpm` and the files should all be there? If youre `COMPOSE_FILES=...` has a file that doesn't exist in the old version then I expect this error? Apologies, I think I'm missing something here. Also, a note on process for using the "Critical fixes" project, please see [R010](https://docs.coopcloud.tech/federation/resolutions/passed/010/#details-budget-004): "The process for adding a ticket to the board requires getting confirmation from at least one other member of the federation." This is usually done in the Fedi/Tech chats on Matrix.
decentral1se added the
abra
awaiting-feedback
labels 2024-06-16 18:44:10 +00:00
Author
Member

@decentral1se My goal was to redeploy a nextcloud-deployment with a different configuration but the same version as previously deployed. But at the same time I was working on the nextcloud recipe due to a completely unrelated issue, including local changes I had to commit to provide a clean working environment for abra.

And you're right, abra should check out 5.0.3+27.0.1-fpm but it doesn't, as it maps the compose from the config with the latest main commit, doesn't find the compose.apps.yml anymore and crashed, before even beeing able to check out 5.0.3+27.0.1-fpm.

You should be able ro reproduce this as described above and abra should return an error on a missing compose.apps.yml

Expected behavior is that abra doesn't miss that compose.apps.yml as it clearly is available in 5.0.3+27.0.1-fpm

And thanks on the note to "Critical fixes". I think in the meantime, @3wordchant too voted for this.

@decentral1se My goal was to redeploy a nextcloud-deployment with a different configuration but the same version as previously deployed. But at the same time I was working on the nextcloud recipe due to a completely unrelated issue, including local changes I had to commit to provide a clean working environment for abra. And you're right, `abra` should check out `5.0.3+27.0.1-fpm` but it doesn't, as it maps the compose from the config with the latest `main` commit, doesn't find the `compose.apps.yml` anymore and crashed, before even beeing able to check out `5.0.3+27.0.1-fpm`. You should be able ro reproduce this as described above and abra should return an error on a missing compose.apps.yml Expected behavior is that abra doesn't miss that compose.apps.yml as it clearly is available in `5.0.3+27.0.1-fpm` And thanks on the note to "Critical fixes". I think in the meantime, @3wordchant too voted for this.
decentral1se removed the
awaiting-feedback
label 2024-06-19 17:06:06 +00:00
Owner

@simon lemme know what you think of coop-cloud/abra#411 🙏

@simon lemme know what you think of https://git.coopcloud.tech/coop-cloud/abra/pulls/411 🙏
Sign in to join this conversation.
No description provided.