Page MenuHomeSoftware Heritage

Running puppet agent on the puppet master results in error
Closed, MigratedEdits Locked

Description

Running puppet agent on the puppet master results in error.

ardumont@pergamon:~% sudo puppet agent --test
[sudo] password for ardumont:
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: A duplicate resource was found while collecting exported resources, with the type and title Icinga2::Object::Host[worker03.euwest.azure.internal.softwareheritage.org] on node pergamon.softwareheritage.org
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

I have been unable so far to understand clearly the issue.

In my peregrination, i noticed multiple warnings/critical message logs for icinga.
It's relative to the db version being out of sync with its package version.

It might relate to having duplicates in data... (I'm really not sure but i think it's worth mentioning it here anyway).

Nov 23 17:24:45 pergamon icinga2[20113]: [2017-11-23 17:24:35 +0000] critical/IdoPgsqlConnection: Schema version '1.14.2' does not match the required version '1.14.3' (or newer)! Please check the upgrade documentation at https://docs.icinga.com/icinga2/latest/doc/module/icinga2/chapter/upgrading-icinga-2#upgrading-postgresql-db
Nov 23 17:24:45 pergamon icinga2[20113]: Context:
Nov 23 17:24:45 pergamon icinga2[20113]:         (0) Reconnecting to PostgreSQL IDO database 'ido-pgsql'

I'll adapt this when i see more clearly what happens (and possibly open another issue if that's not related).

Event Timeline

Oh yeah, also for icinga, we are possibly quite late there:

ardumont@pergamon:~% ls /usr/share/icinga2-ido-pgsql/schema/upgrade/
2.0.2.sql  2.1.0.sql  2.2.0.sql  2.3.0.sql  2.4.0.sql  2.5.0.sql  2.6.0.sql  2.8.0.sql
olasd claimed this task.
olasd added a subscriber: olasd.

There was a duplicate node definition in puppetdb for a worker03.euwest.azure.euwest.azure.internal.softwareheritage.org node. The fqdn must have been set wrong at some point during the deployment.

I removed the stale data using

puppet node deactivate worker03.euwest.azure.euwest.azure.internal.softwareheritage.org

Puppet now runs correctly.

The fqdn must have been set wrong at some point during the deployment.

Yes, it was.
I cleaned up messed up configuration on the agent (/etc/puppet/puppet.conf) and on the master (certificate related).
I did not know there was another stale data.

There was a duplicate node definition in puppetdb for a worker03.euwest.azure.euwest.azure.internal.softwareheritage.org node.
I removed the stale data using

puppet node deactivate worker03.euwest.azure.euwest.azure.internal.softwareheritage.org

Thanks for the heads up!

Puppet now runs correctly.

Awesome.

As for the icinga2 issue, this was fixed with:

root@pergamon:~# cat /etc/icinga2/features-available/ido-pgsql.conf
[... get password]
root@pergamon:~# psql -h localhost -U icinga2 -W icinga2 < /usr/share/icinga2-ido-pgsql/schema/upgrade/2.8.0.sql