Issue #22804 has been updated by Andrew Parker. Status changed from Unreviewed to Investigating
The error is caused by creating a top level `Encoding` constant, that causes the pson code to think that it is working on a version of ruby that supports encoded strings. The other bug (#21512) points out that the problem was created by `include REXML`. What is happening is that `REXML` has a constant in it called `Encoding` and when it is included outside of a module or class it ends up placing the `REXML::Encoding` constant at the top level, thereby creating a `::Encoding`. You can see this with some irb exercises: <pre> 1.8.7 :001 > defined?(::Encoding) => nil 1.8.7 :002 > require 'rexml/document' => true 1.8.7 :003 > defined?(::Encoding) => nil 1.8.7 :004 > include REXML => Object 1.8.7 :005 > defined?(::Encoding) => "constant" 1.8.7 :006 > ::Encoding => REXML::Encoding 1.8.7 :007 > </pre> The pson code is, reasonably in my opinion, assuming that `::Encoding` is the ruby string encoding system and not something else having created an `Encoding` constant. Once pson determines that encodings are available it starts trying to manipulate the encodings of a string. I looked through the netapp module and tracked it down to what looks like a problem in the NetApp code itself. You can see in the patch that you apply to `NaServer.rb` (<https://github.com/fatmcgav/fatmcgav-netapp/blob/master/files/NaServer.patch#L4>) that it appears to include `REXML` outside of a module. ---------------------------------------- Bug #22804: NetApp network device failing with Puppet >3.2.1 - "Could not intern..." https://projects.puppetlabs.com/issues/22804#change-98613 * Author: Gavin Williams * Status: Investigating * Priority: High * Assignee: * Category: * Target version: * Affected Puppet version: 3.2.1 * Keywords: intern, netapp, network device * Branch: ---------------------------------------- I have recently created a Puppet 3.3.1 sandbox env using Vagrant/VirtualBox. However Puppet device is failing with my NetApp network device module (http://github.com/fatmcgav/fatmcgav-netapp). <pre> puppet device --deviceconfig device/ontap.local.dev.conf -v Info: starting applying configuration to ontap.local.dev at https://root:[email protected] Warning: Unable to fetch my node definition, but the agent run will continue: Warning: Could not intern from text/pson: undefined method `encoding' for #<String:0x7f408428e0a8> Info: Retrieving plugin Error: /File[/var/lib/puppet/devices/ontap.local.dev/lib]: Failed to generate additional resources using 'eval_generate': Could not intern_multiple from text/pson: undefined method `encoding' for #<String:0x7f4084135850> Error: /File[/var/lib/puppet/devices/ontap.local.dev/lib]: Could not evaluate: Could not intern from text/pson: undefined method `encoding' for #<String:0x7f408412b7d8> Could not retrieve file metadata for puppet://puppetmaster.local.dev/plugins: Could not intern from text/pson: undefined method `encoding' for #<String:0x7f408412b7d8> Error: Could not retrieve catalog from remote server: Could not intern from text/pson: undefined method `encoding' for #<String:0x7f40840acf28> Error: Cached catalog for ontap.local.dev failed: Could not parse JSON data for catalog ontap.local.dev: Could not intern from pson: undefined method `encoding' for #<String:0x7f40840a22a8> Notice: Using cached catalog Error: Could not retrieve catalog; skipping run Error: Could not send report: undefined method `encoding' for "[\"foreman\"]":String </pre> The issue only appears to affect my NetApp network device, as 'puppet agent' on the same host works as expected. Full trace output attached. Similar error seen in #21512 Centos 6.4 x64, Ruby 1.8.7 -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/groups/opt_out.
