Jira (PUP-4707) environment_timeout in puppet.conf not honored if environmentpath does not exist at startup

5 views
Skip to first unread message

Kevin Corcoran (JIRA)

unread,
Jun 5, 2015, 10:23:04 PM6/5/15
to puppe...@googlegroups.com
Kevin Corcoran created an issue
 
Puppet / Bug PUP-4707
environment_timeout in puppet.conf not honored if environmentpath does not exist at startup
Issue Type: Bug Bug
Affects Versions: PUP 4.1.0, PUP 4.0.0
Assignee: Unassigned
Created: 2015/06/05 7:22 PM
Priority: Normal Normal
Reporter: Kevin Corcoran

If environmentpath does not exist when the Puppet Master is started, environment_timeout in puppet.conf has no effect. e.g. Running with environment_timeout = 1y in puppet.conf still exhibits the default behavior of not caching environments (environment_timeout = 0).

Here are steps to reproduce; I've used Puppet Server for this, but I'm reasonably certain the problem is in Puppet itself, not Puppet Server, and I'd expect the same behavior in any other type of Puppet master.

#1 - Delete environmentpath

rm -rf /etc/puppetlabs/code/environments

#1.5 Give the puppet user ownership of codedir. (side note - shouldn't packaging be doing this? All of these directories are owned by root post-install. Seems weird.)

chown -R puppet:puppet /etc/puppetlabs/code

#2 - Set environment_timeout in puppet.conf

echo "environment_timeout = 1y" >> /etc/puppetlabs/puppet/puppet.conf

#3 - Start Puppet Server

#4 - Run the agent. This should cache the environment, since we have the cache TTL set to 1 year in puppet.conf.

#5 - Re-create environmentpath and a manifests subdirectory for the production environment, and write a site.pp.

mkdir -p /etc/puppetlabs/code/environments/production/manifests
echo "node default { notify {'hello world': } }" >> /etc/puppetlabs/code/environments/production/manifests/site.pp

#6 - Run the agent again. Observe that the "hello world" resource shows-up - this is incorrect, since the environment should not have been refreshed.

Notice: hello world

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.3.15#6346-sha1:dbc023d)
Atlassian logo

Kevin Corcoran (JIRA)

unread,
Jun 5, 2015, 10:24:03 PM6/5/15
to puppe...@googlegroups.com

Kevin Corcoran (JIRA)

unread,
Jun 5, 2015, 10:28:05 PM6/5/15
to puppe...@googlegroups.com

As Ruth Linehan was just pointing out, deleting the $environmentpath/production directory might also cause this as well.

Kylo Ginsberg (JIRA)

unread,
Jun 6, 2015, 6:33:16 PM6/6/15
to puppe...@googlegroups.com

Christopher Price (JIRA)

unread,
Jun 8, 2015, 10:09:50 AM6/8/15
to puppe...@googlegroups.com
Christopher Price commented on Bug PUP-4707
 
Re: environment_timeout in puppet.conf not honored if environmentpath does not exist at startup

FYI if anyone is thinking about fixing this, PE-10214 might be of interest. I'm wondering if we can get rid of this TTL stuff altogether.

Henrik Lindberg (JIRA)

unread,
Jun 8, 2015, 11:58:51 AM6/8/15
to puppe...@googlegroups.com

Christopher Price The TTL was introduced as a way to not having to do excessive file stats (a performance bottleneck the way it was implemented), and the fact that any file change at any time could invalidate the compilation and make it start over. The most bizarre effect being that you can end up with a mix of old and new. I much more prefer an atomic change which requires that updates to the "running code" is managed and letting compilations finish before changing the source.

Charlie Sharpsteen (JIRA)

unread,
Jun 17, 2015, 5:51:04 PM6/17/15
to puppe...@googlegroups.com
Charlie Sharpsteen updated an issue
 
Change By: Charlie Sharpsteen
CS Severity: 2
CS Impact: Having no {{environmentpath}} seems like a situation that is unlikely to arise in production. The remediation for this is also pretty simple: restart the puppet master after fixing the missing directory.
CS Priority: Minor
CS Frequency: 1

Henrik Lindberg (JIRA)

unread,
Sep 7, 2016, 6:12:26 PM9/7/16
to puppe...@googlegroups.com
Henrik Lindberg updated an issue
Change By: Henrik Lindberg
Team: Puppet Developer Support
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Moses Mendoza (JIRA)

unread,
May 17, 2017, 2:24:04 PM5/17/17
to puppe...@googlegroups.com

John Duarte (JIRA)

unread,
May 17, 2017, 2:24:04 PM5/17/17
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Mar 16, 2018, 4:28:04 PM3/16/18
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Sub-team: Coremunity
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Josh Cooper (Jira)

unread,
Sep 29, 2020, 3:45:04 PM9/29/20
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-4707
 
Re: environment_timeout in puppet.conf not honored if environmentpath does not exist at startup

The environment_timeout setting will be removed in puppet 7 replaced with environment_ttl, which will be global/not per-environment, so it won't have the ordering issues described here.

This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Benjamin Rechsteiner (Jira)

unread,
Jan 30, 2023, 8:10:03 AM1/30/23
to puppe...@googlegroups.com

Josh Cooper as i can see in puppet 7 environment_timeout and environment_ttl still not honored whether environmentpath is set or not.

This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages