github / octocatalog-diff

Compile Puppet catalogs from 2 branches, versions, etc., and compare them
https://rubygems.org/gems/octocatalog-diff/
MIT License
239 stars 85 forks source link

Issue with control-repo script config_version.sh with git integration #243

Closed lud97x closed 3 years ago

lud97x commented 3 years ago

Hi,

Description of problem

Command used and debugging output

Directly from the puppetserver in /etc/puppetlabs/code/environments/dev I did: `octocatalog-diff -d -n mongodb01.lud.home -f origin/dev -t origin/production --bootstrap-script /tmp/r10k.sh

Content of config_version.sh: https://github.com/puppetlabs/control-repo/blob/production/scripts/config_version.sh

Content of /tmp/r10k.sh:

#!/bin/bash
r10k puppetfile install Puppetfile

Content of /etc/octocatalog-diff.cfg.rb

module OctocatalogDiff
  class Config
    def self.config
      settings = {}
      settings[:puppetdb_url] = 'https://puppetserver01.lud.home:8081'
      settings[:puppetdb_ssl_ca] = '/etc/puppetlabs/puppet/ssl/certs/ca.pem'
      settings[:puppetdb_ssl_client_cert] = File.read("/etc/puppetlabs/puppet/ssl/certs/puppetserver01.lud.home.pem")
      settings[:puppetdb_ssl_client_key] = File.read("/etc/puppetlabs/puppet/ssl/private_keys/puppetserver01.lud.home.pem")
      settings[:enc] = '/etc/puppetlabs/puppet/node.rb'
      settings[:storeconfigs] = false
      puppet_may_be_in = %w(
        bin/puppet
        /opt/puppetlabs/puppet/bin/puppet
        /usr/bin/puppet
        /usr/local/bin/puppet
      )
      puppet_may_be_in.each do |path|
        next unless File.executable?(path)
        settings[:puppet_binary] = path
        break
      end
      settings[:puppet_binary] = '/opt/puppetlabs/puppet/bin/puppet'
      settings[:from_env] = 'origin/production'
      settings[:validate_references] = %w(before notify require subscribe)
      settings[:header] = :default
      settings[:cached_master_dir] = File.join(ENV['HOME'], '.octocatalog-diff-cache')
      settings[:safe_to_delete_cached_master_dir] = settings[:cached_master_dir]
      settings[:basedir] = Dir.pwd
      settings
    end
  end
end

The output:

D, [2021-02-14T10:24:31.214297 #11260] DEBUG -- : Running octocatalog-diff 2.0.0 with ruby 2.5.1
D, [2021-02-14T10:24:31.214435 #11260] DEBUG -- : Command line arguments: ["-d", "-n", "mongodb01.lud.home", "-f", "origin/dev", "-t", "origin/production", "--bootstrap-script", "/root/r10k.sh"]
D, [2021-02-14T10:24:31.214507 #11260] DEBUG -- : Running on host puppetserver01.lud.home (x86_64-linux-gnu)
D, [2021-02-14T10:24:31.214591 #11260] DEBUG -- : Compiling catalogs for mongodb01.lud.home
D, [2021-02-14T10:24:31.214789 #11260] DEBUG -- : Initialized OctocatalogDiff::Catalog::Computed for from-catalog
D, [2021-02-14T10:24:31.214853 #11260] DEBUG -- : Initialized OctocatalogDiff::Catalog::Computed for to-catalog
D, [2021-02-14T10:24:31.214930 #11260] DEBUG -- : Initialized parallel task result array: size=2
D, [2021-02-14T10:24:31.217427 #11260] DEBUG -- : Launched pid=11262 for index=0
D, [2021-02-14T10:24:31.217602 #11262] DEBUG -- : Begin build_catalog for origin/dev
D, [2021-02-14T10:24:31.217995 #11262] DEBUG -- : Setting up Puppet catalog build for origin/dev
D, [2021-02-14T10:24:31.218121 #11262] DEBUG -- : Catalog for origin/dev will be built with OctocatalogDiff::Catalog::Computed
D, [2021-02-14T10:24:31.218462 #11262] DEBUG -- : Calling build for object OctocatalogDiff::Catalog::Computed
D, [2021-02-14T10:24:31.219519 #11262] DEBUG -- : Start retrieving facts for mongodb01.lud.home from OctocatalogDiff::Catalog::Computed
D, [2021-02-14T10:24:31.219469 #11265] DEBUG -- : Begin build_catalog for origin/production
D, [2021-02-14T10:24:31.219453 #11260] DEBUG -- : Launched pid=11265 for index=1
D, [2021-02-14T10:24:31.219658 #11265] DEBUG -- : Setting up Puppet catalog build for origin/production
D, [2021-02-14T10:24:31.219711 #11262] DEBUG -- : Retrieving facts from PuppetDB
D, [2021-02-14T10:24:31.219793 #11265] DEBUG -- : Catalog for origin/production will be built with OctocatalogDiff::Catalog::Computed
D, [2021-02-14T10:24:31.220185 #11265] DEBUG -- : Calling build for object OctocatalogDiff::Catalog::Computed
D, [2021-02-14T10:24:31.220819 #11265] DEBUG -- : Start retrieving facts for mongodb01.lud.home from OctocatalogDiff::Catalog::Computed
D, [2021-02-14T10:24:31.221194 #11265] DEBUG -- : Retrieving facts from PuppetDB
D, [2021-02-14T10:24:31.586219 #11262] DEBUG -- : Success retrieving facts for mongodb01.lud.home from OctocatalogDiff::Catalog::Computed
D, [2021-02-14T10:24:31.587328 #11265] DEBUG -- : Success retrieving facts for mongodb01.lud.home from OctocatalogDiff::Catalog::Computed
D, [2021-02-14T10:24:31.588678 #11262] DEBUG -- : Begin git checkout /etc/puppetlabs/code/environments/dev:origin/dev -> /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-bootstrap-checkout-20210214-11262-u25ffc
D, [2021-02-14T10:24:31.588891 #11265] DEBUG -- : Begin git checkout /etc/puppetlabs/code/environments/dev:origin/production -> /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-bootstrap-checkout-20210214-11265-sz61pa
D, [2021-02-14T10:24:31.654730 #11262] DEBUG -- : ["Exit status: 0"]
D, [2021-02-14T10:24:31.654730 #11265] DEBUG -- : ["Exit status: 0"]
D, [2021-02-14T10:24:31.656742 #11265] DEBUG -- : Success git archive /etc/puppetlabs/code/environments/dev:origin/production
D, [2021-02-14T10:24:31.656759 #11262] DEBUG -- : Success git archive /etc/puppetlabs/code/environments/dev:origin/dev
D, [2021-02-14T10:24:31.657212 #11262] DEBUG -- : Success git checkout /etc/puppetlabs/code/environments/dev:origin/dev -> /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-bootstrap-checkout-20210214-11262-u25ffc
D, [2021-02-14T10:24:31.657232 #11265] DEBUG -- : Success git checkout /etc/puppetlabs/code/environments/dev:origin/production -> /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-bootstrap-checkout-20210214-11265-sz61pa
D, [2021-02-14T10:24:31.657851 #11265] DEBUG -- : Begin install bootstrap script in target directory
D, [2021-02-14T10:24:31.657851 #11262] DEBUG -- : Begin install bootstrap script in target directory
D, [2021-02-14T10:24:31.659762 #11262] DEBUG -- : Success: copied /root/r10k.sh to /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-bootstrap-checkout-20210214-11262-u25ffc/root/r10k.sh
D, [2021-02-14T10:24:31.659740 #11265] DEBUG -- : Success: copied /root/r10k.sh to /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-bootstrap-checkout-20210214-11265-sz61pa/root/r10k.sh
D, [2021-02-14T10:24:31.659886 #11262] DEBUG -- : Begin bootstrap with '/root/r10k.sh' in /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-bootstrap-checkout-20210214-11262-u25ffc
D, [2021-02-14T10:24:31.659886 #11265] DEBUG -- : Begin bootstrap with '/root/r10k.sh' in /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-bootstrap-checkout-20210214-11265-sz61pa
D, [2021-02-14T10:24:39.858324 #11265] DEBUG -- : Success bootstrap in /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-bootstrap-checkout-20210214-11265-sz61pa
D, [2021-02-14T10:24:39.860092 #11265] DEBUG -- : Symlinked /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production -> /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-bootstrap-checkout-20210214-11265-sz61pa
D, [2021-02-14T10:24:39.860290 #11265] DEBUG -- : Installed puppetdb.conf file at /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/puppetdb.conf
D, [2021-02-14T10:24:39.862435 #11265] DEBUG -- : Installed routes.yaml file at /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/routes.yaml
D, [2021-02-14T10:24:39.877872 #11265] DEBUG -- : Installed fact file at /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/var/yaml/facts/mongodb01.lud.home.yaml
D, [2021-02-14T10:24:39.878152 #11265] DEBUG -- : Beginning OctocatalogDiff::CatalogUtil::ENC::Script#execute for mongodb01.lud.home with /etc/puppetlabs/puppet/node.rb
D, [2021-02-14T10:24:39.897819 #11262] DEBUG -- : Success bootstrap in /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-bootstrap-checkout-20210214-11262-u25ffc
D, [2021-02-14T10:24:39.900034 #11262] DEBUG -- : Symlinked /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11262-1819am3/environments/production -> /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-bootstrap-checkout-20210214-11262-u25ffc
D, [2021-02-14T10:24:39.900262 #11262] DEBUG -- : Installed puppetdb.conf file at /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11262-1819am3/puppetdb.conf
D, [2021-02-14T10:24:39.902913 #11262] DEBUG -- : Installed routes.yaml file at /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11262-1819am3/routes.yaml
D, [2021-02-14T10:24:39.916314 #11262] DEBUG -- : Installed fact file at /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11262-1819am3/var/yaml/facts/mongodb01.lud.home.yaml
D, [2021-02-14T10:24:39.916451 #11262] DEBUG -- : Beginning OctocatalogDiff::CatalogUtil::ENC::Script#execute for mongodb01.lud.home with /etc/puppetlabs/puppet/node.rb
D, [2021-02-14T10:24:40.239015 #11265] DEBUG -- : ENC exited 0: 1460 bytes to STDOUT, 0 bytes to STDERR
D, [2021-02-14T10:24:40.239903 #11265] DEBUG -- : Installed ENC to echo content, 1460 bytes
D, [2021-02-14T10:24:40.241090 #11265] DEBUG -- : Installed SSL client certificate in /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/var/ssl/certs/puppetserver01.lud.home.pem
D, [2021-02-14T10:24:40.241580 #11265] DEBUG -- : Installed SSL client key in /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/var/ssl/private_keys/puppetserver01.lud.home.pem
D, [2021-02-14T10:24:40.241880 #11265] DEBUG -- : Installed CA certificate in /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/var/ssl/certs/ca.pem
D, [2021-02-14T10:24:40.340413 #11262] DEBUG -- : ENC exited 0: 1460 bytes to STDOUT, 0 bytes to STDERR
D, [2021-02-14T10:24:40.341576 #11262] DEBUG -- : Installed ENC to echo content, 1460 bytes
D, [2021-02-14T10:24:40.342811 #11262] DEBUG -- : Installed SSL client certificate in /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11262-1819am3/var/ssl/certs/puppetserver01.lud.home.pem
D, [2021-02-14T10:24:40.343042 #11262] DEBUG -- : Installed SSL client key in /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11262-1819am3/var/ssl/private_keys/puppetserver01.lud.home.pem
D, [2021-02-14T10:24:40.343512 #11262] DEBUG -- : Installed CA certificate in /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11262-1819am3/var/ssl/certs/ca.pem
D, [2021-02-14T10:24:42.330730 #11265] DEBUG -- : (to) Try 1 executing Puppet 6.20.0: /opt/puppetlabs/puppet/bin/puppet catalog compile mongodb01.lud.home --no-storeconfigs --node_terminus=exec --external_nodes=/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/enc.sh --factpath=/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/var/yaml/facts --facts_terminus=yaml --no-daemonize --color=false --environment=production --environmentpath=/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments --vardir=/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/var --logdir=/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/var --ssldir=/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/var/ssl --confdir=/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce
D, [2021-02-14T10:24:42.333538 #11265] DEBUG -- : ["Execute: /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-scriptrunner20210214-11265-9z0myi/puppet.sh catalog compile mongodb01.lud.home --no-storeconfigs --node_terminus\\=exec --external_nodes\\=/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/enc.sh --factpath\\=/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/var/yaml/facts --facts_terminus\\=yaml --no-daemonize --color\\=false --environment\\=production --environmentpath\\=/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments --vardir\\=/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/var --logdir\\=/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/var --ssldir\\=/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/var/ssl --confdir\\=/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce"]
D, [2021-02-14T10:24:42.463437 #11262] DEBUG -- : (from) Try 1 executing Puppet 6.20.0: /opt/puppetlabs/puppet/bin/puppet catalog compile mongodb01.lud.home --no-storeconfigs --node_terminus=exec --external_nodes=/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11262-1819am3/enc.sh --factpath=/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11262-1819am3/var/yaml/facts --facts_terminus=yaml --no-daemonize --color=false --environment=production --environmentpath=/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11262-1819am3/environments --vardir=/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11262-1819am3/var --logdir=/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11262-1819am3/var --ssldir=/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11262-1819am3/var/ssl --confdir=/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11262-1819am3
D, [2021-02-14T10:24:42.470460 #11262] DEBUG -- : ["Execute: /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-scriptrunner20210214-11262-1o91vut/puppet.sh catalog compile mongodb01.lud.home --no-storeconfigs --node_terminus\\=exec --external_nodes\\=/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11262-1819am3/enc.sh --factpath\\=/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11262-1819am3/var/yaml/facts --facts_terminus\\=yaml --no-daemonize --color\\=false --environment\\=production --environmentpath\\=/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11262-1819am3/environments --vardir\\=/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11262-1819am3/var --logdir\\=/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11262-1819am3/var --ssldir\\=/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11262-1819am3/var/ssl --confdir\\=/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11262-1819am3"]
D, [2021-02-14T10:24:44.514276 #11265] DEBUG -- : ["STDERR: Error: Execution of config_version command `/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production` failed: Execution of '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production' returned 128: fatal: not a git repository: '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/.git' on node mongodb01.lud.home"]
D, [2021-02-14T10:24:44.514974 #11265] DEBUG -- : ["STDERR: Error: Execution of config_version command `/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production` failed: Execution of '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production' returned 128: fatal: not a git repository: '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/.git' on node mongodb01.lud.home"]
D, [2021-02-14T10:24:44.515240 #11265] DEBUG -- : ["STDERR: Error: Could not call 'find' on 'catalog': Execution of config_version command `/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production` failed: Execution of '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production' returned 128: fatal: not a git repository: '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/.git' on node mongodb01.lud.home"]
D, [2021-02-14T10:24:44.515428 #11265] DEBUG -- : ["STDERR: Error: Could not call 'find' on 'catalog': Execution of config_version command `/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production` failed: Execution of '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production' returned 128: fatal: not a git repository: '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/.git' on node mongodb01.lud.home"]
D, [2021-02-14T10:24:44.516352 #11265] DEBUG -- : ["STDERR: Error: Try 'puppet help catalog compile' for usage"]
D, [2021-02-14T10:24:44.516455 #11265] DEBUG -- : ["Exit status: 1"]
W, [2021-02-14T10:24:44.517277 #11265]  WARN -- : Puppet command failed: STDOUT:
STDERR:
  Error: Execution of config_version command `/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production` failed: Execution of '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production' returned 128: fatal: not a git repository: '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/.git' on node mongodb01.lud.home
  Error: Execution of config_version command `/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production` failed: Execution of '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production' returned 128: fatal: not a git repository: '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/.git' on node mongodb01.lud.home
  Error: Could not call 'find' on 'catalog': Execution of config_version command `/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production` failed: Execution of '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production' returned 128: fatal: not a git repository: '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/.git' on node mongodb01.lud.home
  Error: Could not call 'find' on 'catalog': Execution of config_version command `/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production` failed: Execution of '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production' returned 128: fatal: not a git repository: '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/.git' on node mongodb01.lud.home
  Error: Try 'puppet help catalog compile' for usage
D, [2021-02-14T10:24:44.517505 #11265] DEBUG -- : (to) Catalog failed on try 1 in 4.274995594 seconds
D, [2021-02-14T10:24:44.518030 #11265] DEBUG -- : Catalog for origin/production failed with OctocatalogDiff::Catalog::Computed in 13.297905517 seconds
W, [2021-02-14T10:24:44.518441 #11265]  WARN -- : Failed build_catalog for origin/production validation: OctocatalogDiff::Errors::CatalogError Catalog failed: Error: Execution of config_version command `/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production` failed: Execution of '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production' returned 128: fatal: not a git repository: '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/.git' on node mongodb01.lud.home
Error: Execution of config_version command `/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production` failed: Execution of '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production' returned 128: fatal: not a git repository: '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/.git' on node mongodb01.lud.home
Error: Could not call 'find' on 'catalog': Execution of config_version command `/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production` failed: Execution of '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production' returned 128: fatal: not a git repository: '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/.git' on node mongodb01.lud.home
Error: Could not call 'find' on 'catalog': Execution of config_version command `/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production` failed: Execution of '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production' returned 128: fatal: not a git repository: '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/.git' on node mongodb01.lud.home
Error: Try 'puppet help catalog compile' for usage

D, [2021-02-14T10:24:44.537535 #11260] DEBUG -- : PID=11265 completed in 13.318063708 seconds, 40813 bytes
#<Thread:0x000055f50fac1778@/usr/lib/ruby/2.5.0/open3.rb:264 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
    1: from /usr/lib/ruby/2.5.0/open3.rb:264:in `block (2 levels) in capture3'
/usr/lib/ruby/2.5.0/open3.rb:264:in `read': stream closed in another thread (IOError)
#<Thread:0x000055f50fac15e8@/usr/lib/ruby/2.5.0/open3.rb:265 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
    1: from /usr/lib/ruby/2.5.0/open3.rb:265:in `block (2 levels) in capture3'
/usr/lib/ruby/2.5.0/open3.rb:265:in `read': stream closed in another thread (IOError)
Traceback (most recent call last):
    19: from /usr/local/bin/octocatalog-diff:23:in `<main>'
    18: from /usr/local/bin/octocatalog-diff:23:in `load'
    17: from /var/lib/gems/2.5.0/gems/octocatalog-diff-2.0.0/bin/octocatalog-diff:34:in `<top (required)>'
    16: from /var/lib/gems/2.5.0/gems/octocatalog-diff-2.0.0/lib/octocatalog-diff/cli.rb:125:in `cli'
    15: from /var/lib/gems/2.5.0/gems/octocatalog-diff-2.0.0/lib/octocatalog-diff/cli.rb:151:in `run_octocatalog_diff'
    14: from /var/lib/gems/2.5.0/gems/octocatalog-diff-2.0.0/lib/octocatalog-diff/api/v1.rb:19:in `catalog_diff'
    13: from /var/lib/gems/2.5.0/gems/octocatalog-diff-2.0.0/lib/octocatalog-diff/api/v1/catalog-diff.rb:34:in `catalog_diff'
    12: from /var/lib/gems/2.5.0/gems/octocatalog-diff-2.0.0/lib/octocatalog-diff/util/catalogs.rb:29:in `catalogs'
    11: from /var/lib/gems/2.5.0/gems/octocatalog-diff-2.0.0/lib/octocatalog-diff/util/catalogs.rb:92:in `build_catalog_parallelizer'
    10: from /var/lib/gems/2.5.0/gems/octocatalog-diff-2.0.0/lib/octocatalog-diff/util/parallel.rb:94:in `run_tasks'
     9: from /var/lib/gems/2.5.0/gems/octocatalog-diff-2.0.0/lib/octocatalog-diff/util/parallel.rb:114:in `run_tasks_parallel'
     8: from /var/lib/gems/2.5.0/gems/octocatalog-diff-2.0.0/lib/octocatalog-diff/util/parallel.rb:114:in `each_with_index'
     7: from /var/lib/gems/2.5.0/gems/octocatalog-diff-2.0.0/lib/octocatalog-diff/util/parallel.rb:114:in `each'
     6: from /var/lib/gems/2.5.0/gems/octocatalog-diff-2.0.0/lib/octocatalog-diff/util/parallel.rb:117:in `block in run_tasks_parallel'
     5: from /var/lib/gems/2.5.0/gems/octocatalog-diff-2.0.0/lib/octocatalog-diff/util/parallel.rb:117:in `fork'
     4: from /var/lib/gems/2.5.0/gems/octocatalog-diff-2.0.0/lib/octocatalog-diff/util/parallel.rb:119:in `block (2 levels) in run_tasks_parallel'
     3: from /var/lib/gems/2.5.0/gems/octocatalog-diff-2.0.0/lib/octocatalog-diff/util/parallel.rb:206:in `execute_task'
     2: from /var/lib/gems/2.5.0/gems/octocatalog-diff-2.0.0/lib/octocatalog-diff/util/parallel.rb:39:in `validate'
     1: from /var/lib/gems/2.5.0/gems/octocatalog-diff-2.0.0/lib/octocatalog-diff/util/parallel.rb:39:in `call'
/var/lib/gems/2.5.0/gems/octocatalog-diff-2.0.0/lib/octocatalog-diff/util/catalogs.rb:259:in `catalog_validator': Catalog failed: Error: Execution of config_version command `/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production` failed: Execution of '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production' returned 128: fatal: not a git repository: '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/.git' on node mongodb01.lud.home (OctocatalogDiff::Errors::CatalogError)
Error: Execution of config_version command `/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production` failed: Execution of '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production' returned 128: fatal: not a git repository: '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/.git' on node mongodb01.lud.home
Error: Could not call 'find' on 'catalog': Execution of config_version command `/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production` failed: Execution of '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production' returned 128: fatal: not a git repository: '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/.git' on node mongodb01.lud.home
Error: Could not call 'find' on 'catalog': Execution of config_version command `/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production` failed: Execution of '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/scripts/config_version.sh /tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments production' returned 128: fatal: not a git repository: '/tmp/ocd-ipc-20210214-11260-1f1hqgp/ocd-builddir-20210214-11265-3f7wce/environments/production/.git' on node mongodb01.lud.home
Error: Try 'puppet help catalog compile' for usage

Platform and version information

Do the tests pass from a clean checkout?

Anything else to add that you think will be helpful?

Compiling manually the catalog works:

puppet catalog compile mongodb01.lud.home \
--hiera_config=/etc/puppetlabs/code/environments/dev/hiera.yaml \
--environment=dev --external_nodes=/etc/puppetlabs/puppet/node.rb \
--environmentpath=/etc/puppetlabs/code/environments 2>/dev/null

Output: The output is huge, I can put it if require:

puppet catalog compile mongodb01.lud.home \
--hiera_config=/etc/puppetlabs/code/environments/dev/hiera.yaml \
--environment=dev --external_nodes=/etc/puppetlabs/puppet/node.rb \
--environmentpath=/etc/puppetlabs/code/environments 2>/dev/null | wc -l
1488

Without the git integration it's works:

octocatalog-diff -d -n mongodb01.lud.home \
--bootstrapped-from-dir /etc/puppetlabs/code/environments/dev \
--bootstrapped-to-dir /etc/puppetlabs/code/environments/production 

Output:

D, [2021-02-14T10:40:49.377482 #13302] DEBUG -- : Running octocatalog-diff 2.0.0 with ruby 2.5.1
D, [2021-02-14T10:40:49.377735 #13302] DEBUG -- : Command line arguments: ["-d", "-n", "mongodb01.lud.home", "--bootstrapped-from-dir", "/etc/puppetlabs/code/environments/dev", "--bootstrapped-to-dir", "/etc/puppetlabs/code/environments/production"]
D, [2021-02-14T10:40:49.377870 #13302] DEBUG -- : Running on host puppetserver01.lud.home (x86_64-linux-gnu)
D, [2021-02-14T10:40:49.378053 #13302] DEBUG -- : Compiling catalogs for mongodb01.lud.home
D, [2021-02-14T10:40:49.378633 #13302] DEBUG -- : Initialized OctocatalogDiff::Catalog::Computed for from-catalog
D, [2021-02-14T10:40:49.378712 #13302] DEBUG -- : Initialized OctocatalogDiff::Catalog::Computed for to-catalog
D, [2021-02-14T10:40:49.378791 #13302] DEBUG -- : Initialized parallel task result array: size=2
D, [2021-02-14T10:40:49.382031 #13302] DEBUG -- : Launched pid=13304 for index=0
D, [2021-02-14T10:40:49.382505 #13304] DEBUG -- : Begin build_catalog for origin/production
D, [2021-02-14T10:40:49.383120 #13304] DEBUG -- : Setting up Puppet catalog build for origin/production
D, [2021-02-14T10:40:49.383392 #13304] DEBUG -- : Catalog for origin/production will be built with OctocatalogDiff::Catalog::Computed
D, [2021-02-14T10:40:49.383693 #13304] DEBUG -- : Calling build for object OctocatalogDiff::Catalog::Computed
D, [2021-02-14T10:40:49.384165 #13302] DEBUG -- : Launched pid=13307 for index=1
D, [2021-02-14T10:40:49.384432 #13307] DEBUG -- : Begin build_catalog for .
D, [2021-02-14T10:40:49.384475 #13304] DEBUG -- : Start retrieving facts for mongodb01.lud.home from OctocatalogDiff::Catalog::Computed
D, [2021-02-14T10:40:49.384857 #13307] DEBUG -- : Setting up Puppet catalog build for .
D, [2021-02-14T10:40:49.384965 #13304] DEBUG -- : Retrieving facts from PuppetDB
D, [2021-02-14T10:40:49.385015 #13307] DEBUG -- : Catalog for . will be built with OctocatalogDiff::Catalog::Computed
D, [2021-02-14T10:40:49.385355 #13307] DEBUG -- : Calling build for object OctocatalogDiff::Catalog::Computed
D, [2021-02-14T10:40:49.385909 #13307] DEBUG -- : Start retrieving facts for mongodb01.lud.home from OctocatalogDiff::Catalog::Computed
D, [2021-02-14T10:40:49.386319 #13307] DEBUG -- : Retrieving facts from PuppetDB
D, [2021-02-14T10:40:49.571067 #13304] DEBUG -- : Success retrieving facts for mongodb01.lud.home from OctocatalogDiff::Catalog::Computed
D, [2021-02-14T10:40:49.573827 #13307] DEBUG -- : Success retrieving facts for mongodb01.lud.home from OctocatalogDiff::Catalog::Computed
D, [2021-02-14T10:40:49.574461 #13304] DEBUG -- : Symlinked /tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13304-1lid8gc/environments/production -> /etc/puppetlabs/code/environments/dev
D, [2021-02-14T10:40:49.574713 #13304] DEBUG -- : Installed puppetdb.conf file at /tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13304-1lid8gc/puppetdb.conf
D, [2021-02-14T10:40:49.575308 #13307] DEBUG -- : Symlinked /tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13307-n0j5u6/environments/production -> /etc/puppetlabs/code/environments/production
D, [2021-02-14T10:40:49.575556 #13307] DEBUG -- : Installed puppetdb.conf file at /tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13307-n0j5u6/puppetdb.conf
D, [2021-02-14T10:40:49.576367 #13304] DEBUG -- : Installed routes.yaml file at /tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13304-1lid8gc/routes.yaml
D, [2021-02-14T10:40:49.577023 #13307] DEBUG -- : Installed routes.yaml file at /tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13307-n0j5u6/routes.yaml
D, [2021-02-14T10:40:49.596418 #13304] DEBUG -- : Installed fact file at /tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13304-1lid8gc/var/yaml/facts/mongodb01.lud.home.yaml
D, [2021-02-14T10:40:49.596418 #13307] DEBUG -- : Installed fact file at /tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13307-n0j5u6/var/yaml/facts/mongodb01.lud.home.yaml
D, [2021-02-14T10:40:49.596699 #13307] DEBUG -- : Beginning OctocatalogDiff::CatalogUtil::ENC::Script#execute for mongodb01.lud.home with /etc/puppetlabs/puppet/node.rb
D, [2021-02-14T10:40:49.596699 #13304] DEBUG -- : Beginning OctocatalogDiff::CatalogUtil::ENC::Script#execute for mongodb01.lud.home with /etc/puppetlabs/puppet/node.rb
D, [2021-02-14T10:40:49.974384 #13304] DEBUG -- : ENC exited 0: 1460 bytes to STDOUT, 0 bytes to STDERR
D, [2021-02-14T10:40:49.975019 #13304] DEBUG -- : Installed ENC to echo content, 1460 bytes
D, [2021-02-14T10:40:49.975938 #13304] DEBUG -- : Installed SSL client certificate in /tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13304-1lid8gc/var/ssl/certs/puppetserver01.lud.home.pem
D, [2021-02-14T10:40:49.976144 #13304] DEBUG -- : Installed SSL client key in /tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13304-1lid8gc/var/ssl/private_keys/puppetserver01.lud.home.pem
D, [2021-02-14T10:40:49.976345 #13304] DEBUG -- : Installed CA certificate in /tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13304-1lid8gc/var/ssl/certs/ca.pem
D, [2021-02-14T10:40:50.118484 #13307] DEBUG -- : ENC exited 0: 1460 bytes to STDOUT, 0 bytes to STDERR
D, [2021-02-14T10:40:50.119464 #13307] DEBUG -- : Installed ENC to echo content, 1460 bytes
D, [2021-02-14T10:40:50.120300 #13307] DEBUG -- : Installed SSL client certificate in /tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13307-n0j5u6/var/ssl/certs/puppetserver01.lud.home.pem
D, [2021-02-14T10:40:50.120568 #13307] DEBUG -- : Installed SSL client key in /tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13307-n0j5u6/var/ssl/private_keys/puppetserver01.lud.home.pem
D, [2021-02-14T10:40:50.120821 #13307] DEBUG -- : Installed CA certificate in /tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13307-n0j5u6/var/ssl/certs/ca.pem
D, [2021-02-14T10:40:51.937682 #13304] DEBUG -- : (from) Try 1 executing Puppet 6.20.0: /opt/puppetlabs/puppet/bin/puppet catalog compile mongodb01.lud.home --no-storeconfigs --node_terminus=exec --external_nodes=/tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13304-1lid8gc/enc.sh --factpath=/tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13304-1lid8gc/var/yaml/facts --facts_terminus=yaml --no-daemonize --color=false --environment=production --environmentpath=/tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13304-1lid8gc/environments --vardir=/tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13304-1lid8gc/var --logdir=/tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13304-1lid8gc/var --ssldir=/tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13304-1lid8gc/var/ssl --confdir=/tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13304-1lid8gc
D, [2021-02-14T10:40:51.939402 #13304] DEBUG -- : ["Execute: /tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-scriptrunner20210214-13304-1sqiq28/puppet.sh catalog compile mongodb01.lud.home --no-storeconfigs --node_terminus\\=exec --external_nodes\\=/tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13304-1lid8gc/enc.sh --factpath\\=/tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13304-1lid8gc/var/yaml/facts --facts_terminus\\=yaml --no-daemonize --color\\=false --environment\\=production --environmentpath\\=/tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13304-1lid8gc/environments --vardir\\=/tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13304-1lid8gc/var --logdir\\=/tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13304-1lid8gc/var --ssldir\\=/tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13304-1lid8gc/var/ssl --confdir\\=/tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13304-1lid8gc"]
D, [2021-02-14T10:40:52.063112 #13307] DEBUG -- : (to) Try 1 executing Puppet 6.20.0: /opt/puppetlabs/puppet/bin/puppet catalog compile mongodb01.lud.home --no-storeconfigs --node_terminus=exec --external_nodes=/tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13307-n0j5u6/enc.sh --factpath=/tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13307-n0j5u6/var/yaml/facts --facts_terminus=yaml --no-daemonize --color=false --environment=production --environmentpath=/tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13307-n0j5u6/environments --vardir=/tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13307-n0j5u6/var --logdir=/tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13307-n0j5u6/var --ssldir=/tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13307-n0j5u6/var/ssl --confdir=/tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13307-n0j5u6
D, [2021-02-14T10:40:52.064405 #13307] DEBUG -- : ["Execute: /tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-scriptrunner20210214-13307-ilg7ec/puppet.sh catalog compile mongodb01.lud.home --no-storeconfigs --node_terminus\\=exec --external_nodes\\=/tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13307-n0j5u6/enc.sh --factpath\\=/tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13307-n0j5u6/var/yaml/facts --facts_terminus\\=yaml --no-daemonize --color\\=false --environment\\=production --environmentpath\\=/tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13307-n0j5u6/environments --vardir\\=/tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13307-n0j5u6/var --logdir\\=/tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13307-n0j5u6/var --ssldir\\=/tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13307-n0j5u6/var/ssl --confdir\\=/tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13307-n0j5u6"]
D, [2021-02-14T10:40:58.309725 #13304] DEBUG -- : ["STDERR: Warning: Undefined variable '::env'; "]
D, [2021-02-14T10:40:58.310452 #13304] DEBUG -- : ["STDERR:    (file & line not available)"]
D, [2021-02-14T10:40:58.310588 #13304] DEBUG -- : ["STDERR: Warning: /tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13304-1lid8gc/environments/production/hieradata/common.yaml: file does not contain a valid yaml hash"]
D, [2021-02-14T10:40:58.310695 #13304] DEBUG -- : ["Exit status: 0"]
D, [2021-02-14T10:40:58.311031 #13304] DEBUG -- : (from) Catalog succeeded on try 1 in 8.334346284 seconds
D, [2021-02-14T10:40:58.316949 #13304] DEBUG -- : Catalog for origin/production successfully built with OctocatalogDiff::Catalog::Computed in 8.933100872 seconds
D, [2021-02-14T10:40:58.317216 #13304] DEBUG -- : Success build_catalog for origin/production
D, [2021-02-14T10:40:58.320044 #13307] DEBUG -- : ["STDERR: Warning: Undefined variable '::role'; "]
D, [2021-02-14T10:40:58.320222 #13307] DEBUG -- : ["STDERR:    (file & line not available)"]
D, [2021-02-14T10:40:58.320352 #13307] DEBUG -- : ["STDERR: Warning: Undefined variable '::env'; "]
D, [2021-02-14T10:40:58.320519 #13307] DEBUG -- : ["STDERR:    (file & line not available)"]
D, [2021-02-14T10:40:58.320679 #13307] DEBUG -- : ["STDERR: Warning: Undefined variable '::zone'; "]
D, [2021-02-14T10:40:58.320826 #13307] DEBUG -- : ["STDERR:    (file & line not available)"]
D, [2021-02-14T10:40:58.321011 #13307] DEBUG -- : ["STDERR: Warning: /tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13307-n0j5u6/environments/production/hieradata/common.yaml: file does not contain a valid yaml hash"]
D, [2021-02-14T10:40:58.321174 #13307] DEBUG -- : ["Exit status: 0"]
D, [2021-02-14T10:40:58.321524 #13307] DEBUG -- : (to) Catalog succeeded on try 1 in 8.20031556 seconds
D, [2021-02-14T10:40:58.327472 #13307] DEBUG -- : Catalog for . successfully built with OctocatalogDiff::Catalog::Computed in 8.942101625 seconds
D, [2021-02-14T10:40:58.327648 #13307] DEBUG -- : Success build_catalog for .
D, [2021-02-14T10:40:58.328458 #13302] DEBUG -- : PID=13304 completed in 8.94646216 seconds, 60039 bytes
D, [2021-02-14T10:40:58.340629 #13302] DEBUG -- : PID=13307 completed in 8.956579272 seconds, 59985 bytes
D, [2021-02-14T10:40:58.340706 #13302] DEBUG -- : All child processes completed with no exceptions raised
I, [2021-02-14T10:40:58.341005 #13302]  INFO -- : Catalogs compiled for mongodb01.lud.home
D, [2021-02-14T10:40:58.341086 #13302] DEBUG -- : Begin compute diffs between catalogs
D, [2021-02-14T10:40:58.341488 #13302] DEBUG -- : Entering catdiff; catalog sizes: 24, 24
D, [2021-02-14T10:40:58.341544 #13302] DEBUG -- : Entering preprocess_diff; catalog sizes: 24, 24
D, [2021-02-14T10:40:58.342544 #13302] DEBUG -- : Exiting preprocess_diff; added 0, removed 0
D, [2021-02-14T10:40:58.342605 #13302] DEBUG -- : Entering hashdiff_initial; catalog sizes: 24, 24
D, [2021-02-14T10:40:58.356297 #13302] DEBUG -- : Exiting hashdiff_initial; changes: 7, nested changes: 0
D, [2021-02-14T10:40:58.356690 #13302] DEBUG -- : Ignoring {:type=>"Class", :title=>"Mongodb::Client", :attr=>"parameters\fensure"}, matches {:type=>"Class", :title=>"*", :attr=>"*"}
D, [2021-02-14T10:40:58.356853 #13302] DEBUG -- : Ignoring {:type=>"Class", :title=>"Mongodb::Globals", :attr=>"parameters\fversion"}, matches {:type=>"Class", :title=>"*", :attr=>"*"}
D, [2021-02-14T10:40:58.356971 #13302] DEBUG -- : Ignoring {:type=>"Class", :title=>"Mongodb::Repo", :attr=>"parameters\fversion"}, matches {:type=>"Class", :title=>"*", :attr=>"*"}
D, [2021-02-14T10:40:58.357115 #13302] DEBUG -- : Ignoring {:type=>"Class", :title=>"Mongodb::Server", :attr=>"parameters\fpackage_ensure"}, matches {:type=>"Class", :title=>"*", :attr=>"*"}
D, [2021-02-14T10:40:58.358126 #13302] DEBUG -- : Exiting catdiff; change count: 3
D, [2021-02-14T10:40:58.358185 #13302] DEBUG -- : Success compute diffs between catalogs
I, [2021-02-14T10:40:58.358301 #13302]  INFO -- : Diffs computed for mongodb01.lud.home
D, [2021-02-14T10:40:58.358831 #13302] DEBUG -- : Generating colored text output
D, [2021-02-14T10:40:58.359043 #13302] DEBUG -- : Added resources: 0
D, [2021-02-14T10:40:58.359096 #13302] DEBUG -- : Removed resources: 0
D, [2021-02-14T10:40:58.359151 #13302] DEBUG -- : Changed resources: 3
D, [2021-02-14T10:40:58.359302 #13302] DEBUG -- : Removed compilation directory in /tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13304-1lid8gc/environments/production/modules/mongodb/manifests/client.pp:14 -> environments/production/modules/mongodb/manifests/client.pp:14
D, [2021-02-14T10:40:58.359415 #13302] DEBUG -- : Removed compilation directory in /tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13307-n0j5u6/environments/production/modules/mongodb/manifests/client.pp:14 -> environments/production/modules/mongodb/manifests/client.pp:14
D, [2021-02-14T10:40:58.359472 #13302] DEBUG -- : Package[mongodb_client] @ environments/production/modules/mongodb/manifests/client.pp:14
D, [2021-02-14T10:40:58.369310 #13302] DEBUG -- : Removed compilation directory in /tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13304-1lid8gc/environments/production/modules/mongodb/manifests/server/install.pp:29 -> environments/production/modules/mongodb/manifests/server/install.pp:29
D, [2021-02-14T10:40:58.369451 #13302] DEBUG -- : Removed compilation directory in /tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13307-n0j5u6/environments/production/modules/mongodb/manifests/server/install.pp:29 -> environments/production/modules/mongodb/manifests/server/install.pp:29
D, [2021-02-14T10:40:58.369533 #13302] DEBUG -- : Package[mongodb_server] @ environments/production/modules/mongodb/manifests/server/install.pp:29
D, [2021-02-14T10:40:58.373740 #13302] DEBUG -- : Removed compilation directory in /tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13304-1lid8gc/environments/production/modules/mongodb/manifests/repo/yum.pp:7 -> environments/production/modules/mongodb/manifests/repo/yum.pp:7
D, [2021-02-14T10:40:58.373908 #13302] DEBUG -- : Removed compilation directory in /tmp/ocd-ipc-20210214-13302-1ig0btu/ocd-builddir-20210214-13307-n0j5u6/environments/production/modules/mongodb/manifests/repo/yum.pp:7 -> environments/production/modules/mongodb/manifests/repo/yum.pp:7
D, [2021-02-14T10:40:58.373999 #13302] DEBUG -- : Yumrepo[mongodb] @ environments/production/modules/mongodb/manifests/repo/yum.pp:7
diff origin/production/mongodb01.lud.home current/mongodb01.lud.home
*******************************************
  Package[mongodb_client] =>
   parameters =>
     ensure =>
      - absent
      + latest
*******************************************
  Package[mongodb_server] =>
   parameters =>
     ensure =>
      - absent
      + latest
*******************************************
  Yumrepo[mongodb] =>
   parameters =>
     baseurl =>
      - https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/absent./$basearch/
      + https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/latest./$basearch/
*******************************************
ahayworth commented 3 years ago

Hi @lud97x -

I'm not certain I completely understand the problem. octocatalog-diff is designed to work in a git repository, and that's why it defaults to the assumption that you're in a git repository. That's probably not a default we're interested in changing right now.

However, it does seem as though it works correctly when you pass the bootstrapped-{to,from}-dir arguments, so I suspect that octocatalog-diff just doesn't understand the structure of the repository or directory you're running it from.

I'm not entirely familiar with the control-repo pattern from puppet, we don't use it internally at GitHub. Is the path /etc/puppetlabs/code/environments/dev a working git checkout?

lud97x commented 3 years ago

Hi @ahayworth ,

I use r10k to create each puppet environment ( dev and production folders), so maybe r10k is doing something different than git. The path /etc/puppetlabs/code/environments/dev includes the puppet control-repo from a git repo and the folder modules/ all the puppet modules present in a Puppetfile.

Inside the /etc/puppetlabs/code/environments/dev:

git status
HEAD detached at e229c40
Untracked files:
  (use "git add <file>..." to include in what will be committed)

    .r10k-deploy.json
    modules/
---
git log --oneline
e229c40 (HEAD, origin/dev, cache/dev) diff
2c5ae3a diff
---
git branch
* (HEAD detached at e229c40)
  production
---
git checkout production 
Previous HEAD position was e229c40 diff
Switched to branch 'production'
Your branch is up to date with 'origin/production'.
---

The folder structure looks like this:

control-repo/
├── data/                               
│   ├── nodes/                            
│   └── common.yaml                      
├── manifests/
│   └── site.pp                         
├── scripts/
│   ├── code_manager_config_version.rb   
│   ├── config_version.rb                 
│   └── config_version.sh 
|── modules/          # <--------  populate with the command  'r10k puppetfile install Puppetfile'      
├── site-modules/                  
│   ├── profile/                      
│   └── role/                      
├── LICENSE
├── Puppetfile    
├── README.md
├── environment.conf                     
└── hiera.yaml                            

What is the expected repository structure ?

ahayworth commented 3 years ago

What is the expected repository structure ?

I think your repo structure is okay, actually. Looking through the output, I can see that octocatalog-diff actually does find the production and dev branches correctly, and copies them to the /tmp compilation dirs as expected. Apologies for the misdirection there 😆

As your issue title mentioned, the issue really is the config_version.sh script; it's expecting to be in a git repository but octocatalog-diff is not actually copying the whole git repo over. It's doing a git archive, which doesn't include the .git subdirectory, so any git commands fail.

I don't think, however, that we need the config_version.sh script to actually run at all. It's not necessary at this point, and octocatalog-diff passes a CLI flag that purports to disable it completely for older versions of puppet: https://github.com/github/octocatalog-diff/blob/5ae7f1b009ced6edccc11c803018c9fc1420ab00/lib/octocatalog-diff/catalog-util/command.rb#L111-L121 (The flag didn't work on newer versions).

I think we should just figure out how to skip the config_version.sh entirely here. Looking at puppet's docs, it looks like the script itself is configurable: https://puppet.com/docs/puppet/7.4/config_file_environment.html

Could you try disabling that in the environment config and re-running?

lud97x commented 3 years ago

Hi @ahayworth

You were right, I did a quick fix by commenting the git cmd in the config_version.sh like below:

#elif type git >/dev/null; then
  # The git command is available.
#  git --git-dir $1/$2/.git rev-parse HEAD

The result below:

/etc/puppetlabs/code/environments/dev# octocatalog-diff -n mongodb01.lud.home --bootstrap-script /root/r10k.sh
I, [2021-02-22T19:36:12.578744 #9551]  INFO -- : Catalogs compiled for mongodb01.lud.home
I, [2021-02-22T19:36:12.588685 #9551]  INFO -- : Diffs computed for mongodb01.lud.home
diff origin/production/mongodb01.lud.home current/mongodb01.lud.home
*******************************************
  Package[mongodb_client] =>
   parameters =>
     ensure =>
      - latest
      + absent
*******************************************
  Package[mongodb_server] =>
   parameters =>
     ensure =>
      - latest
      + absent
*******************************************
  Yumrepo[mongodb] =>
   parameters =>
     baseurl =>
      - https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/latest./$basearch/
      + https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/absent./$basearch/
*******************************************

So it is working now :), thank you.

ahayworth commented 3 years ago

Happy to help! 😄