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.

Taz
  • 147
  • 3
  • 16
  • The [setup steps](https://forge.puppet.com/accenture/hiera_aws_sm#setup) 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 output, but since you don't say that you followed the defined setup procedure; let's start there? – Aaron Copley Jul 16 '20 at 00: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 03:30

1 Answers1

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.

Taz
  • 147
  • 3
  • 16