Hi there,
I’m having an issue with connecting to an SFTP server from within a docker container on a GCP instance. Its likely a configuration issue with the image , but was just wondering if someone had some insight. I can replicate the issue within a container locally as well - but it works when I just boot up the application outside a container.
These are just pretty standard erlang 22/elixir 1.9 alpine images.
The SFTP library is here: https://github.com/i22-digitalagentur/sftp_client
This is the stacktrace:
app_1 | 14:33:52.212 [info] Erlang SSH :client 4.8 (OpenSSL 1.1.1g 21 Apr 2020).
app_1 | Server: 'SSH-2.0-2.0'
app_1 | Disconnects with code = 11 [RFC4253 11.1]: Internal error
app_1 | State = {key_exchange,client,init}
app_1 | Module = ssh_connection_handler, Line = 1590.
app_1 | Details:
app_1 | Reason: {badmatch,{error,eacces}}
app_1 |
app_1 |
app_1 | 14:33:52.217 [error] GenServer #PID<0.5079.0> terminating
app_1 | ** (Protocol.UndefinedError) protocol String.Chars not implemented for {{:badmatch, {:error, :eacces}}, [{:ssh_file, :default_user_dir, 1, [file: 'ssh_file.erl', line: 394]}, {:ssh_file, :file_name, 3, [file: 'ssh_file.erl', line: 222]}, {:ssh_file, :do_lookup_host_key, 4, [file: 'ssh_file.erl', line: 247]}, {:ssh_file, :is_host_key, 4, [file: 'ssh_file.erl', line: 91]}, {:ssh_transport, :known_host_key, 3, [file: 'ssh_transport.erl', line: 880]}, {:ssh_transport, :handle_kex_ecdh_reply, 2, [file: 'ssh_transport.erl', line: 698]}, {:ssh_connection_handler, :handle_event, 4, [file: 'ssh_connection_handler.erl', line: 711]}, {:gen_statem, :loop_state_callback, 11, [file: 'gen_statem.erl', line: 1161]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 249]}]} of type Tuple. This protocol is implemented for the following type(s): Decimal, NaiveDateTime, BitString, Atom, Version.Requirement, Version, URI, Date, Time, Float, List, Integer, DateTime
app_1 | (elixir) lib/string/chars.ex:3: String.Chars.impl_for!/1
app_1 | (elixir) lib/string/chars.ex:22: String.Chars.to_string/1
app_1 | (sftp_client) lib/sftp_client/operation_util.ex:60: SFTPClient.OperationUtil.handle_error/1
app_1 | (sftp_client) lib/sftp_client/operations/connect.ex:140: SFTPClient.Operations.Connect.do_connect/1
app_1 | (sftp_client) lib/sftp_client/operations/connect.ex:49: SFTPClient.Operations.Connect.connect/1
Any help would be appreciated.
Thanks