Mar 1, 2019

Running bolt with passphrase protected ssh key on MacOS.


I tried to run bolt in my mac and got following error.


MacBook-Pro:~ thilina$ bolt command run 'ls' -n 192.168.1.35 -u thilina
Started on 192.168.1.35...
dyld: lazy symbol binding failed: Symbol not found: _SHA512Init
  Referenced from: /opt/puppetlabs/bolt/lib/ruby/gems/2.5.0/gems/bcrypt_pbkdf-1.0.0/lib/bcrypt_pbkdf_ext.bundle
  Expected in: flat namespace

dyld: Symbol not found: _SHA512Init
  Referenced from: /opt/puppetlabs/bolt/lib/ruby/gems/2.5.0/gems/bcrypt_pbkdf-1.0.0/lib/bcrypt_pbkdf_ext.bundle
  Expected in: flat namespace

/opt/puppetlabs/bin/bolt: line 4: 74325 Abort trap: 6           env -u GEM_HOME -u GEM_PATH -u DLN_LIBRARY_PATH -u RUBYLIB -u RUBYLIB_PREFIX -u RUBYOPT -u RUBYPATH -u RUBYSHELL -u LD_LIBRARY_PATH -u LD_PRELOAD SHELL=/bin/sh /opt/puppetlabs/bolt/bin/bolt "$@"


So I add my private key to ssh authentication agent using ssh-add. Following is to reproduce it and the workaround it until bolt devs give a proper patch [1].

Reproduce:

MacBook-Pro:~ thilina$ ssh-add -D
All identities removed.
MacBook-Pro:~ thilina$ bolt command run 'ls' -n 192.168.1.35 -u thilina
Started on 192.168.1.35...
dyld: lazy symbol binding failed: Symbol not found: _SHA512Init
  Referenced from: /opt/puppetlabs/bolt/lib/ruby/gems/2.5.0/gems/bcrypt_pbkdf-1.0.0/lib/bcrypt_pbkdf_ext.bundle
  Expected in: flat namespace

dyld: Symbol not found: _SHA512Init
  Referenced from: /opt/puppetlabs/bolt/lib/ruby/gems/2.5.0/gems/bcrypt_pbkdf-1.0.0/lib/bcrypt_pbkdf_ext.bundle
  Expected in: flat namespace

/opt/puppetlabs/bin/bolt: line 4: 74325 Abort trap: 6           env -u GEM_HOME -u GEM_PATH -u DLN_LIBRARY_PATH -u RUBYLIB -u RUBYLIB_PREFIX -u RUBYOPT -u RUBYPATH -u RUBYSHELL -u LD_LIBRARY_PATH -u LD_PRELOAD SHELL=/bin/sh /opt/puppetlabs/bolt/bin/bolt "$@"
MacBook-Pro:~ thilina$


Solution:

MacBook-Pro:~ thilina$ ssh-add ~/.ssh/id_rsa
Enter passphrase for ~/.ssh/id_rsa:
Identity added: ~/.ssh/id_rsa (thilina)
MacBook-Pro:~ thilina$


Test:

MacBook-Pro:~ thilina$ bolt command run 'ls' -n 192.168.1.35 -u thilina
Started on 192.168.1.35...
Finished on 192.168.1.35:
Successful on 1 node: 192.168.1.35
Ran on 1 node in 0.30 seconds
MacBook-Pro:~ thilina$

1 comment:

Your comments are always welcome ...