Skip to content

sftp raises Net::SFTP::StatusException when globbing is not possible ( Alpine linux ) #71

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
onnimonni opened this issue Jan 22, 2018 · 0 comments

Comments

@onnimonni
Copy link

Hey!

I just created a sftp server docker image with alpine for my integration tests:
https://github.com/CheckoutFinland/docker-dummy-sftp-server

I then tried to use glob file matching like this:

def fetch_sftp
  Net::SFTP.start(uri.host, uri.user, port: uri.port, key_data: [private_key], keys: [], keys_only: true) do |sftp|
      sftp.dir.glob(uri.path, '*.csv') do |remote_file|
           puts remote_file
      end
  end
end

Which raises weird looking:

Traceback (most recent call last):
        2: from (irb):5
        1: from test.rb:45:in `block in fetch_sftp'
Net::SFTP::StatusException (Net::SFTP::StatusException)

I found out that this probably happens because alpine linux uses musl-c library which doesn't support glob.

I'm not sure if we can deduce if glob is supported from the sftp connection or not but this error message could be better. At least I posted this issue here so that others can find it with google.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant