handy tip against unhelpful "Could not intern from pson" error

3,225 views
Skip to first unread message

Luke Bigum

unread,
Aug 24, 2011, 11:23:39 AM8/24/11
to Puppet Users
Not sure if people are already aware of this, but it might save
someone some time in the future. I've been tracking down the following
error today, it's rather unhelpful in telling you where the problem is
in your manifests:

# puppetd --test
info: Retrieving plugin
err: Could not retrieve catalog from remote server: Could not intern
from pson: Could not convert from pson: Could not find relationship
target "Service[]"

The problem is the parser using an empty string as a resource name
which I arrived at by using a variable inside double quotes for a
resource declaration. I did this for style (or have been until now) -
I like to have user defined strings in quotes so it easily
distinguishes between them and puppet keywords, plus for syntax
highlighting, etc. Turns out this personal preference has shot me in
the foot as the difference between the error messages for an empty
string versus an undefined variable is rather big.

See this unhelpful message:

$service_name = "httpd"
service { "$servicename": ensure => running }
err: Could not retrieve catalog from remote server: Could not intern
from pson: Could not convert from pson: Could not find relationship
target "Service[]"

versus this:

$service_name = "httpd"
service { "$servicename": ensure => running }
err: /Stage[main]/Puppet_dashboard::Service/Service[undef]/ensure:
change from stopped to running failed: Could not start Service[undef]:
Execution of '/sbin/service undef start' returned 1: at /etc/puppet/
environments/testing/modules/httpd/manifests/service.pp:26

Henrik Lindberg

unread,
Aug 24, 2011, 12:12:46 PM8/24/11
to puppet...@googlegroups.com
I can't see any difference between your two examples.
Typo?
- henrik

Luke Bigum

unread,
Aug 24, 2011, 12:21:21 PM8/24/11
to Puppet Users
Cheers, that'll teach me to cut and paste ;)

The second example's resource name should be without quotes, so:

$service_name = "httpd"
service { $servicename: ensure => running }
err: /Stage[main]/Puppet_dashboard::Service/Service[undef]/ensure:
change from stopped to running failed: Could not start Service[undef]:
Execution of '/sbin/service undef start' returned 1: at /etc/puppet/
environments/testing/modules/httpd/manifests/service.pp:26

On Aug 24, 5:12 pm, Henrik Lindberg <henrik.lindb...@cloudsmith.com>
wrote:

Helen Paterson

unread,
Feb 24, 2014, 9:53:14 AM2/24/14
to puppet...@googlegroups.com
Thank you, this was a great help

Paul Otto

unread,
Sep 12, 2016, 3:49:50 PM9/12/16
to Puppet Users
This saved me a bunch of time just now. Thanks!

Regards,
Paul Otto

lohit dutta

unread,
Jan 31, 2020, 6:58:03 AM1/31/20
to Puppet Users
Thank you so much man. Your post saved a lot of my time.
Reply all
Reply to author
Forward
0 new messages