Foreman 1.2.0 + puppetmaster 3.2.1 + postgresql 9.1 -> relation "reports" already exists

Hi,

I'm following this guide :
http://jurjenbokma.com/ApprenticesNotes/wp_configure_foreman.html

The puppetmaster is configured with storeconfigs and foreman has been given
the same database. So puppet has already created a number of tables. It
seems that db:migrate failes on that. What's disturbing is that the layout
of the table that foreman tries to created differs from the layout puppet
has created :

Foreman:
CREATE TABLE "reports" ("id" serial primary key, "host_id" integer NOT
NULL, "log" text, "reported_at" timestamp, "created_at" timestamp NOT NULL,
"updated_at" timestamp NOT NULL)

Puppetmaster:
Table "public.reports"
Column | Type | Modifiers

··· -----------------------+--------------------------+----------- hash | character varying(40) | not null certname | text | puppet_version | character varying(40) | not null report_format | smallint | not null configuration_version | character varying(255) | not null start_time | timestamp with time zone | not null end_time | timestamp with time zone | not null receive_time | timestamp with time zone | not null

Also, after this, puppetdb will no longer start with following error :

2013-05-29 13:37:28,054 INFO [main] [cli.services] PuppetDB version 1.3.1
2013-05-29 13:37:28,241 ERROR [main] [puppetlabs.utils] Uncaught exception
java.lang.IllegalStateException: Your PuppetDB database contains a schema
migration numbered 20090714132448, but this version of PuppetDB does not
recognize that version.
at
com.puppetlabs.puppetdb.scf.migrate$migrate_BANG_.invoke(migrate.clj:362)
at
com.puppetlabs.puppetdb.cli.services$main$fn__10275.invoke(services.clj:396)
at
clojure.java.jdbc.internal$with_connection_STAR
.invoke(internal.clj:186)
at
com.puppetlabs.puppetdb.cli.services$_main.doInvoke(services.clj:394)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:419)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.core$apply.invoke(core.clj:601)
at com.puppetlabs.puppetdb.core$_main.doInvoke(core.clj:79)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at com.puppetlabs.puppetdb.core.main(Unknown Source)
2013-05-29 13:37:28,265 INFO [Thread-4] [cli.services] Shutdown request
received; puppetdb exiting.

Anyone have an idea on how to fix this ?

Thanks in advance,

Peter.

IK GA ERVOOR
Een zorgjob. Da’s werken met je hoofd, handen en hart.



DISCLAIMER :
De personeelsleden van het agentschap doen hun best om in e-mails
betrouwbare informatie te geven. Toch kan niemand rechten doen gelden op
basis van deze inhoud. Als in de e-mail een stellingname voorkomt, is
dat niet noodzakelijk het standpunt van het agentschap. Rechtsgeldige
beslissingen of officiele standpunten worden alleen per brief toegestuurd.

puppetdb is running again after running this command against the database :

delete from schema_migrations where version > 1000;

db:migrate still not working …

Peter.

I'll take a blind guess on this:

http://theforeman.org/manuals/1.2/index.html#Upgradenotes

"ActiveRecord-based storeconfigs / database sharing now unsupported"

Ok thanks for the quick response, I failed to see that. Reverting back to
two databases then …

Kindest regards,

Peter.

··· --

IK GA ERVOOR
Een zorgjob. Da’s werken met je hoofd, handen en hart.



DISCLAIMER :
De personeelsleden van het agentschap doen hun best om in e-mails
betrouwbare informatie te geven. Toch kan niemand rechten doen gelden op
basis van deze inhoud. Als in de e-mail een stellingname voorkomt, is
dat niet noodzakelijk het standpunt van het agentschap. Rechtsgeldige
beslissingen of officiele standpunten worden alleen per brief toegestuurd.

Correct, but even more so, sharing with PuppetDB was never supported at
all. They're two entirely separate projects with separate databases.

ActiveRecord-based storeconfigs was a different database connection
method in Puppet, prior to the introduction of PuppetDB.

··· On 29/05/13 14:47, St�le Dagfinrud wrote: > I'll take a blind guess on this: > > http://theforeman.org/manuals/1.2/index.html#Upgradenotes > > "ActiveRecord-based storeconfigs / database sharing now unsupported"


Dominic Cleal
Red Hat Engineering