Closed drewp closed 2 years ago
Still hitting this. I found this in strace on the machine that fails:
openat(AT_FDCWD, "/usr/local/bin/skaffold", O_WRONLY|O_CREAT|O_TRUNC, 0666) = -1 ETXTBSY (Text file busy)
Indeed, I have some running skaffold processes on dash.
One fix is that pyinfra could download to another file and then mv
it on top of the desired path.
Thanks for digging into this @drewp - think the download then mv
method is the best solution, aligns with how files.put
works as well 👍.
I just released v1.6.2
which contains this change (https://github.com/Fizzadar/pyinfra/commit/5944d8e54252dca29d4dbf73592795d9cc13d871).
I haven't tried to repro this. Hopefully the evidence from my shell history is useful.
Running this from host 'bang':
said this:
until I ran
sudo rm /usr/local/bin/skaffold
on dash. Then:and now dash has this root-owned file:
I think dash should have worked the first time, like slash and bang did.
Meta
Include output of
pyinfra --support
.System: Linux Platform: Linux-5.13.0-25-generic-x86_64-with-glibc2.34 Release: 5.13.0-25-generic Machine: x86_64 pyinfra: v1.6.1 Executable: env/bin/pyinfra Python: 3.9.9 (CPython, GCC 10.3.0)