2

I'm trying to use a module which adds an AWS Secrets Manager hiera backend:

https://forge.puppet.com/accenture/hiera_aws_sm

This module requires the aws-sdk-secretsmanager gem, which I installed via puppetserver:

$ sudo puppetserver gem install aws-sdk-secretsmanager

I can also see this gem listed in puppetserver:

$ sudo puppetserver gem list

*** LOCAL GEMS ***

<trimmed>
aws-sdk-schemas (1.6.0)
aws-sdk-secretsmanager (1.40.0, 1.39.0)
aws-sdk-securityhub (1.29.0)
<trimmed>

The module itself contains the following line to import the gem:

require 'aws-sdk-secretsmanager'

When I try to run an agent test...

$ sudo puppet agent --test

... when this module tries to run I get the following error (after commenting out some error handling obfuscation the module added):

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Internal Server Error: org.jruby.exceptions.LoadError: (LoadError) no such file to load -- aws-sdk-secretsmanager

I can't work out why the puppetserver jruby instance can't load the gem since it appears in list and have hit a bit of a wall in debugging it.

2
  • The setup steps suggests installing aws-sdk which has a runtime dependency on aws-sdk-resources and that Gem has a runtime dependency on 200+ other aws-sdk-* Gems including aws-sdk-secretsmanager. Is it possible that because you have bypassed the top-level required Gem that you don't have all of the necessary components? All of that may have been included in the <trimmed> output, but since you don't say that you followed the defined setup procedure; let's start there? Jul 16 '20 at 0:59
  • Yep, aws-sdk & aws-sdk-resources are there. All dependencies look to have installed fine for purposes of a gem list but won't load. i.e. require 'aws-sdk' results in the same issue.
    – Taz
    Jul 16 '20 at 3:30
2

Turns out this issue was because multiple versions of aws-sdk-secretsmanager were installed somehow:

$ sudo puppetserver gem list

*** LOCAL GEMS ***

<trimmed>
aws-sdk-secretsmanager (1.40.0, 1.39.0)
<trimmed>

Running...

$ sudo puppetserver gem uninstall aws-sdk-secretsmanager

... accepting the prompt to uninstall all installed versions and then running...

$ sudo puppetserver gem install aws-sdk-secretsmanager

... solved the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.