You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rescue Psych::SyntaxError => e
^^^^^
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/pdk-3.2.0/lib/pdk/validate/yaml/yaml_syntax_validator.rb:51:in `validate_target'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/pdk-3.2.0/lib/pdk/validate/internal_ruby_validator.rb:66:in `block in invoke'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/pdk-3.2.0/lib/pdk/validate/internal_ruby_validator.rb:65:in `each'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/pdk-3.2.0/lib/pdk/validate/internal_ruby_validator.rb:65:in `invoke'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/pdk-3.2.0/lib/pdk/validate/validator_group.rb:89:in `block in invoke'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/pdk-3.2.0/lib/pdk/validate/validator_group.rb:88:in `each'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/pdk-3.2.0/lib/pdk/validate/validator_group.rb:88:in `invoke'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/pdk-3.2.0/lib/pdk/validate.rb:86:in `block (2 levels) in invoke_validators_by_name'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/pdk-3.2.0/lib/pdk/cli/exec_group.rb:68:in `map'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/pdk-3.2.0/lib/pdk/cli/exec_group.rb:68:in `exit_code'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/pdk-3.2.0/lib/pdk/validate.rb:90:in `invoke_validators_by_name'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/pdk-3.2.0/lib/pdk/cli/validate.rb:99:in `block (2 levels) in <module:CLI>'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/cri-2.15.12/lib/cri/command.rb:362:in `run_this'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/cri-2.15.12/lib/cri/command.rb:298:in `run'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/cri-2.15.12/lib/cri/command.rb:316:in `run'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/pdk-3.2.0/lib/pdk/cli.rb:58:in `run'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/pdk-3.2.0/exe/pdk:6:in `<top (required)>'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/bin/pdk:25:in `load'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/bin/pdk:25:in `<main>'
::YAML.safe_load(PDK::Util::Filesystem.read_file(target), permitted_classes: YAML_ALLOWLISTED_CLASSES, permitted_symbols: [], aliases: true)
^^^^^^
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/pdk-3.2.0/lib/pdk/validate/internal_ruby_validator.rb:66:in `block in invoke'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/pdk-3.2.0/lib/pdk/validate/internal_ruby_validator.rb:65:in `each'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/pdk-3.2.0/lib/pdk/validate/internal_ruby_validator.rb:65:in `invoke'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/pdk-3.2.0/lib/pdk/validate/validator_group.rb:89:in `block in invoke'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/pdk-3.2.0/lib/pdk/validate/validator_group.rb:88:in `each'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/pdk-3.2.0/lib/pdk/validate/validator_group.rb:88:in `invoke'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/pdk-3.2.0/lib/pdk/validate.rb:86:in `block (2 levels) in invoke_validators_by_name'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/pdk-3.2.0/lib/pdk/cli/exec_group.rb:68:in `map'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/pdk-3.2.0/lib/pdk/cli/exec_group.rb:68:in `exit_code'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/pdk-3.2.0/lib/pdk/validate.rb:90:in `invoke_validators_by_name'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/pdk-3.2.0/lib/pdk/cli/validate.rb:99:in `block (2 levels) in <module:CLI>'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/cri-2.15.12/lib/cri/command.rb:362:in `run_this'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/cri-2.15.12/lib/cri/command.rb:298:in `run'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/cri-2.15.12/lib/cri/command.rb:316:in `run'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/pdk-3.2.0/lib/pdk/cli.rb:58:in `run'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/pdk-3.2.0/exe/pdk:6:in `<top (required)>'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/bin/pdk:25:in `load'
from /opt/puppetlabs/pdk/private/ruby/3.2.3/bin/pdk:25:in `<main>'
The previous version I had installed was 3.0.1.3-1jammy and had been working fine.
Jeff
The text was updated successfully, but these errors were encountered:
I am getting this issue as well when specifying a specific yaml file to validate.
Works:
pdk validate yaml
Doesn't work
pdk validate yaml data/common.yaml
As a workaround, I added the following to the top of my yaml_syntax_validator.rb in my PDK. Your path my vary. You should see it near the top of your stacktrace /opt/puppetlabs/pdk/private/ruby/3.2.5/lib/ruby/gems/3.2.0/gems/pdk-3.3.0/lib/pdk/validate/yaml/yaml_syntax_validator.rb
This bug seems similar to #1353 but not exactly the same.
PDK validate fails to complete when checking YAML files.
platform: Ubuntu 22.04.4 LTS
package: pdk 3.2.0.1-1jammy amd64 Puppet Development Kit
$ pdk validate nodes/mail.hi.umn.edu.yaml
pdk (INFO): Using Ruby 3.2.3
pdk (INFO): Using Puppet 8.6.0
pdk (INFO): Running all available validators...
┌ [✔] Running metadata validators ...
└── [✔] Checking metadata syntax (metadata.json tasks/.json).
┌ [✔] Running puppet validators ...
┌ [✔] Running ruby validators ...
└── [✔] Checking Ruby code style (/.rb).
┌ [✔] Running tasks validators ...
├── [✔] Checking task names (tasks/**/).
└── [✔] Checking task metadata style (tasks/.json).
┌ [|] Running yaml validators ...
└── [|] Checking YAML syntax (**/.yaml **/*.yml).
/opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/pdk-3.2.0/lib/pdk/validate/yaml/yaml_syntax_validator.rb:61:in `rescue in validate_target': uninitialized constant PDK::Validate::YAML::YAMLSyntaxValidator::Psych (NameError)
/opt/puppetlabs/pdk/private/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/pdk-3.2.0/lib/pdk/validate/yaml/yaml_syntax_validator.rb:52:in `validate_target': uninitialized constant YAML (NameError)
The previous version I had installed was 3.0.1.3-1jammy and had been working fine.
Jeff
The text was updated successfully, but these errors were encountered: