Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using group repository (undefined local variable or method file_uri'`) #23

Open
phlg opened this issue Jan 4, 2021 · 0 comments

Comments

@phlg
Copy link

phlg commented Jan 4, 2021

Hi,

I'm having troubles when trying to use the plugin with Puppet/r10k with a group repository. At this point, I'm unsure whether this problem emanates from configuration issues on my end, or from the implementation of these features in the plugin (supposedly #18 ).

  • What are you trying to do?

I'm trying to use a group repository consisting of :

  • one hosted repository
  • one proxy repository

to have Puppet (or rather, r10k) download a module from Nexus - the sonarqube module in the example below. Since both #2 and #17 are closed, I think this should be working, but I get an error when using r10k to fetch modules from Nexus with this setup :

INFO     -> Using Puppetfile '/etc/puppetlabs/code/environments/production/Puppetfile'
INFO     -> Deploying environment /etc/puppetlabs/code/environments/production
INFO     -> Environment production is now at 8dbfc7fcf2c56e0d58b1354256792296f04c5662
INFO     -> Deploying Puppetfile content /etc/puppetlabs/code/environments/production/modules/concat
INFO     -> Deploying Puppetfile content /etc/puppetlabs/code/environments/production/modules/apache
INFO     -> Deploying Puppetfile content /etc/puppetlabs/code/environments/production/modules/tomcat
INFO     -> Deploying Puppetfile content /etc/puppetlabs/code/environments/production/modules/gitlab
INFO     -> Deploying Puppetfile content /etc/puppetlabs/code/environments/production/modules/gitlab_ci_runner
INFO     -> Deploying Puppetfile content /etc/puppetlabs/code/environments/production/modules/sonarqube
ERROR    -> undefined local variable or method `file_uri' for #<PuppetForge::V3::Release:0x000055aea1af1338>
INFO     -> Deploying Puppetfile content /etc/puppetlabs/code/environments/production/modules/postgresql
INFO     -> Deploying Puppetfile content /etc/puppetlabs/code/environments/production/modules/nexus

When switching from the group repo to the proxy repo, the error disappears and the postgresql module is downloaded... but this in turn prevents us from downloading in-house modules with Nexus.

The use of Nexus is configured in the /etc/puppetlabs/r10k/r10k.yaml and /etc/puppetlabs/puppet/puppet.conf files as follows on our puppetserver :

---
# The location to use for storing cached Git repos
forge:
  # Using the proxy repository directly.
  # This works (but can't resolve in-house modules, which are hosted on another repository Nexus-wise)
  baseurl: 'https://fqdn.for.the.nexus/repository/puppet-forge-proxy'
  # Using the group repository
  # This triggers the error above
  # baseurl: 'https://fqdn.for.the.nexus/repository/puppet-forge'

# ...
[main]
module_repository = 'https://fqdn.for.the.nexus/repository/puppet-forge-proxy'
# module_repository = 'https://fqdn.for.the.nexus/repository/puppet-forge'

# ...
  • What feature or behavior is this required for?

Being able to use the plugin both a proxy and a hosted repository at the same time.

  • How could we solve this issue? (Not knowing is okay!)

As mentioned earlier, I'm not sure if there is actually a problem on this plugin. For what it's worth, the file_uri mentioned in the error message also appears in the commits of PR #18. This might be completely irrelevant, but thought I'd mention it just in case.

  • Anything else?
    • The Nexus I tried this on is a 3.20.1-01, while the last version compatible version mentioned in the README (for the v0.1.1) is the 3.17.0-01 - I don't know if this is significant though.
    • I tried building the plugin from two differents refs (the nexus-repository-puppet-0.1.1 tag and 0cda6b262c3ee0fe3a4a2cd7e4eece352f5aaa89, which was the latest commit on master when I built the plugin), with the same behavior both times.
    • Puppet versions were 6.13.0 (puppetserver) and 6.18.0 (puppet agent).

Thank you !
Philippe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant