'app deploy' reports ''wordpress' has locally unstaged changes' when it doesn't #226

Closed
opened 2021-11-01 09:29:11 +00:00 by 3wordchant · 9 comments
Owner

Trying to redeploy an app, seeing FATA[0005] wordpress has locally unstaged changes, but

➜ cd ~/.abra/apps/wordpress/ && git status
On branch master
Your branch is up to date with origin/master.

nothing to commit, working tree clean
Trying to redeploy an app, seeing `FATA[0005] wordpress has locally unstaged changes`, but ``` ➜ cd ~/.abra/apps/wordpress/ && git status On branch master Your branch is up to date with origin/master. nothing to commit, working tree clean ```
3wordchant added the
bug
abra
labels 2021-11-01 09:29:11 +00:00
Owner

Couldn't reproduce but added debug logging in case we run into again.

Couldn't reproduce but added debug logging in case we run into again.
Author
Owner

I think your debug logging found the problem!

DEBU[0007] discovered git status for oasis repository: ?? .compose.yml.swp  caller="/home/user/Projects/Autonomic/CoopCloud/abra/pkg/git/read.go:49 IsClean"
FATA[0007] 'oasis' has locally unstaged changes          caller="/home/user/Projects/Autonomic/CoopCloud/abra/cli/catalogue/generate.go:139 glob..func1.1" stack="/home/user/Projects/Autonomic/CoopCloud/abra/cli/catalogue/generate.go:139 glob..func1.1\n/usr/lib/golang/src/runtime/asm_amd64.s:1371                            goexit"

I have a global ~/.gitignore file which excludes vim swapfiles. ~/.gitconfig:

[core]
	excludesFile = ~/.gitignore

~/.gitignore:

*.swp
*.swo

Is it possible that abra isn't picking up that config?

I think your debug logging found the problem! ``` DEBU[0007] discovered git status for oasis repository: ?? .compose.yml.swp caller="/home/user/Projects/Autonomic/CoopCloud/abra/pkg/git/read.go:49 IsClean" FATA[0007] 'oasis' has locally unstaged changes caller="/home/user/Projects/Autonomic/CoopCloud/abra/cli/catalogue/generate.go:139 glob..func1.1" stack="/home/user/Projects/Autonomic/CoopCloud/abra/cli/catalogue/generate.go:139 glob..func1.1\n/usr/lib/golang/src/runtime/asm_amd64.s:1371 goexit" ``` I have a global `~/.gitignore` file which excludes vim swapfiles. `~/.gitconfig`: ``` [core] excludesFile = ~/.gitignore ``` `~/.gitignore`: ``` *.swp *.swo ``` Is it possible that abra isn't picking up that config?
Owner

Global excludefiles gets taken into account now for IsClean call as far as I can tell. It seems like setting Force: True on the check outs is just causing misery so I switched that off for now (commit linked above too).

Global `excludefiles` gets taken into account now for `IsClean` call as far as I can tell. It seems like setting `Force: True` on the check outs is just causing misery so I switched that off for now (commit linked above too).
Author
Owner

Now I get a crash, weirdly on the Wordpress repo again 😬

The debugging output I added says that getExcludesFile(cfg) is getting an empty response 🤔

abra -d catalogue generate wordpress
DEBU[0000] '/home/f/.abra' already created, moving on...  caller="/home/f/Projects/Autonomic/CoopCloud/abra/cli/cli.go:90 newAbraApp.func1"
DEBU[0000] '/home/f/.abra/servers' already created, moving on...  caller="/home/f/Projects/Autonomic/CoopCloud/abra/cli/cli.go:90 newAbraApp.func1"
DEBU[0000] '/home/f/.abra/apps' already created, moving on...  caller="/home/f/Projects/Autonomic/CoopCloud/abra/cli/cli.go:90 newAbraApp.func1"
DEBU[0000] '/home/f/.abra/vendor' already created, moving on...  caller="/home/f/Projects/Autonomic/CoopCloud/abra/cli/cli.go:90 newAbraApp.func1"
DEBU[0000] abra version 'dev', commit '60de918e5027af3ec86d599c333d5506abd581c1'  caller="/home/f/Projects/Autonomic/CoopCloud/abra/cli/cli.go:96 newAbraApp.func1"
DEBU[0000] read 'map[DOMAIN:wordpress.example.com LETS_ENCRYPT_ENV:production SECRET_DB_PASSWORD_VERSION:v1 SECRET_DB_ROOT_PASSWORD_VERSION:v1 TYPE:wordpress]' from '/home/f/.abra/apps/wordpress/.env.sample'  caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/config/env.go:46 ReadEnv"
DEBU[0000] validated 'wordpress' as recipe argument      caller="/home/f/Projects/Autonomic/CoopCloud/abra/cli/internal/validate.go:37 ValidateRecipe"
DEBU[0000] '/home/f/.abra/catalogue' already exists, doing nothing  caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/git/clone.go:37 Clone"
DEBU[0000] fetching repo metadata from 'https://git.coopcloud.tech/api/v1/orgs/coop-cloud/repos?page=1'  caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/catalogue/catalogue.go:357 ReadReposMetadata"
DEBU[0000] [DEBUG] GET https://git.coopcloud.tech/api/v1/orgs/coop-cloud/repos?page=1  caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/web/client.go:15 customLeveledLogger.Printf"
DEBU[0002] fetching repo metadata from 'https://git.coopcloud.tech/api/v1/orgs/coop-cloud/repos?page=2'  caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/catalogue/catalogue.go:357 ReadReposMetadata"
DEBU[0002] [DEBUG] GET https://git.coopcloud.tech/api/v1/orgs/coop-cloud/repos?page=2  caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/web/client.go:15 customLeveledLogger.Printf"
DEBU[0004] fetching repo metadata from 'https://git.coopcloud.tech/api/v1/orgs/coop-cloud/repos?page=3'  caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/catalogue/catalogue.go:357 ReadReposMetadata"
DEBU[0004] [DEBUG] GET https://git.coopcloud.tech/api/v1/orgs/coop-cloud/repos?page=3  caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/web/client.go:15 customLeveledLogger.Printf"
DEBU[0006] fetching repo metadata from 'https://git.coopcloud.tech/api/v1/orgs/coop-cloud/repos?page=4'  caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/catalogue/catalogue.go:357 ReadReposMetadata"
DEBU[0006] [DEBUG] GET https://git.coopcloud.tech/api/v1/orgs/coop-cloud/repos?page=4  caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/web/client.go:15 customLeveledLogger.Printf"
DEBU[0008] fetching repo metadata from 'https://git.coopcloud.tech/api/v1/orgs/coop-cloud/repos?page=5'  caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/catalogue/catalogue.go:357 ReadReposMetadata"
DEBU[0008] [DEBUG] GET https://git.coopcloud.tech/api/v1/orgs/coop-cloud/repos?page=5  caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/web/client.go:15 customLeveledLogger.Printf"
DEBU[0009] ensuring '114' recipe(s) are locally present and up-to-date  caller="/home/f/Projects/Autonomic/CoopCloud/abra/cli/catalogue/generate.go:110 glob..func1"
DEBU[0009] '/home/f/.abra/apps/wordpress' already exists, doing nothing  caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/git/clone.go:37 Clone"                                                                                     
retrieving recipes...  65% |██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████                                                                     | (75/114) DEBU[0009] opening /home/f/.abra/apps/wordpress          caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/git/read.go:39 IsClean"
DEBU[0009] fetching worktree                             caller="/home/f/Projects/Autonomic/CoopCloud/abra/cli/catalogue/generate.go:137 glob..func1.1"                                                                                   
DEBU[0009] getting exclude files                         caller="/home/f/Projects/Autonomic/CoopCloud/abra/cli/catalogue/generate.go:137 glob..func1.1"
DEBU[0009] found exclude file ''                         caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/git/read.go:83 GetExcludesFiles"                                                                                           
retrieving recipes...  71% |██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████                                                         | (82/114) FATA[0009] open : no such file or directory              caller="/home/f/Projects/Autonomic/CoopCloud/abra/cli/catalogue/generate.go:139 glob..func1.1" stack="/home/f/Projects/Autonomic/CoopCloud/abra/cli/catalogue/generate.go:139 glob..func1.1\n/usr/lib/golang/src/runtime/asm_amd64.s:1371                            goexit"
Now I get a crash, weirdly on the Wordpress repo again 😬 The debugging output I added says that `getExcludesFile(cfg)` is getting an empty response 🤔 ``` abra -d catalogue generate wordpress DEBU[0000] '/home/f/.abra' already created, moving on... caller="/home/f/Projects/Autonomic/CoopCloud/abra/cli/cli.go:90 newAbraApp.func1" DEBU[0000] '/home/f/.abra/servers' already created, moving on... caller="/home/f/Projects/Autonomic/CoopCloud/abra/cli/cli.go:90 newAbraApp.func1" DEBU[0000] '/home/f/.abra/apps' already created, moving on... caller="/home/f/Projects/Autonomic/CoopCloud/abra/cli/cli.go:90 newAbraApp.func1" DEBU[0000] '/home/f/.abra/vendor' already created, moving on... caller="/home/f/Projects/Autonomic/CoopCloud/abra/cli/cli.go:90 newAbraApp.func1" DEBU[0000] abra version 'dev', commit '60de918e5027af3ec86d599c333d5506abd581c1' caller="/home/f/Projects/Autonomic/CoopCloud/abra/cli/cli.go:96 newAbraApp.func1" DEBU[0000] read 'map[DOMAIN:wordpress.example.com LETS_ENCRYPT_ENV:production SECRET_DB_PASSWORD_VERSION:v1 SECRET_DB_ROOT_PASSWORD_VERSION:v1 TYPE:wordpress]' from '/home/f/.abra/apps/wordpress/.env.sample' caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/config/env.go:46 ReadEnv" DEBU[0000] validated 'wordpress' as recipe argument caller="/home/f/Projects/Autonomic/CoopCloud/abra/cli/internal/validate.go:37 ValidateRecipe" DEBU[0000] '/home/f/.abra/catalogue' already exists, doing nothing caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/git/clone.go:37 Clone" DEBU[0000] fetching repo metadata from 'https://git.coopcloud.tech/api/v1/orgs/coop-cloud/repos?page=1' caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/catalogue/catalogue.go:357 ReadReposMetadata" DEBU[0000] [DEBUG] GET https://git.coopcloud.tech/api/v1/orgs/coop-cloud/repos?page=1 caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/web/client.go:15 customLeveledLogger.Printf" DEBU[0002] fetching repo metadata from 'https://git.coopcloud.tech/api/v1/orgs/coop-cloud/repos?page=2' caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/catalogue/catalogue.go:357 ReadReposMetadata" DEBU[0002] [DEBUG] GET https://git.coopcloud.tech/api/v1/orgs/coop-cloud/repos?page=2 caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/web/client.go:15 customLeveledLogger.Printf" DEBU[0004] fetching repo metadata from 'https://git.coopcloud.tech/api/v1/orgs/coop-cloud/repos?page=3' caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/catalogue/catalogue.go:357 ReadReposMetadata" DEBU[0004] [DEBUG] GET https://git.coopcloud.tech/api/v1/orgs/coop-cloud/repos?page=3 caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/web/client.go:15 customLeveledLogger.Printf" DEBU[0006] fetching repo metadata from 'https://git.coopcloud.tech/api/v1/orgs/coop-cloud/repos?page=4' caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/catalogue/catalogue.go:357 ReadReposMetadata" DEBU[0006] [DEBUG] GET https://git.coopcloud.tech/api/v1/orgs/coop-cloud/repos?page=4 caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/web/client.go:15 customLeveledLogger.Printf" DEBU[0008] fetching repo metadata from 'https://git.coopcloud.tech/api/v1/orgs/coop-cloud/repos?page=5' caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/catalogue/catalogue.go:357 ReadReposMetadata" DEBU[0008] [DEBUG] GET https://git.coopcloud.tech/api/v1/orgs/coop-cloud/repos?page=5 caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/web/client.go:15 customLeveledLogger.Printf" DEBU[0009] ensuring '114' recipe(s) are locally present and up-to-date caller="/home/f/Projects/Autonomic/CoopCloud/abra/cli/catalogue/generate.go:110 glob..func1" DEBU[0009] '/home/f/.abra/apps/wordpress' already exists, doing nothing caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/git/clone.go:37 Clone" retrieving recipes... 65% |██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ | (75/114) DEBU[0009] opening /home/f/.abra/apps/wordpress caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/git/read.go:39 IsClean" DEBU[0009] fetching worktree caller="/home/f/Projects/Autonomic/CoopCloud/abra/cli/catalogue/generate.go:137 glob..func1.1" DEBU[0009] getting exclude files caller="/home/f/Projects/Autonomic/CoopCloud/abra/cli/catalogue/generate.go:137 glob..func1.1" DEBU[0009] found exclude file '' caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/git/read.go:83 GetExcludesFiles" retrieving recipes... 71% |██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ | (82/114) FATA[0009] open : no such file or directory caller="/home/f/Projects/Autonomic/CoopCloud/abra/cli/catalogue/generate.go:139 glob..func1.1" stack="/home/f/Projects/Autonomic/CoopCloud/abra/cli/catalogue/generate.go:139 glob..func1.1\n/usr/lib/golang/src/runtime/asm_amd64.s:1371 goexit" ```
Author
Owner

If I comment out these lines it works again:

	patterns, err := GetExcludesFiles()
	if err != nil {
		return false, err
	}
	worktree.Excludes = append(patterns, worktree.Excludes...)

But I assume back to not taking ~/.gitignore into account.

If I comment out these lines it works again: ``` patterns, err := GetExcludesFiles() if err != nil { return false, err } worktree.Excludes = append(patterns, worktree.Excludes...) ``` But I assume back to not taking `~/.gitignore` into account.
Owner

Tried to fix this again. Could you give latest another test run @3wordchant 🙏

/cc @knoflook so i don't lose you more time on some random stack trace in a coop-cloud/abra#141 round 2 🙃

Tried to fix this again. Could you give latest another test run @3wordchant 🙏 /cc @knoflook so i don't lose you more time on some random stack trace in a https://git.coopcloud.tech/coop-cloud/abra/pulls/141 round 2 🙃
Owner

btw, just in case we have different configs, here is my setup:

~/.gitconfig:

[core]
  excludesfile = ~/.gitignore_global

~/.gitignore_global:

...paths...

It reads the ~/.gitconfig first for this excludefiles config but I guess if you're not using that line, it could just try the default ~/.gitignore file? Will throw this in as well.

btw, just in case we have different configs, here is my setup: `~/.gitconfig`: ``` [core] excludesfile = ~/.gitignore_global ``` `~/.gitignore_global`: ``` ...paths... ``` It reads the `~/.gitconfig` first for this `excludefiles` config but I guess if you're not using that line, it could just try the default `~/.gitignore` file? Will throw this in as well.
Author
Owner

Yep I've got basically the same config:

[core]
	excludesFile = ~/.gitignore
	attributesfile = ~/.gitattributes

I'll test out the new change ASAP!

Yep I've got basically the same config: ``` [core] excludesFile = ~/.gitignore attributesfile = ~/.gitattributes ``` I'll test out the new change ASAP!
decentral1se added this to the Beta release (software) project 2021-12-12 17:12:23 +00:00
decentral1se added the
awaiting-feedback
label 2021-12-12 17:13:02 +00:00
Owner

I've tested this manually a few times, think it is fixed 🙏

I've tested this manually a few times, think it is fixed 🙏
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
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: coop-cloud/organising#226
No description provided.