puppetlabs / puppetlabs-docker

The Puppet Docker repository
Apache License 2.0
91 stars 309 forks source link

Docker module don't work on debian 9.12 #626

Closed f-michaut closed 2 years ago

f-michaut commented 4 years ago

Describe the Bug

I don't know if this is a puppetlabs-docker or a facter problem, but in params.pp:141 of the docker puppet module, the fact os.distro.codename used to determine the default package release does not exist on my machine.

Here is the output of puppet facts show :

    "os": {
      "name": "Debian",
      "family": "Debian",
      "release": {
        "major": "9",
        "minor": "12",
        "full": "9.12"
      },
      "lsb": {
        "distcodename": "stretch",
        "distid": "Debian",
        "distdescription": "Debian GNU/Linux 9.12 (stretch)",
        "distrelease": "9.12",
        "majdistrelease": "9",
        "minordistrelease": "12"
      }
    },

Expected Behavior

Instead of the following error message : Error: Evaluation Error: Operator '[]' is not applicable to an Undef Value. at modules/docker/manifests/params.pp:141:51 I expected to be able to use the docker module on debian 9.12

Steps to Reproduce

sudo apt install puppet Install puppetlabs-docker 3.10.1 Just add require 'docker' in your script

Environment

Debian 9.12 puppet 4.8.2

martialblog commented 4 years ago

Hi,

seems to be an issue with older facter versions:

$ facter --version
2.5.6
$ facter os 
{"name"=>"Debian", "family"=>"Debian", "release"=>{"major"=>"10", "minor"=>"5", "full"=>"10.5"}, "lsb"=>{"distcodename"=>"buster", "distid"=>"Debian", "distdescription"=>"Debian GNU/Linux 10 (buster)", "distrelease"=>"10", "majdistrelease"=>"10"}}

$ facter --version
3.14.12 (commit 70d26da13c9fee27973c1eb22200871e21445d97)

$ facter os.distro
{
  codename => "buster",
  description => "Debian GNU/Linux 10 (buster)",
  id => "Debian",
  release => {
    full => "10.5",
    major => "10",
    minor => "5"
  }
}

In the older version facts['os']['distro']['codename']} is not not present. The change was introduced in this refactor: https://github.com/puppetlabs/puppetlabs-docker/commit/915bf8ac1f66a3e1ccdba858c88351f4ec0e2fd9#diff-2f383a197b1a428561b364755701d60eL146

An update to a newer (3.*) facter version did fix the problem in my tests.

Tozapid commented 4 years ago

I have reproduced the same error:

$facter -v 2.4.6

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Operator '[]' is not applicable to an Undef Value. (file: /etc/puppetlabs/code/environments/production/modules/docker/manifests/params.pp, line: 139, column: 51) on node server
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
github-actions[bot] commented 2 years ago

This issue has been marked as stale because it has been open for a while and has had no recent activity. If this issue is still important to you please drop a comment below and we will add this to our backlog to complete. Otherwise, it will be closed in 7 days.