Closed Renerick closed 2 years ago
@Renerick thanks for reporting this, confirmed is happening on both 1.6.x and v2 WIP as well. Had a quick look but can't quite figure it out so needs a more thorough investigation.
So the issue here was the config being used to generate the temp filename at execution time, not during operation generation. I've change how this works to pass through the temporary name in https://github.com/Fizzadar/pyinfra/commit/eec1c5d51bfd6e97331c878dcbd0458a856e5848 which should resolve this. Pending v1.7
release later today.
Now released in v1.7
!
Describe the bug
When trying to upload or template a file to remote host without
/tmp
access and when SUDO = True I receive an error that/tmp
directory is not found even when other value of the TEMP_DIR setting is specified. Currently I'm experiencing this problem when trying to upload docker-compose files to Synology NAS where direct SFTP has no access to file system other then user home directoryTo Reproduce
Steps to reproduce the behavior (include code & usage example):
Notice how pyinfra is trying to copy from
/tmp
directory.This same code works properly without sudo, the source file is present on the pyinfra machine, so I came to a conclusion that this is a bug
I tried to debug it myself by adding the following lines here
This was the output
Seems like configuration values are not being passed correctly to the connector
EDIT 1:
I went a bit further and added this to https://github.dev/Fizzadar/pyinfra/blob/233a7797dc556f01727b8887cbf0e39bdd9dc548/pyinfra/api/host.py#L1
Here is the result
Seems like configs values are diverging between planning and execution stages
Expected behavior
Files are uploaded/templated without errors
Meta
Include output of
pyinfra --support
.-vv
and--debug
.