Closed dhruvinsh closed 1 year ago
Can you try this again with 2.35.2 and 2.36.0? There are two changes that seem like they could have introduced a change: #3108 (2.36.0) and #3129 (2.36.1). If it happens with 2.35.2, then we need to dig a bit deeper to figure out the breakage.
This is definitely a bug in chezmoi caused by #3108.
chezmoi evaluates the source state concurrently for speed, and I forgot this when implementing #3108. The externals are stored in a map
, and so having multiple external files leads to the concurrent map access panic seen here.
Working on a fix now.
Edit: different issue, oops.
This is because of a hack I did avoid a deep copy of the template data when setting template-specific values (currently only .chezmoi.sourceFile
). #3155 should fix it.
I have tired the latest version, but still 1 in 3 tries it fails for me.
chezmoi: /Users/ds/.local/share/chezmoi/home/.chezmoiexternals/oh-my-zsh.yaml.tmpl: template: /Users/ds/.local/share/chezmoi/home/.chezmoiexternals/oh-my-zsh.yaml.tmpl:3:19: executing "/Users/ds/.local/share/chezmoi/home/.chezmoiexternals/oh-my-zsh.yaml.tmpl" at <.chezmoi.os>: map has no entry for key "chezmoi"
I'm unable to duplicate this error with your dotfiles in a fresh Ubuntu Docker image. I cloned at commit a3c673bf9666a10c12de72ac6e06dec3eb1df315, lightly edited .chezmoi.toml.tmpl
to remove the dependency on hostnamectl
, and ran chezmoi diff -x encrypted
.
Do you have a small cases that reproduces the problem?
Note also that this is a different error to the original one reported in this issue.
Wait, I can reproduce it myself now.
Note also that this is a different error to the original one reported in this issue.
For me the errors are interchangeable. Sometime I get single line error (as posted recently), sometime I get full trace of error log as mentioned in the main thread.
Wait, I can reproduce it myself now.
yeah, it takes some tries to produce the error. I will give #3160 a try, if that fix it.
UPDATE: @twpayne I tried the binary from #3160 and it seems it fixed the issue for me. I tried multiple times and no error. As soon as I switched to release version, error pop right after 2 tries.
Describe the bug
If I have staged changes or unpunished changes in chezmoi repo (dotfiles),chezmoi apply -R
almost always fail with errors messageWith
.chezmoiscript
broken down to directory structure,chezmoi
fail to read the data map.To reproduce
git add .
chezmoi -R
-- Result in errorchezmoi -R
-- Result in errorExpected behavior
It should not result in the error.
Output of command with the
--verbose
flagOutput of
chezmoi doctor