Issue #9832 has been reported by Ashley Penney.

----------------------------------------
Bug #9832: Storeconfig problems with Postgresql on 2.7.4
https://projects.puppetlabs.com/issues/9832

Author: Ashley Penney
Status: Unreviewed
Priority: Normal
Assignee: Daniel Pittman
Category: 
Target version: 
Affected Puppet version: 
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:

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))
LOG:  statement:             SELECT a.attname, format_type(a.atttypid, 
a.atttypmod), d.adsrc, a.attnotnull
                      FROM pg_attribute a LEFT JOIN pg_attrdef d
                        ON a.attrelid = d.adrelid AND a.attnum = d.adnum
                     WHERE a.attrelid = '"template_kinds"'::regclass
                       AND a.attnum > 0 AND NOT a.attisdropped
                     ORDER BY a.attnum
        
and the following queries:

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

exported | count 
----------+-------
 f        |  3520
 t        |    31
(2 rows)

select distinct restype from resources

        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)

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