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

Lookup of key 'lookup_options' failed: Data Provider type mismatch: Got String when a hash-like object was expected to access value using 'release' from key 'os.release.full' #122

Closed
dhose opened this issue Jan 19, 2018 · 12 comments

Comments

@dhose
Copy link

dhose commented Jan 19, 2018

Hi,

Currenly we are using garethr-docker forge module, which works fine, but we are having issues with garethr/garethr-docker#701, so therefore I'm in the process of changing to puppetlabs-docker instead.

Unfortunately I'm seeing an issue I have problem pinpointing. My test server is using only the profile::docker manifest with a Puppetfile just containing puppetlabs-docker and puppetlabs-stdlib. When the Puppet agent tries to apply the catalog it logs th error below. I found https://tickets.puppetlabs.com/browse/MODULES-4103, but not sure if it is relevant to this issue. I have tried the 1.0.4 version and the master branch, but the same error with both.

For info, the include profile::yum::docker_ce below just adds our internal YUM repository with the Docker CE RPMs.

Has anyone seen this issue and can point me in the right direction?

CentOS release

$ cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)

Puppet version

$ puppet --version
4.10.9

Facter version

$ facter --version
3.6.8 (commit 25dace2536f6bd339b70b385c7e90e1951870671)

Puppetfile

mod 'puppetlabs-docker', '1.0.4'
mod 'puppetlabs-stdlib', '4.24.0'

Puppet manifest

class profile::docker {
  include profile::yum::docker_ce

  class { 'docker':
    use_upstream_package_source => false,
    package_ce_name             => 'docker-ce',
    manage_epel                 => false,
  }
}

Puppet log

Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, Lookup of key 'lookup_options' failed: Data Provider type mismatch: Got String when a hash-like object was expected to access value using 'release' from key 'os.release.full' at <path> on node <server>
@scotty-c
Copy link
Contributor

@dhose package_ce_name should be docker_ce_package_name
Can you please test with that change

@davejrt
Copy link
Contributor

davejrt commented Jan 19, 2018

@dhose by default the package name is set to docker-ce if you don't specify a version.

Your manifest should only require the following

class {  'docker':
  use_upstream_package_source => false,
  manage_epel  => false,
}

@dhose
Copy link
Author

dhose commented Jan 19, 2018

Hi,

Thanks for your answers.

I just changed the manifest to:

class { 'docker':
    use_upstream_package_source => false,
    manage_epel                               => false,
}

but I still get the same error:

Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Resource Statement, Lookup of key 'lookup_options' failed: Data Provider type mismatch: Got String when a hash-like object was expected to access value using 'release' from key 'os.release.full' at <path> on node <server>

I'm wondering if this could be related to either facter och hiera versions, but I haven't seen this error with any of the other forge modules we use in our Puppetfile, and as I mentioned in the intial post I have disabled all modules in Puppetfile except puppetlabs-docker and puppetlabs-stdlib for this test. We are also using garethr-docker in a different Puppet environment, and we are not seeing this issue there.

@scotty-c
Copy link
Contributor

@dhose Does puppet complete a catalogue run if the Docker class is not applied to it?

@dhose
Copy link
Author

dhose commented Jan 20, 2018

@scotty-c

Thanks for your answer!

Yes, it works if I comment out the Docker class in the manifest. As mentioned earlier we are also using garethr-docker in a different Puppet environment, and we are not seeing this issue there.

I'm going to start testing with different Puppet/Facter versions, if it is something there, in combination with this module, that triggers this issue.

I'm also going to check if I can find a commit where this issue starts appearing.

Thanks again!

@davejrt
Copy link
Contributor

davejrt commented Jan 20, 2018 via email

@dhose
Copy link
Author

dhose commented Jan 20, 2018

@davejrt @scotty-c

I tried the following:

$ facter os.release.full
7.4.1708

I have also done some git bisecting and the first commit where this issue appears in is 9f9b0ae.

I can see in this commit that a string parameter in init.pp called $os is introduced. I wonder if Puppet gets confused when there is also a Hash value in Facter called $os. The error message also says that a hash value was expected but Puppet got a string.

Could this be relevant?

@davejrt
Copy link
Contributor

davejrt commented Jan 21, 2018

Can you provide a gist of the log output with verbose and debug turned on? I've just upgraded a vagrant box the the same kernel version as yours as run puppet without any issues.

If you remove the string type from the variable does the run then pass?

@dhose
Copy link
Author

dhose commented Jan 21, 2018

@davejrt

I removed the string type from the $os variable, but no changes.

You can find a gist with verbose and debug logging enabled here:

https://gist.github.com/dhose/3d343fd56ee9a9bca42ceddb9017c748

Thanks again!

@davejrt
Copy link
Contributor

davejrt commented Jan 21, 2018

@dhose can you test the master branch now? I've just merged a change PR #123 to try and resolve your issue.

Dave

@dhose
Copy link
Author

dhose commented Jan 22, 2018

@davejrt

Hi,

I just tried the master-branch. Great success, it works. I just had to add the repo_opt parameter to get a clean catalog run:

  class { 'docker':
    use_upstream_package_source => false,
    manage_epel                 => false,
    repo_opt                    => '',
  }

Thanks a lot for your help. 👍

@davejrt
Copy link
Contributor

davejrt commented Jan 22, 2018

@dhose thanks for persevering, and letting us know it solved the problem.

@davejrt davejrt closed this as completed Jan 22, 2018
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

3 participants