Issue #4487 has been updated by Richard Crowley.

Status changed from Closed to Re-opened

I can easily reproduce this bug on the 2.6.x branch.  Here's all it takes:

1. Fire up the master.
2. Run the agent.
3. `touch puppet.conf`
4. Run the agent again.

On the second agent run, the environment is read from the storeconfigs 
database, converted to a Puppet::Node::Environment object, and later written to 
the database, at which point ActiveRecord converts it to YAML.

On the third agent run, the same thing happens, escaping the YAML from the 
second run, and so on.

The part I can't explain is why reparsing puppet.conf triggers the issue.  I'd 
love anyone with more knowledge of exactly what gets invalidated on reparse to 
explain that.

This branch/commit in my GitHub fork fixes and tests the problem: 
<https://github.com/rcrowley/puppet/tree/ticket/2.6.x/4487> 
<https://github.com/rcrowley/puppet/commit/caae93c6b84595cffce7d347184b5a66fe61a001>
----------------------------------------
Bug #4487: Environment column in hosts table updating incorrectly
https://projects.puppetlabs.com/issues/4487

Author: Jason Koppe
Status: Re-opened
Priority: High
Assignee: Matt Robinson
Category: 
Target version: 2.6.5
Affected Puppet version: 2.6.0
Keywords: storeconfigs, mysql, environment, hosts table
Branch: https://github.com/ody/puppet/tree/tickets/2.6.x/4487


Posted on puppet-users at 
[thread/7237b49342ff9890](http://groups.google.com/group/puppet-users/browse_thread/thread/7237b49342ff9890)

Below I null out the environment column, show that it's null for a 
particular host, then run puppetd a few times on the host. 

<pre>
mysql for root@localhost on indadm1> select * from hosts where name like 
'iad-web2%';
+----+---------------------+---------------+-------------+---------------------+-----------------+-------------+---------------------+----------------+---------------------+
| id | name                | ip            | environment | last_compile        
| last_freshcheck | last_report | updated_at          |source_file_id | 
created_at          |
+----+---------------------+---------------+-------------+---------------------+-----------------+-------------+---------------------+----------------+---------------------+
|  9 | iad-web2.indeed.net | 10.24.186.136 | NULL        | 2010-08-06 03:31:23 
| NULL            | NULL        | 2010-08-06 03:31:23 | NULL | 2010-06-08 
19:47:22 |
+----+---------------------+---------------+-------------+---------------------+-----------------+-------------+---------------------+----------------+---------------------+
1 row in set (0.00 sec)

mysql for root@localhost on indadm1> select * from hosts where name 
like'iad-web2%';
+----+---------------------+---------------+----------------+---------------------+-----------------+-------------+---------------------+----------------+---------------------+
| id | name                | ip            | environment    | last_compile      
  | last_freshcheck | last_report | updated_at          | source_file_id | 
created_at          |
+----+---------------------+---------------+----------------+---------------------+-----------------+-------------+---------------------+----------------+---------------------+
|  9 | iad-web2.indeed.net | 10.24.186.136 | --- production | 2010-08-06 
03:31:23 | NULL            | NULL        | 2010-08-06 03:32:42 | NULL | 
2010-06-08 19:47:22 |
+----+---------------------+---------------+----------------+---------------------+-----------------+-------------+---------------------+----------------+---------------------+
1 row in set (0.00 sec)

mysql for root@localhost on indadm1> select * from hosts where name like 
'iad-web2%';
+----+---------------------+---------------+----------------------+---------------------+-----------------+-------------+---------------------+----------------+---------------------+
| id | name                | ip            | environment          | 
last_compile        | last_freshcheck | last_report | updated_at          | 
source_file_id | created_at          |
+----+---------------------+---------------+----------------------+---------------------+-----------------+-------------+---------------------+----------------+---------------------+
|  9 | iad-web2.indeed.net | 10.24.186.136 | --- "--- production" | 2010-08-06 
03:32:50 | NULL            | NULL        | 2010-08-06 03:32:50 |           NULL 
| 2010-06-08 19:47:22 |
+----+---------------------+---------------+----------------------+---------------------+-----------------+-------------+---------------------+----------------+---------------------+
1 row in set (0.00 sec)

 </pre>


-- 
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to