Jira (PUP-9506) Tried to load unspecified class: Time

32 views
Skip to first unread message

Clayton Wight (JIRA)

unread,
Feb 20, 2019, 11:28:03 PM2/20/19
to puppe...@googlegroups.com
Clayton Wight created an issue
 
Puppet / Bug PUP-9506
Tried to load unspecified class: Time
Issue Type: Bug Bug
Affects Versions: PUP 6.3.0
Assignee: Unassigned
Components: AIO
Created: 2019/02/20 8:27 PM
Priority: Major Major
Reporter: Clayton Wight

Greetings,

 

We just updated from Puppet 5 to Puppet 6. We keep getting this error on puppet runs. Unable to find the cause. Here is the error message below.

error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Failed when searching for node utonx.xxxx.xxx: Could1 not load external node results for utonx.xxxx.xxx: (<unknown>): Tried to load unspecified class: Time

 

Clayton

 

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Clayton Wight (JIRA)

unread,
Feb 20, 2019, 11:31:05 PM2/20/19
to puppe...@googlegroups.com
Clayton Wight updated an issue
Change By: Clayton Wight
Greetings,

 

We just updated from Puppet 5 to Puppet 6. We keep getting this error on puppet runs. Unable to find the cause. Here is the error message below.

error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Failed when searching for node utonx.xxxx.xxx: Could1 Could not load external node results for utonx.xxxx.xxx: (<unknown>): Tried to load unspecified class: Time

 

Clayton

 

Henrik Lindberg (JIRA)

unread,
Feb 21, 2019, 6:13:03 AM2/21/19
to puppe...@googlegroups.com
Henrik Lindberg commented on Bug PUP-9506
 
Re: Tried to load unspecified class: Time

There is very little to go on here - Clayton Wight [X] can you supply a stacktrace for the error logged on the master for this error?
Or provide us with some other means to recreate the problem.

Henrik Lindberg (JIRA)

unread,
Feb 21, 2019, 6:14:03 AM2/21/19
to puppe...@googlegroups.com
Henrik Lindberg assigned an issue to Clayton Wight
 
Change By: Henrik Lindberg
Assignee: Clayton Wight

Clayton Wight (JIRA)

unread,
Feb 21, 2019, 11:21:03 AM2/21/19
to puppe...@googlegroups.com
Clayton Wight commented on Bug PUP-9506
 
Re: Tried to load unspecified class: Time

2019-02-21T08:19:00.793-08:00 ERROR [qtp1174013588-17501] [puppetserver] Puppet Failed when searching for node utonx.xxxx.xxx..com: Could1 not load external node results for utonx.xxx.xxx: (<unknown>): Tried to load unspecified class: Time
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/yaml.rb:32:in `safe_load'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/node/exec.rb:52:in `translate'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/node/exec.rb:19:in `find'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:194:in `find'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:343:in `block in find_node'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler/around_profiler.rb:58:in `profile'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler.rb:51:in `profile'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:340:in `find_node'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:381:in `node_from_request'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:49:in `find'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:194:in `find'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/api/indirected_routes.rb:127:in `do_find'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/api/indirected_routes.rb:54:in `block in call'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:252:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/api/indirected_routes.rb:53:in `call'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:82:in `block in process'
org/jruby/RubyArray.java:1801:in `each'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:81:in `process'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:87:in `process'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:87:in `process'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:87:in `block in process'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:70:in `block in with_request_profiling'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler/around_profiler.rb:58:in `profile'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler.rb:51:in `profile'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:66:in `with_request_profiling'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:86:in `block in process'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:93:in `respond_to_errors'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:85:in `process'
uri:classloader:/puppetserver-lib/puppet/server/master.rb:42:in `handleRequest'
2019-02-21T08:19:00.794-08:00 ERROR [qtp1174013588-17501] [puppetserver] Puppet Server Error: Failed when searching for node utonx.xxx.xxx.com: Could1 not load external node results for utonx.xxx.xxx..com: (<unknown>): Tried to load unspecified class: Time
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/yaml.rb:32:in `safe_load'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/node/exec.rb:52:in `translate'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/node/exec.rb:19:in `find'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:194:in `find'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:343:in `block in find_node'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler/around_profiler.rb:58:in `profile'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler.rb:51:in `profile'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:340:in `find_node'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:381:in `node_from_request'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:49:in `find'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:194:in `find'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/api/indirected_routes.rb:127:in `do_find'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/api/indirected_routes.rb:54:in `block in call'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:252:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/api/indirected_routes.rb:53:in `call'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:82:in `block in process'
org/jruby/RubyArray.java:1801:in `each'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:81:in `process'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:87:in `process'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:87:in `process'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:87:in `block in process'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:70:in `block in with_request_profiling'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler/around_profiler.rb:58:in `profile'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler.rb:51:in `profile'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:66:in `with_request_profiling'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:86:in `block in process'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:93:in `respond_to_errors'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:85:in `process'
uri:classloader:/puppetserver-lib/puppet/server/master.rb:42:in `handleRequest'

Henrik Lindberg (JIRA)

unread,
Feb 21, 2019, 12:35:02 PM2/21/19
to puppe...@googlegroups.com

Clayton Wight I think this is safe_yaml telling you that it is not allowed to handle a Ruby Time class. I suspect this is a custom fact. It is no longer allowed to send arbitrary Ruby values in yaml (it is a security concern). Hope that helps you pinpoint where the problem may be.

Clayton Wight (JIRA)

unread,
Feb 22, 2019, 4:29:06 PM2/22/19
to puppe...@googlegroups.com
Clayton Wight commented on Bug PUP-9506

So I did some checking its only failing on  some hosts and working on some.

Clayton

Josh Cooper (JIRA)

unread,
Mar 29, 2019, 1:04:02 PM3/29/19
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-9506

Clayton Wight it looks like you have a custom ENC script which is returning something that looks like a timestamp. YAML will attempt to deserialize that as a Time object, but that is not in our safe_yaml whitelist of acceptable classes. Can you provide more info on the YAML that the ENC script is returning?

Josh Cooper (JIRA)

unread,
Apr 5, 2019, 1:16:03 AM4/5/19
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Change By: Josh Cooper
Component/s: AIO

Jake Spain (JIRA)

unread,
May 7, 2019, 10:17:03 AM5/7/19
to puppe...@googlegroups.com
Jake Spain commented on Bug PUP-9506
 
Re: Tried to load unspecified class: Time

I am experiencing the exact same issue. "Tried to load unspecified class: Time" on a Puppet agent run only after upgrading master & agent from Puppet 5 to Puppet 6.

 

We are using a standalone (non-AIO) Puppet Master to send reports to a separate Foreman instance following the setup instruction.] by copying the foreman.rb report processor, node.rb ENC script, creating the foreman.yaml config file, and adding foreman reports to the master config.

 

I made sure these files were up to date with upstream, but no luck.

The yaml being returned by running /etc/puppetlabs/puppet/node.rb master.example.com:

---
parameters:
  kt_env: Production
  kt_cv: Base_RHEL_7_Repos
  foreman_host_collections:
  - Auto_Patch_and_Reboot_Tuesday
  lifecycle_environment: Production
  content_view: Base_RHEL_7_Repos
  content_view_info:
  label: Base_RHEL_7_Repos
  latest-version: '22.0'
  version: '21.0'
  published: 2019-04-23 14:44:00.319456000 Z
  components: {}
  kickstart_repository:
  foreman_subnets: []
  foreman_interfaces:
  - ip: x.x.x.x
  ip6:
  mac: xx:xx:xx:xx:xx:xx
  name: master.example.com
  attrs:
  mtu: 1500
  netmask6: 'ffff:ffff:ffff:ffff::'
  netmask: x.x.x.x
  network6: 'fe80::'
  network: x.x.x.x
  virtual: false
  link: true
  identifier: eth0
  managed: true
  primary: true
  provision: true
  subnet:
  subnet6:
  tag:
  attached_to:
  type: Interface
  - ip:
  ip6:
  mac: xx:xx:xx:xx:xx:xx
  name: ''
  attrs:
  mtu: 1500
  virtual: false
  link: true
  identifier: eth1
  managed: false
  primary: false
  provision: false
  subnet:
  subnet6:
  tag:
  attached_to:
  type: Interface
  location: Default
  location_title: Default
  organization: Default
  organization_title: Default
  domainname: exmple.com
  owner_name: Test User
  owner_email: te...@example.com
  ssh_authorized_keys: []
  foreman_users:
  test:
  firstname: Test
  lastname: User
  mail: te...@example.com
  description: ''
  fullname: Test User
  name: test
  ssh_authorized_keys: []
  root_pw:
  foreman_config_groups: []
  puppetmaster: ''
  foreman_env: production
  enable-epel: 'false'
  enable-puppet5: 'true'
  remote_execution_ssh_keys:
  remote_execution_ssh_user: foreman-service
  remote_execution_effective_user_method: sudo
  remote_execution_connect_by_ip: false
classes: {}
environment: production

 

Thanks,

Jake

Josh Cooper (JIRA)

unread,
May 7, 2019, 12:08:03 PM5/7/19
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-9506

The issue is the returned YAML contains a timestamp:

 

  published: 2019-04-23 14:44:00.319456000 Z


 
And the exec terminus needs to add Time to the list of allowed classes:

    Puppet::Util::Yaml.safe_load(output, [Symbol]).inject({}) do |hash, data|

 

Clayton Wight (JIRA)

unread,
May 7, 2019, 12:28:03 PM5/7/19
to puppe...@googlegroups.com
Clayton Wight updated an issue
 

Josh,

What file gets updated with this info?

Clayton

From: Josh Cooper (JIRA) <issue-update...@puppet.com>
Sent: Tuesday, May 7, 2019 10:08 AM
To: CLAYTON WIGHT <Clayto...@raytheon.com>
Subject: [External] Jira (PUP-9506) Tried to load unspecified class: Time

[cid:image0...@01D504BE.5982F670]

Josh Cooper<https://tickets.puppetlabs.com/secure/ViewProfile.jspa?name=josh> commented on [Bug] PUP-9506<https://tickets.puppetlabs.com/browse/PUP-9506>

Re: Tried to load unspecified class: Time<https://tickets.puppetlabs.com/browse/PUP-9506>

The issue is the returned YAML contains a timestamp:

published: 2019-04-23 14:44:00.319456000 Z

And the exec terminus needs to add Time to the list of allowed classes:

Puppet::Util::Yaml.safe_load(output, [Symbol]).inject({}) do |hash, data|

This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)

[Atlassian logo]

Change By: Clayton Wight
Attachment: image002.png

Henrik Lindberg (JIRA)

unread,
May 7, 2019, 2:02:03 PM5/7/19
to puppe...@googlegroups.com

Josh Cooper Are you sure we want to let this Ruby data type trough?

Josh Cooper (JIRA)

unread,
May 7, 2019, 7:06:03 PM5/7/19
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-9506

Clayton Wight It's this line here. It would need to specify [Symbol, Time] in order to allow a Time object to be deserialized. However, to Henrik Lindberg point, I don't think we want to allow that. Our documentation states: Each (parameter) value can be a string, number, array, or hash.

I believe this issue is caused because Foreman's ENC script is emitting published: 2019-04-23 14:44:00.319456000 Z. The script should return the value as either a number (like milliseconds since the epoch), a quoted time value (like '2019-04-23 14:44:00.319456000 Z'), or it should be emitted from the ENC output altogether. I assume the published field is just metadata that accidentally ends up being returned to puppet?

Also, there appears to be prior art for filtering data this way. The ENC script quotes macaddresses so YAML doesn't interpret them as base-60.

I'm going to close this issue. Please file an issue with Foreman.

Jake Spain (JIRA)

unread,
May 8, 2019, 12:58:04 PM5/8/19
to puppe...@googlegroups.com
Jake Spain commented on Bug PUP-9506

Thank you all for your time in identifying the issue and I understand why it cannot be changed for security purposes.

For anyone else who comes across this problem I have opened an issue with theForeman at https://projects.theforeman.org/issues/26763 as well as a Satellite related case with Red Hat.

 

Best,

Jake

Josh Cooper (JIRA)

unread,
May 8, 2019, 1:31:04 PM5/8/19
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages