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.

apk not being found with alpine using dropbear sshd.

See original GitHub issue

Describe the bug

I’m using infra on alpine with dropbear sshd and apk is not being found. I did try openssh sshd and it works, but for some of my setups I’d prefer to use dropbear.

To Reproduce

# this is on a temporary scratch install of alpine
pyinfra --user root 192.168.122.227 apk.packages rsync
--> Loading config...
--> Loading inventory...

--> Connecting to hosts...
    [192.168.122.227] Connected

--> Preparing operation...
    [192.168.122.227] Ready: apk.packages

--> Proposed changes:
    Ungrouped:
    [192.168.122.227]   Operations: 1   Commands: 1   

--> Beginning operation run...
--> Starting operation: Apk/Packages (rsync)
    [192.168.122.227] sh: apk: not found
    [192.168.122.227] Error
--> pyinfra error: No hosts remaining!
Wed 29Dec21 02:40:15 ~

Expected behavior

I expected a way to specify the path to apk. I did a sed replace of apk with /sbin/apk and it works.

sed "s,'apk,'/sbin/apk," .local/lib/python3.10/site-packages/pyinfra/facts/apk.py -i
sed "s,'apk,'/sbin/apk," .local/lib/python3.10/site-packages/pyinfra/operations/apk.py -i
sed "s,'apk,'/sbin/apk," .local/lib/python3.10/site-packages/pyinfra/operations/server.py -i

Should there be a way to configure an absolute path for remote package management commands? I could make a PR if we can agree on how this could be made configurable.

Meta

  • Include output of pyinfra --support.
--> Support information:

    If you are having issues with pyinfra or wish to make feature requests, please
    check out the GitHub issues at https://github.com/Fizzadar/pyinfra/issues .
    When adding an issue, be sure to include the following:

    System: Linux
      Platform: Linux-5.15.11-arch2-1-x86_64-with-glibc2.33
      Release: 5.15.11-arch2-1
      Machine: x86_64
    pyinfra: v1.5
    Executable: /home/dwight/.local/bin/pyinfra
    Python: 3.10.1 (CPython, GCC 11.1.0)
  • How was pyinfra installed (source/pip)?
pip install --user pyinfra

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
bogen85commented, Jan 4, 2022

@Fizzadar I think on the PATH issue, dropbear appears to be the culprit as it is not setting the path and is not honoring the ssh config for environment variables. The documentation for dropbear claims it sets them, and I’ll have to dig deeper into that.

Regarding systemd-nspawn, yes, I’m using the @chroot connector along with a chroot wrapper script in my path. See #731 for more details. I’m open to either (new connector or new configuration field) as long as I have the some functionality I’m getting from the wrapper (systemd-nspawn run with sudo, not all of pyinfra) (with ansible and chroot, all of ansible has to be run as root).

0reactions
bogen85commented, Jan 4, 2022

It is working now on a fresh setup (no ~/.ssh/config specifics needed). Have not determined what was causing it to not work earlier.

Continuing discussion on #731for chroot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Remoting SSH support for Alpine Linux · Issue #6347 - GitHub
One quick test is try to ssh to the alpine vm with ssh tunnel, if that doesn't work, then you need to update...
Read more >
Setting up a SSH server - Alpine Linux Wiki
Note: This article describes two popular SSH implementations: OpenSSH and Dropbear. Either can be installed using the setup-sshd script, ...
Read more >
How to install OpenSSH server on Alpine Linux (including ...
This quick tutorial explains how to install and set up OpenSSH (SSHD) server and client on the Alpine Linux system.
Read more >
Installing Alpine Linux fails to scan the mirror list with "403 ...
@grawity Exactly, but I'm not the administrator of the proxy server and I have to use the proxy. The expression "my proxy server"...
Read more >
How to enable SSH root login on Alpine Linux - TechOverflow -
(I have not tested whether root access is enabled when installing Alpine Linux using dropbear instead of openssh ). First, open the SSH ......
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