Skip to Main Content

Cloud Platform

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Ruby SDK connection error

841035Feb 17 2017 — edited Feb 17 2017

I'm trying to work through the first example in the docs, but I seem to have something misconfigured with my keys...but I don't know what, and am not sure how to troubleshoot this.

I have the config file created according to the instructions (with the passphrase), I verified the passphrase and the path to the .pem file.  I uploaded the public key to my BMC account through the webui, and copied the ocid, region and fingerprint values from there.  Given the stack trace it doesn't look like it's even tried to handshake with the server yet, so it's something in what's on my system...either a problem with the key, with my config file or maybe a bug in some library code.

// runtime verstions

ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]

bigdecimal (1.2.0)

CFPropertyList (2.2.8)

ethon (0.10.1)

ffi (1.9.17)

inifile (3.0.0)

io-console (0.4.2)

json (1.7.7)

libxml-ruby (2.6.0)

minitest (4.3.2)

nokogiri (1.5.6)

oraclebmc (1.1.0)

psych (2.0.0)

rake (0.9.6)

rdoc (4.0.0)

sqlite3 (1.3.7)

test-unit (2.0.0.0)

typhoeus (1.1.2)

// example from docs

require 'oraclebmc'

# This will load the config file at the default location, and will
# use the tenancy from that config as the compartment in the
# call to list_users.
api = OracleBMC::Identity::IdentityClient.new(region: OracleBMC::Regions::REGION_US_PHOENIX_1)
response = api.list_users(OracleBMC.config.tenancy)
response.data.each { |user| puts user.name }

// exception

/usr/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/jbmcglyn/RubymineProjects/untitled/example.rb

/Library/Ruby/Gems/2.0.0/gems/oraclebmc-1.1.0/lib/oraclebmc/signer.rb:103:in `initialize': Neither PUB key nor PRIV key: nested asn1 error (OpenSSL::PKey::RSAError)

  from /Library/Ruby/Gems/2.0.0/gems/oraclebmc-1.1.0/lib/oraclebmc/signer.rb:103:in `new'

  from /Library/Ruby/Gems/2.0.0/gems/oraclebmc-1.1.0/lib/oraclebmc/signer.rb:103:in `compute_signature'

  from /Library/Ruby/Gems/2.0.0/gems/oraclebmc-1.1.0/lib/oraclebmc/signer.rb:49:in `sign'

  from /Library/Ruby/Gems/2.0.0/gems/oraclebmc-1.1.0/lib/oraclebmc/api_client.rb:176:in `build_request'

  from /Library/Ruby/Gems/2.0.0/gems/oraclebmc-1.1.0/lib/oraclebmc/api_client.rb:117:in `call_api_inner'

  from /Library/Ruby/Gems/2.0.0/gems/oraclebmc-1.1.0/lib/oraclebmc/api_client.rb:66:in `block in call_api'

  from /Library/Ruby/Gems/2.0.0/gems/oraclebmc-1.1.0/lib/oraclebmc/api_client.rb:69:in `call'

  from /Library/Ruby/Gems/2.0.0/gems/oraclebmc-1.1.0/lib/oraclebmc/api_client.rb:69:in `call_api'

  from /Library/Ruby/Gems/2.0.0/gems/oraclebmc-1.1.0/lib/oraclebmc/identity/identity_client.rb:1127:in `list_users'

  from /Users/jbmcglyn/RubymineProjects/untitled/example.rb:7:in `<top (required)>'

  from -e:1:in `load'

  from -e:1:in `<main>'

Process finished with exit code 1

This post has been answered by 841035 on Feb 17 2017
Jump to Answer
Comments
Post Details
Added on Feb 17 2017
1 comment
609 views