This message was deleted.
# bolt
s
This message was deleted.
1
k
Looking at
puppet-7.26.0/lib/puppet/pops/issue_reporter.rb
, I suppose that the errors should be emitted to logs. ... but I found none in the TARGET's log dir.
Copy code
$ ssh root@TARGET find /var/log/puppetlabs/ -ls
 68735658      0 drwxr-xr-x   4 root     root           37 Nov 24 04:56 /var/log/puppetlabs/
135466937      0 drwxr-x---   2 root     root            6 Oct 23 18:03 /var/log/puppetlabs/puppet
203131081      0 drwxr-x---   2 root     root            6 Oct 23 18:03 /var/log/puppetlabs/pxp-agent
y
Check bolt-debug.log in the directory where you ran bolt from
k
@Yury Bushmelev Thanks. Yeah, of course I checked it but it contains nothing more than what bolt prints to console.
@helindbe Thanks. The command was new to me. Unfortunately it reports nothing.
Copy code
$ /opt/puppetlabs/bin/puppet parser validate PATH/TO/MODULE/manifests/FILE.pp
(nothing printed)
... on both the machine I run bolt and the target node.
I resorted to inserting a line to force Bolt to report the contents of the `errors' variable.
Copy code
raise(errors.map { |e| Puppet::pops::Validation::DiagnosticFormatterPuppetStyle.new.format(e) }.join("\n")) # <===
      giving_up_message = if (emit_warnings && warnings.size > 0)
                            _("Language validation logged %{error_count} errors, and %{warning_count} warnings. Giving up") %
                                { error_count: errors.size, warning_count: warnings.size }
and I got these:
Copy code
Failed on TARGET:
  Apply failed to compile for TARGET: Unacceptable location. The name 'MODULE::DEFINITION1' is unacceptable in file 'PATH_TO_MANIFEST/FILE.pp' at PATH_TO_MANIFEST/FILE.pp:two:1
  Unacceptable location. The name 'MODULE::DEFINITION2' is unacceptable in file 'PATH_TO_MANIFEST/FILE.pp' at PATH_TO_MANIFEST/FILE.pp:26:1 (line: 1, column: 58)
OK. Now I can fix my manifest... But I hope bolt will be improved in its diagnostic functionality.