question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Investigate: parallel upload of askpass file

See original GitHub issue

Describe the bug

From discord:

Hello, I’m a new user of pyinfra, and I have an issue with the sudo mechanism, but most probably there is a problem with my config. In the inventory.py I have a home group, and running only one operation:

files.directory(
    name="Ensure /etc/nebula exists",
    path="/etc/nebula",
    present=True,
    sudo=True,
    use_sudo_password=host.data.sudo_password,
)

sudo_password is part of the inventory config. It’s working fine, if I have only one machine in inventory which needs sudo. When I’m adding a second one, there is an error with the sudo command:

[machine.local] >>> env SUDO_ASKPASS=pyinfra-sudo-askpass *** sudo -H -A -k sh -c '! test -e /etc/nebula || (stat -c '"'"'user=%U group=%G mode=%A atime=%X mtime=%Y ctime=%Z size=%s %N'"'"' /etc/nebula 2> /dev/null || stat -f '"'"'user=%Su group=%Sg mode=%Sp atime=%a mtime=%m ctime=%c size=%z %N%SY'"'"' /etc/nebula)'
[machine.local] sudo: unable to run pyinfra-sudo-askpass: Exec format error
[machine.local] sudo: no password was provided
[machine.local] sudo: a password is required

It doesn’t matter if theay are in the same group or not. One additional info: They are using the same user, same password, one machine is using a key, the other one is using password for the ssh connection. It’s working with both of them separately, but not together…

With PARALLEL = 1 config it works like a charm, but I’m not sure why.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Pimmeltoncommented, Jun 24, 2021

Fix confirmed. Deploys no longer need PARALLEL=1 to work properly.

1reaction
Fizzadarcommented, Jun 24, 2021

Finally got to the bottom of this - reuse of the same StringIO object; fixed in https://github.com/Fizzadar/pyinfra/commit/07f9d6c80612f12e0faf394d54c9cb1929c42577 & released just now in v1.4.5!

Read more comments on GitHub >

github_iconTop Results From Across the Web

InputFile handle multiple files in parallel - Stack Overflow
I want to be able to upload multiple files via FileInput but got stuck when it comes to parallelism. I simply want to...
Read more >
Parallel composite uploads | Cloud Storage
One strategy for uploading large files is called parallel composite uploads. In such an upload, a file is divided into up to 32...
Read more >
Parallel Upload to Improve Performance - YouTube
In this episode of Cloud Storage Bytes, we walk you through how to improve your small file upload performance by using parallel uploads....
Read more >
bulk-upload — OCI CLI Command Reference 2.7.0 ...
Uploads all files in a given directory and all subdirectories. ... in multiple parts, this option disables those parts from being uploaded in...
Read more >
Sending files by using myFileGateway 2.0 - IBM
In myFileGateway 2.0 , click Uploads from the IBM myFileGateway menu. Select the mailbox path where you want to upload files. Drag the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found