Uploaded image for project: 'PuppetDB'
  1. PuppetDB
  2. PDB-2259

Initial migration broken with non-english postgresql

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PDB 3.2.2
    • Fix Version/s: PDB 3.2.3
    • Component/s: None
    • Labels:
      None
    • Template:
    • Story Points:
      1
    • Sprint:
      PuppetDB 2015-12-30

      Description

      Hi,

      I have a problem when I try to install PuppetDB from scratch with PostgreSQL.

      Indeed, I have installed PuppetDB 3.2 for Puppet 4 on the same server as my puppet master (standalone mode) thanks to the puppetdb module :

       
      puppet module install -i /data/puppetlabs/code/modules puppetlabs-puppetdb
      

      I want to use postgreSQL so my configuration file /etc/puppetlabs/code/environments/production/manifests/node.pp contains :

      node puppetmaster {
       
      # Configure puppetdb and its underlying database
       class { 'puppetdb':
             listen_address => 'puppetmaster'
       }
       # Configure the puppet master to use puppetdb
       class { 'puppetdb::master::config':}
      ...
      }
      
      

      But I get the following error in my puppetdb logfile /var/log/puppetlabs/puppetdb/puppetdb.log :

      2015-12-14 22:08:44,273 INFO  [o.e.j.u.log] Logging initialized @51418ms
      2015-12-14 22:08:44,422 INFO  [p.t.s.w.jetty9-core] Removing buggy security provider SunPKCS11-NSS version 1.7
      2015-12-14 22:08:53,169 INFO  [p.t.s.w.jetty9-service] Initializing web server(s).
      2015-12-14 22:08:53,396 INFO  [p.t.s.n.nrepl-service] nREPL service disabled, not starting
      2015-12-14 22:08:53,407 INFO  [p.p.pdb-routing] Starting PuppetDB, entering maintenance mode
      2015-12-14 22:08:53,468 INFO  [p.t.s.w.jetty9-service] Starting web server(s).
      2015-12-14 22:08:54,126 INFO  [p.t.s.w.jetty9-core] Starting web server.
      2015-12-14 22:08:54,139 INFO  [o.e.j.s.Server] jetty-9.2.z-SNAPSHOT
      2015-12-14 22:08:54,372 INFO  [o.e.j.s.h.ContextHandler] Started o.e.j.s.h.ContextHandler@5ac258d{/pdb,null,AVAILABLE}
      2015-12-14 22:08:54,414 INFO  [o.e.j.s.ServerConnector] Started ServerConnector@69a594a1{HTTP/1.1}{puppetmaster.localdomain:8080}
      2015-12-14 22:08:54,578 INFO  [o.e.j.s.ServerConnector] Started ServerConnector@4f5acf63{SSL-HTTP/1.1}{0.0.0.0:8081}
      2015-12-14 22:08:54,578 INFO  [o.e.j.s.Server] Started @61726ms
      2015-12-14 22:08:54,582 INFO  [p.p.metrics] Starting metrics server
      2015-12-14 22:08:54,590 INFO  [o.e.j.s.h.ContextHandler] Started o.e.j.s.h.ContextHandler@5cc2bce4{/metrics,null,AVAILABLE}
      2015-12-14 22:08:54,679 INFO  [p.p.c.services] PuppetDB version 3.2.2
      2015-12-14 22:08:54,947 INFO  [c.j.b.BoneCP] Shutting down connection pool...
      2015-12-14 22:08:54,951 INFO  [c.j.b.BoneCP] Connection pool has been shutdown.
      2015-12-14 22:08:54,956 ERROR [p.t.internal] Error during service start!!!
      *org.postgresql.util.PSQLException: ERREUR: la relation « schema_migrations » n'existe pas
        Position : 21*
      
      

      When I check directly in the psql database, I can't find any relation (my postgresql is installed in french) :

       
      postgres=# \l
                                        Liste des bases de données
          Nom    | Propriétaire | Encodage | Collationnement | Type caract. |    Droits d'accès     
      -----------+--------------+----------+-----------------+--------------+-----------------------
       postgres  | postgres     | UTF8     | fr_FR.UTF-8     | fr_FR.UTF-8  | 
       puppetdb  | postgres     | UTF8     | fr_FR.UTF-8     | fr_FR.UTF-8  | =T/postgres          +
                 |              |          |                 |              | postgres=CTc/postgres+
                 |              |          |                 |              | puppetdb=CTc/postgres
       template0 | postgres     | UTF8     | fr_FR.UTF-8     | fr_FR.UTF-8  | =c/postgres          +
                 |              |          |                 |              | postgres=CTc/postgres
       template1 | postgres     | UTF8     | fr_FR.UTF-8     | fr_FR.UTF-8  | =c/postgres          +
                 |              |          |                 |              | postgres=CTc/postgres
      (4 lignes)
       
      postgres=# \c puppetdb
      puppetdb=# \d
      Aucune relation trouvée.
      
      

      When I take a look to other log files, I have no additionnal information :

      • /var/log/puppetlabs/puppetdb/puppetdb-daemon.log :

      org.postgresql.util.PSQLException: ERREUR: la relation « schema_migrations » n'existe pas
        Position : 21
      

      • /var/log/postgresql/postgresql-9.4-main.log :

      2015-12-14 22:08:54 CET [5449-1] puppetdb@puppetdb ERREUR:  la relation « schema_migrations » n'existe pas au caractère 21
      2015-12-14 22:08:54 CET [5449-2] puppetdb@puppetdb INSTRUCTION :  SELECT version FROM schema_migrations ORDER BY version
      

      • the /opt/puppetlabs/server/data/puppetdb folder is empty (value of vardir in /etc/puppetlabs/puppetdb/conf.d)

      I don't understand why my database is empty because I thought puppetdb was responsible of this task.

      When I use the embedded HSQLDB I have no problem.

      My version of postrgresql is :

      # psql -V
      psql (PostgreSQL) 9.4.5
      

      I can connect to it with the puppetdb user :

      # sudo -u puppetdb psql -h localhost -W
      Mot de passe : 
      psql (9.4.5)
      

      My version of puppet is :

      # puppet -V
      4.3.1
      

      My version of puppetdb is :

      # /opt/puppetlabs/bin/puppetdb --version
      puppetdb version: 3.2.2
      

      Do you have any idea about this issue ?

      Thanks a lot for your help,

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                Unassigned
                Reporter:
                Mok Mok
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: