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

Newest r10k breaks erb parsing #420

Closed
ghost opened this issue Apr 1, 2018 · 5 comments
Closed

Newest r10k breaks erb parsing #420

ghost opened this issue Apr 1, 2018 · 5 comments

Comments

@ghost
Copy link

ghost commented Apr 1, 2018

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.5.0
  • Ruby: ruby 2.4.3p205 (2017-12-14 revision 61247) [x86_64-linux]
  • Distribution: CentOS 7.4
  • Module version: v6.4.0

How to reproduce (e.g Puppet code you use)

class { 'r10k':
    sources      => {
      'puppet' => {
        'remote'  => 'git@github.com:jas612/puppet.git',
        'basedir' => '/etc/puppetlabs/code/environments',
        'prefix'  => false,
      },
    },
    git_settings => {
      'provider'     => 'rugged',
      'repositories' => '
    - remote: "git@github.com:jas612/puppet.git"
      private_key: "/opt/puppetlabs/server/data/puppetserver/.ssh/id_rsa_puppet"
    - remote: "git@github.com:jas612/puppet-thecrimsontint.git"
      private_key: "/opt/puppetlabs/server/data/puppetserver/.ssh/id_rsa_thecrimsontint"',
    },
  }

What are you seeing

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Failed to parse template r10k/r10k.yaml.erb:
  Filepath: /etc/puppetlabs/code/environments/production/modules/r10k/templates/r10k.yaml.erb
  Line: 3
  Detail: undefined method `to_h' for #<Array:0x7109a8b5>
 (file: /etc/puppetlabs/code/environments/production/modules/r10k/manifests/config.pp, line: 96, column: 16) on node puppet.mgmt.thecrimsontint.com

What behaviour did you expect instead

Properly render the template. v6.3.1 works just fine.

Output log

[root@puppet ~]# puppet agent -t
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Failed to parse template r10k/r10k.yaml.erb:
  Filepath: /etc/puppetlabs/code/environments/production/modules/r10k/templates/r10k.yaml.erb
  Line: 3
  Detail: undefined method `to_h' for #<Array:0x7109a8b5>
 (file: /etc/puppetlabs/code/environments/production/modules/r10k/manifests/config.pp, line: 96, column: 16) on node puppet.mgmt.thecrimsontint.com
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
[root@puppet ~]#

Any additional information you'd like to impart

@bastelfreak
Copy link
Member

Hi @jas612, thanks for the PR. Are you able to provide a patch for this or a test that verifies this broken behavior?

@ghost
Copy link
Author

ghost commented Apr 8, 2018

@bastelfreak it's in the "How to reproduce" section.

@rnelson0
Copy link
Sponsor Member

@jas612 Can you provide the current contents of the r10k.yaml file that the previous version generates?

@dforste
Copy link
Contributor

dforste commented Apr 17, 2018

This looks to be duplicate #421
I get a similar issue after upgrading.

Error while evaluating a Function Call, Failed to parse template r10k/r10k.yaml.erb:
  Filepath: org/jruby/RubyBasicObject.java
  Line: 1555
  Detail: undefined method `to_h' for #<Array:0x1caff6b2>

I am running a puppet 4 server. puppetserver version: 2.7.2

@dhollinger
Copy link
Member

dhollinger commented May 2, 2018

This was fixed with in #424 and released with 6.5.0

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

4 participants