Issue #9832 has been updated by Michael Stahnke.

Status changed from In Topic Branch Pending Merge to Closed
Target version changed from 2.7.x to 2.7.5

Merged and shipped in 2.7.5. 
----------------------------------------
Bug #9832: Storeconfig problems with Postgresql on 2.7.4
https://projects.puppetlabs.com/issues/9832

Author: Ashley Penney
Status: Closed
Priority: Normal
Assignee: Daniel Pittman
Category: stored configuration
Target version: 2.7.5
Affected Puppet version: 2.7.4
Keywords: 
Branch: 


Earlier today I discovered that all of my nodes were being drained of their 
/etc/hosts entries and investigative work with dpittman@ helped me track it 
down to a storeconfig issue.

Based on this chunk of the postgresql log:

<pre>
LOG:  statement: SELECT "resources".* FROM "resources" INNER JOIN 
"resource_tags" ON "resource_tags"."resource_id" = "resources"."id" INNER JOIN 
"puppet_tags" ON "puppet_tags"."id" = "resource_tags"."puppet_tag_id" WHERE 
((exported='t' AND restype='host') AND puppet_tags.name = 'ec2private' AND 
(host_id != 40))
LOG:  statement: SELECT  "hosts".* FROM "hosts" WHERE "hosts"."name" = 
'qa-automation1.unity.perimeterusa.com' LIMIT 1
LOG:  statement: SELECT "resources".* FROM "resources" INNER JOIN 
"resource_tags" ON "resource_tags"."resource_id" = "resources"."id" INNER JOIN 
"puppet_tags" ON "puppet_tags"."id" = "resource_tags"."puppet_tag_id" WHERE 
((exported='t' AND restype='host') AND puppet_tags.name = 'regular' AND 
(host_id != 40))
LOG:  statement: SELECT  "hosts".* FROM "hosts" WHERE "hosts"."name" = 
'qa-automation1.unity.perimeterusa.com' LIMIT 1
LOG:  statement: SELECT "resources".* FROM "resources" INNER JOIN 
"resource_tags" ON "resource_tags"."resource_id" = "resources"."id" INNER JOIN 
"puppet_tags" ON "puppet_tags"."id" = "resource_tags"."puppet_tag_id" WHERE 
((exported='t' AND restype='mysql_database') AND puppet_tags.name = 
'mysql_qa-automation1.unity.perimeterusa.com' AND (host_id != 40))
LOG:  statement: SELECT  "hosts".* FROM "hosts" WHERE "hosts"."name" = 
'qa-automation1.unity.perimeterusa.com' LIMIT 1
LOG:  statement: SELECT "resources".* FROM "resources" INNER JOIN 
"resource_tags" ON "resource_tags"."resource_id" = "resources"."id" INNER JOIN 
"puppet_tags" ON "puppet_tags"."id" = "resource_tags"."puppet_tag_id" WHERE 
((exported='t' AND restype='mysql_user') AND puppet_tags.name = 
'mysql_qa-automation1.unity.perimeterusa.com' AND (host_id != 40))
LOG:  statement: SELECT  "hosts".* FROM "hosts" WHERE "hosts"."name" = 
'qa-automation1.unity.perimeterusa.com' LIMIT 1
LOG:  statement: SELECT "resources".* FROM "resources" INNER JOIN 
"resource_tags" ON "resource_tags"."resource_id" = "resources"."id" INNER JOIN 
"puppet_tags" ON "puppet_tags"."id" = "resource_tags"."puppet_tag_id" WHERE 
((exported='t' AND restype='mysql_grant') AND puppet_tags.name = 
'mysql_qa-automation1.unity.perimeterusa.com' AND (host_id != 40))
LOG:  statement: SELECT  "hosts".* FROM "hosts" WHERE "hosts"."name" = 
'qa-automation1.unity.perimeterusa.com' LIMIT 1
LOG:  statement: SELECT "resources".* FROM "resources" INNER JOIN 
"resource_tags" ON "resource_tags"."resource_id" = "resources"."id" INNER JOIN 
"puppet_tags" ON "puppet_tags"."id" = "resource_tags"."puppet_tag_id" WHERE 
((exported='t' AND restype='host') AND puppet_tags.name = 'ec2private' AND 
(host_id != 40))
LOG:  statement: SELECT  "hosts".* FROM "hosts" WHERE "hosts"."name" = 
'qa-automation1.unity.perimeterusa.com' LIMIT 1
LOG:  statement: SELECT "resources".* FROM "resources" INNER JOIN 
"resource_tags" ON "resource_tags"."resource_id" = "resources"."id" INNER JOIN 
"puppet_tags" ON "puppet_tags"."id" = "resource_tags"."puppet_tag_id" WHERE 
((exported='t' AND restype='host') AND puppet_tags.name = 'regular' AND 
(host_id != 40))
LOG:  statement: SELECT  "hosts".* FROM "hosts" WHERE "hosts"."name" = 
'qa-automation1.unity.perimeterusa.com' LIMIT 1
LOG:  statement: SELECT "resources".* FROM "resources" INNER JOIN 
"resource_tags" ON "resource_tags"."resource_id" = "resources"."id" INNER JOIN 
"puppet_tags" ON "puppet_tags"."id" = "resource_tags"."puppet_tag_id" WHERE 
((exported='t' AND restype='mysql_database') AND puppet_tags.name = 
'mysql_qa-automation1.unity.perimeterusa.com' AND (host_id != 40))
LOG:  statement: SELECT  "hosts".* FROM "hosts" WHERE "hosts"."name" = 
'qa-automation1.unity.perimeterusa.com' LIMIT 1
LOG:  statement: SELECT "resources".* FROM "resources" INNER JOIN 
"resource_tags" ON "resource_tags"."resource_id" = "resources"."id" INNER JOIN 
"puppet_tags" ON "puppet_tags"."id" = "resource_tags"."puppet_tag_id" WHERE 
((exported='t' AND restype='mysql_user') AND puppet_tags.name = 
'mysql_qa-automation1.unity.perimeterusa.com' AND (host_id != 40))
LOG:  statement: SELECT  "hosts".* FROM "hosts" WHERE "hosts"."name" = 
'qa-automation1.unity.perimeterusa.com' LIMIT 1
LOG:  statement: SELECT "resources".* FROM "resources" INNER JOIN 
"resource_tags" ON "resource_tags"."resource_id" = "resources"."id" INNER JOIN 
"puppet_tags" ON "puppet_tags"."id" = "resource_tags"."puppet_tag_id" WHERE 
((exported='t' AND restype='mysql_grant') AND puppet_tags.name = 
'mysql_qa-automation1.unity.perimeterusa.com' AND (host_id != 40))
</pre>
        
and the following queries:

select exported,  count(exported) from resources group by exported

<pre>
exported | count 
----------+-------
 f        |  3520
 t        |    31
(2 rows)
</pre>

select distinct restype from resources

<pre>
        restype         
------------------------
 User
 Resources
 Postgres::Config
 Postgres::Createuser
 Users::Adduser
 Host
 Postgres::Initdb
 Sqlexec
 Exec
 Stage
 Group
 Concat::Fragment
 Augeas
 Mysql_user
 Service
 Class
 Yumrepo
 File
 Security::Sudoers::Add
 Package
 Firewall
 Postgres::Enable
 Postgres::Createdb
 Mysql_grant
 Apache2::Site
 Cron
 Ssh_authorized_key
 Concat
 Mysql_database
(29 rows)
</pre>

He was able to narrow it down to an issue with:

12:51 <dpittman> Awesome.  Found why it isn't matching: restype='host' vs 
restype='Host'

The temporary workaround is:

You could patch your code in `lib/puppet/indirector/resource/active_record.rb` 
line 65 to be `arguments = [true, type.to_s.capitalize]`



-- 
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