Issue #9702 has been updated by Justin Stoller.

Daniel Pittman wrote:
> So, to confirm:
> 
> You are verifying that using the `pg` gem rather than `postgres` does not fix 
> the issue for you, correct?
> 


yes, in more detail:

<pre>

root@ubuntu-alpha:/var/log/pe-puppet# /opt/puppet/bin/gem list

*** LOCAL GEMS ***

activerecord (2.3.14)
activesupport (2.3.14)
ar-extensions (0.9.5)
builder (3.0.0)
dalli (1.1.2)
excon (0.6.5)
fog (1.0.0e)
formatador (0.2.0)
guid (0.1.1)
mime-types (1.16)
multi_json (1.0.3)
net-scp (1.0.4)
net-ssh (2.1.4)
nokogiri (1.5.0)
pg (0.12.2)
puppet-module (0.3.4)
rack (1.1.3)
rbvmomi (1.3.0)
ruby-augeas (0.4.1)
ruby-hmac (0.4.0)
sinatra (1.2.6)
stomp (1.1.9)
tilt (1.3.3)
trollop (1.16.2)

root@ubuntu-alpha:/var/log/pe-puppet# /opt/puppet/bin/ruby -v
ruby 1.8.7 (2011-12-28 patchlevel 357) [i486-linux]

</pre>



> Can you show us what the structure of the problem table is?
> 

<pre>

console_inventory_service=# \d inventory_facts
        Table "public.inventory_facts"
 Column  |          Type          | Modifiers 
---------+------------------------+-----------
 node_id | integer                | not null
 name    | character varying(255) | not null
 value   | text                   | not null
Indexes:
    "index_inventory_facts_on_node_id_and_name" UNIQUE, btree (node_id, name)

</pre>



> Can you confirm that you have `migrate` turned on for StoreConfigs?
>

I haven't seen anything mentioning `migrate` in any of the docs:

http://docs.puppetlabs.com/guides/exported_resources.html

http://projects.puppetlabs.com/projects/1/wiki/Using_Stored_Configuration

http://docs.puppetlabs.com/guides/configuring.html


I just found the `dbmigrate` option mentioned here:

http://docs.puppetlabs.com/references/stable/configuration.html 


I don't understand the point of this feature from the documentation (and it's 
not referenced in any other storeconfig docs that I've seen)

To be clear, all of the tables were automatically created by Puppet after I 
pointed it to the postgresql db. I've seen no different behavior by adding 
`dbmigrate = true`. Would this not work unless I had the `dbmigrate` option 
turned on, *before* I go to Postgresql?

(and I'd be happy to submit pull requests against the docs after I can actually 
get it to work)


> Can you capture the SQL from ActiveRecord while it creates the database?

I have not been able to do that yet, should have it tomorrow.


Can I ask, what is the setup that you've been able to get postgresql to work? 
OS, arch, versions, setup, etc?
I'd be happy to compare the two.


----------------------------------------
Bug #9702: Issue with inventory PGError: ERROR:  column "id" does not exist
https://projects.puppetlabs.com/issues/9702

Author: Marco La Rosa
Status: Investigating
Priority: Normal
Assignee: Patrick Carlisle
Category: 
Target version: 2.7.x
Affected Puppet version: 2.7.1
Keywords: 
Branch: 


Hi,

I'm having an issue geting inventory going on my puppetmaster.

The master works happily with storeconfigs (Squeeze, 2.7.1-1~bpo60+1) until I 
enable "facts_terminus = inventory_active_record". Then I start seeing errors 
on the client (same OS and version of puppet) like:
<pre>
err: Could not retrieve catalog from remote server: Error 400 on SERVER: 
PGError: ERROR:  column "id" does not exist
LINE 1: ...', '2011-09-27 16:29:27.948893', 2, E'Bochs') RETURNING "id"
                                                                   ^
: INSERT INTO "inventory_facts" ("name", "created_at", "node_id", "value") 
VALUES(E'productname', '2011-09-27 16:29:27.948893', 2, E'Bochs') RETURNING "id"
</pre>

The db (Squeeze, postgres 9.0 - from backports) table looks like:
<pre>
puppet=# \d+ inventory_facts;
                        Table "public.inventory_facts"
   Column   |            Type             | Modifiers | Storage  | Description 
------------+-----------------------------+-----------+----------+-------------
 node_id    | integer                     | not null  | plain    | 
 name       | character varying(255)      | not null  | extended | 
 value      | text                        | not null  | extended | 
 created_at | timestamp without time zone |           | plain    | 
Indexes:
    "index_inventory_facts_on_node_id_and_name" UNIQUE, btree (node_id, name)
Has OIDs: no
</pre>

And the schema which I think defines all this (certainly the only one on the 
server that fits) /usr/lib/ruby/1.8/puppet/rails/database/schema.rb has:
<pre>
        create_table :inventory_facts, :id => false do |t|
          t.column :node_id, :integer, :null => false
          t.column :name, :string, :null => false
          t.column :value, :text, :null => false
        end

        add_index :inventory_facts, [:node_id, :name], :unique => true
</pre>

So assuming the schema file is correct (matches the schema file at 
https://github.com/lak/puppet/blob/master/lib/puppet/rails/database/schema.rb), 
is this a bug in the client  code? Should it be "RETURNING "node_id"

Thanks,
Marco


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