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

undefined method `value' for nil:NilClass #36

Open
treydock opened this issue Apr 25, 2016 · 0 comments
Open

undefined method `value' for nil:NilClass #36

treydock opened this issue Apr 25, 2016 · 0 comments
Labels

Comments

@treydock
Copy link

I'm getting this error when I try to decrypt data either via hiera command line tool or via eyaml command line tool. Thus far I don't seem to get errors when puppetserver decrypts the data. The system is RedHat 6.

Full --trace output of eyaml decrypt:

# eyaml decrypt -n gpg --gpg-gnupghome=/etc/puppet/secure/keys/gpg --file=/etc/puppet/hiera/production/hieradata/fqdn/FQDN-OMIT.yaml  --gpg-recipients=puppet@DOMAIN --trace
[hiera-eyaml-core] Dump of eyaml tool options dict:
[hiera-eyaml-core] --------------------------------
[hiera-eyaml-core]           (Symbol) eyaml              =         (NilClass)                   
[hiera-eyaml-core]           (Symbol) file               =           (String) /etc/puppet/hiera/production/hieradata/fqdn/FQDN-OMIT.yaml
[hiera-eyaml-core]           (Symbol) gpg_gnupghome_given =        (TrueClass) true              
[hiera-eyaml-core]           (Symbol) pkcs7_subject      =           (String) /                 
[hiera-eyaml-core]           (Symbol) encrypt_method     =           (String) gpg               
[hiera-eyaml-core]           (Symbol) stdin              =       (FalseClass) false             
[hiera-eyaml-core]           (Symbol) trace_given        =        (TrueClass) true              
[hiera-eyaml-core]           (Symbol) source             =           (Symbol) file              
[hiera-eyaml-core]           (Symbol) pkcs7_private_key  =           (String) ./keys/private_key.pkcs7.pem
[hiera-eyaml-core]           (Symbol) quiet              =       (FalseClass) false             
[hiera-eyaml-core]           (Symbol) version            =       (FalseClass) false             
[hiera-eyaml-core]           (Symbol) input_data         =           (String) ---
                   classes:
                     - role::foreman::web
                   foreman::configure_epel_repo: false
                   foreman::configure_scl_repo: false
                   foreman::db_database: 'foreman'
                   foreman::db_manage: true
                   foreman::db_password: >
                       ENC[GPG,hQEMA.....]
                   foreman::db_type: 'mysql'
                   foreman::db_username: 'foreman'
                   foreman::foreman_url: "https://%{hiera('profile_foreman_host')}"
                   foreman::locations_enabled: false
                   foreman::oauth_active: false
                   foreman::oauth_map_users: false
                   foreman::organizations_enabled: false
                   foreman::puppetrun: true
                   foreman::repo: "%{hiera('foreman_repo')}"
                   #foreman::server_ssl_crl: ""
                   foreman::ssl: true
                   foreman::unattended: true
                   foreman::plugin::puppetdb::address: "https://%{hiera('puppetdb_host')}:8081/v2/commands"
                   foreman::plugin::puppetdb::dashboard_address: "http://%{hiera('puppetdb_host')}:8080/dashboard"
[hiera-eyaml-core]           (Symbol) executor           =            (Class) Hiera::Backend::Eyaml::Subcommands::Decrypt
[hiera-eyaml-core]           (Symbol) pkcs7_public_key   =           (String) ./keys/public_key.pkcs7.pem
[hiera-eyaml-core]           (Symbol) gpg_recipients_file =         (NilClass)                   
[hiera-eyaml-core]           (Symbol) file_given         =        (TrueClass) true              
[hiera-eyaml-core]           (Symbol) gpg_always_trust   =       (FalseClass) false             
[hiera-eyaml-core]           (Symbol) help               =       (FalseClass) false             
[hiera-eyaml-core]           (Symbol) encrypt_method_given =        (TrueClass) true              
[hiera-eyaml-core]           (Symbol) verbose            =       (FalseClass) false             
[hiera-eyaml-core]           (Symbol) gpg_gnupghome      =           (String) /etc/puppet/secure/keys/gpg
[hiera-eyaml-core]           (Symbol) gpg_recipients_given =        (TrueClass) true              
[hiera-eyaml-core]           (Symbol) string             =         (NilClass)                   
[hiera-eyaml-core]           (Symbol) trace              =        (TrueClass) true              
[hiera-eyaml-core]           (Symbol) gpg_recipients     =           (String) puppet@DOMAIN    
[hiera-eyaml-core] --------------------------------
[gpg] GNUPGHOME is /etc/puppet/secure/keys/gpg
[hiera-eyaml-core] undefined method `value' for nil:NilClass
[hiera-eyaml-core] /usr/lib/ruby/gems/1.8/gems/ruby_gpg-0.3.2/lib/ruby_gpg.rb:63:in `run_command'
                   /usr/lib/ruby/1.8/open3.rb:86:in `popen3'
                   /usr/lib/ruby/gems/1.8/gems/ruby_gpg-0.3.2/lib/ruby_gpg.rb:59:in `run_command'
                   /usr/lib/ruby/gems/1.8/gems/ruby_gpg-0.3.2/lib/ruby_gpg.rb:52:in `decrypt_string'
                   /usr/lib/ruby/gems/1.8/gems/hiera-eyaml-gpg-0.6/lib/hiera/backend/eyaml/encryptors/gpg.rb:167:in `decrypt'
                   /usr/lib/ruby/gems/1.8/gems/hiera-eyaml-2.1.0/lib/hiera/backend/eyaml/parser/encrypted_tokens.rb:15:in `encrypted_value'
                   /usr/lib/ruby/gems/1.8/gems/hiera-eyaml-2.1.0/lib/hiera/backend/eyaml/parser/encrypted_tokens.rb:80:in `create_enc_token'
                   /usr/lib/ruby/gems/1.8/gems/hiera-eyaml-2.1.0/lib/hiera/backend/eyaml/parser/encrypted_tokens.rb:110:in `create_token'
                   /usr/lib/ruby/gems/1.8/gems/hiera-eyaml-2.1.0/lib/hiera/backend/eyaml/parser/parser.rb:71:in `parse_scanner'
                   /usr/lib/ruby/gems/1.8/gems/hiera-eyaml-2.1.0/lib/hiera/backend/eyaml/parser/parser.rb:74:in `parse_scanner'
                   /usr/lib/ruby/gems/1.8/gems/hiera-eyaml-2.1.0/lib/hiera/backend/eyaml/parser/parser.rb:36:in `parse'
                   /usr/lib/ruby/gems/1.8/gems/hiera-eyaml-2.1.0/lib/hiera/backend/eyaml/subcommands/decrypt.rb:58:in `execute'
                   /usr/lib/ruby/gems/1.8/gems/hiera-eyaml-2.1.0/lib/hiera/backend/eyaml/CLI.rb:46:in `execute'
                   /usr/lib/ruby/gems/1.8/gems/hiera-eyaml-2.1.0/bin/eyaml:21
                   /usr/bin/eyaml:19:in `load'
                   /usr/bin/eyaml:19

Hiera trace:

# hiera --config /etc/puppet/hiera.yaml foreman::db_password ::fqdn=FQDN-OMIT ::environment=production
/usr/lib/ruby/gems/1.8/gems/ruby_gpg-0.3.2/lib/ruby_gpg.rb:63:in `run_command': undefined method `value' for nil:NilClass (NoMethodError)
    from /usr/lib/ruby/1.8/open3.rb:86:in `popen3'
    from /usr/lib/ruby/gems/1.8/gems/ruby_gpg-0.3.2/lib/ruby_gpg.rb:59:in `run_command'
    from /usr/lib/ruby/gems/1.8/gems/ruby_gpg-0.3.2/lib/ruby_gpg.rb:52:in `decrypt_string'
    from /usr/lib/ruby/gems/1.8/gems/hiera-eyaml-gpg-0.6/lib/hiera/backend/eyaml/encryptors/gpg.rb:167:in `decrypt'
    from /usr/lib/ruby/gems/1.8/gems/hiera-eyaml-2.1.0/lib/hiera/backend/eyaml/parser/encrypted_tokens.rb:15:in `encrypted_value'
    from /usr/lib/ruby/gems/1.8/gems/hiera-eyaml-2.1.0/lib/hiera/backend/eyaml/parser/encrypted_tokens.rb:80:in `create_enc_token'
    from /usr/lib/ruby/gems/1.8/gems/hiera-eyaml-2.1.0/lib/hiera/backend/eyaml/parser/encrypted_tokens.rb:100:in `create_token'
    from /usr/lib/ruby/gems/1.8/gems/hiera-eyaml-2.1.0/lib/hiera/backend/eyaml/parser/encrypted_tokens.rb:90:in `create_token'
    from /usr/lib/ruby/gems/1.8/gems/hiera-eyaml-2.1.0/lib/hiera/backend/eyaml/parser/parser.rb:71:in `parse_scanner'
    from /usr/lib/ruby/gems/1.8/gems/hiera-eyaml-2.1.0/lib/hiera/backend/eyaml/parser/parser.rb:36:in `parse'
    from /usr/lib/ruby/gems/1.8/gems/hiera-eyaml-2.1.0/lib/hiera/backend/eyaml_backend.rb:83:in `decrypt'
    from /usr/lib/ruby/gems/1.8/gems/hiera-eyaml-2.1.0/lib/hiera/backend/eyaml_backend.rb:131:in `parse_string'
    from /usr/lib/ruby/gems/1.8/gems/hiera-eyaml-2.1.0/lib/hiera/backend/eyaml_backend.rb:101:in `parse_answer'
    from /usr/lib/ruby/gems/1.8/gems/hiera-eyaml-2.1.0/lib/hiera/backend/eyaml_backend.rb:53:in `lookup'
    from /usr/lib/ruby/site_ruby/1.8/hiera/backend.rb:76:in `datasources'
    from /usr/lib/ruby/site_ruby/1.8/hiera/backend.rb:74:in `map'
    from /usr/lib/ruby/site_ruby/1.8/hiera/backend.rb:74:in `datasources'
    from /usr/lib/ruby/gems/1.8/gems/hiera-eyaml-2.1.0/lib/hiera/backend/eyaml_backend.rb:29:in `lookup'
    from /usr/lib/ruby/site_ruby/1.8/hiera/backend.rb:206:in `lookup'
    from /usr/lib/ruby/site_ruby/1.8/hiera/backend.rb:203:in `each'
    from /usr/lib/ruby/site_ruby/1.8/hiera/backend.rb:203:in `lookup'
    from /usr/lib/ruby/site_ruby/1.8/hiera.rb:60:in `lookup'
    from /usr/bin/hiera:225

@ghoneycutt ghoneycutt added the bug label Apr 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants