Issues with Aptible CLI on Windows

Getting this error when attempting to tunnel into a database or view logs with the Aptible CLI:

  • Windows 10
  • Aptible Toolbelt v0.19.1
Tunnel did not come up: C:/aptible-toolbelt/embedded/lib/ruby/gems/2.3.0/gems/aptible-cli-0.19.1/lib/aptible/cli/helpers/tunnel.rb:46: warning: cannot close fd before spawn

Any advice on how to debug/resolve this issue?

Commands that utilize an SSH tunnel like aptible db:tunnel, aptible logs, and aptible ssh it use the ssh-keygen executable that comes bundled with the toolbelt to generate a SSH key for use with the tunnel. We believe the error you shared, warning: cannot close fd before spawn, as well as some others are caused by Windows blocking the bundled ssh-keygen executable from running.

You can test for this issue by running the following commands in the “Command Prompt” app:

mkdir "%HOMEPATH%\.aptible\ssh"
cd "%HOMEPATH%\.aptible\ssh"
C:\aptible-toolbelt\embedded\bin\ssh-keygen -t rsa -N "" -f id_rsa

The ssh-keygen command should output Generating public/private rsa key pair. along with some details about the key being generated. If the command does not output anything, then you should contact your system administrator for help determining why the executable is being blocked.

Unfortunately, we haven’t been unable to reproduce the issue ourselves so we do not know exactly what steps are necessary to resolve this issue. If you are able to resolve the issue please share what you did so that other users can benefit from your experience.