Configuration error deteced at LabKey Server Startup

LabKey Support Forum (Inactive)
Configuration error deteced at LabKey Server Startup vahid azimi  2015-05-13 14:38
Status: Closed
 
Hello,
 
I am trying to install a local LabKey server on a machine running CentOS 6. I went through the installation steps, but am receiving this error when I go to open labkey in my browser. Also, I am only able to start up postgres when I am logged in as root; does this have something to do with the error? I am relatively new to Linux so please bear with me.
 
org.labkey.api.util.ConfigurationException: DataSources are not properly configured in labkey.xml.
       at org.labkey.api.module.ModuleLoader.initializeDataSources(ModuleLoader.java:861)
       at org.labkey.api.module.ModuleLoader.doInit(ModuleLoader.java:344)
       at org.labkey.api.module.ModuleLoader.init(ModuleLoader.java:258)
       at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
       at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
       at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
       at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4854)
       at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5546)
       at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
       at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
       at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
       at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
       at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:672)
       at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1882)
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
       at java.util.concurrent.FutureTask.run(FutureTask.java:262)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
       at java.lang.Thread.run(Thread.java:745)
Caused by: org.labkey.api.util.ConfigurationException: Can't connect to data source "labkeyDataSource".
       at org.labkey.api.data.DbScope.ensureDataBase(DbScope.java:1073)
       at org.labkey.api.module.ModuleLoader.ensureDatabase(ModuleLoader.java:931)
       at org.labkey.api.module.ModuleLoader.initializeDataSources(ModuleLoader.java:838)
       ... 18 more
Caused by: org.postgresql.util.PSQLException: FATAL: Ident authentication failed for user "postgres"
       at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:420)
       at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:195)
       at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
       at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:127)
       at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:29)
       at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:21)
       at org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:41)
       at org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:24)
       at org.postgresql.Driver.makeConnection(Driver.java:414)
       at org.postgresql.Driver.connect(Driver.java:282)
       at java.sql.DriverManager.getConnection(DriverManager.java:571)
       at java.sql.DriverManager.getConnection(DriverManager.java:215)
       at org.labkey.api.data.DbScope.ensureDataBase(DbScope.java:1036)
       ... 20 more
 
Thanks,
Vahid
 
 
Jon (LabKey DevOps) responded:  2015-05-13 15:18
Hello Vahid,

When you said you went through the installation steps, was it this that you followed?

https://www.labkey.org/wiki/home/Documentation/page.view?name=manualInstall

When you configured your LabKey.xml file, did you make sure that you used the correct credentials and have it point to the correct server URL for your postgres DB?

Regards,

Jon
 
vahid azimi responded:  2015-05-13 15:55
Jon,

I am following installation steps that a co-worker of mine put together, but I believe it is based off of the link you posted.

After I installed postgresql, I ran the following command within psql: type 'alter user postgres password 'Pass01@';

I replaced appdocbase with the location of labkeywebapp, set username to "postgres", and password to "Pass01@".

I am attaching the contents of my labkey.xml file as well just in case I didn't cover everything you asked.

Thanks,
Vahid
 
Jon (LabKey DevOps) responded:  2015-05-13 16:17
Hi Vahid,

Thanks for providing that XML file to us.

The section for the database looks mostly fine. However, I did notice that you didn't have a port listed in your URL.

Typically when you install PostgreSQL, it runs off of port 5432 by default. So unless you changed it or have some kind of port forwarding in place, can you try it as "jdbc:postgresql://localhost:5432/labkey" instead?

Regards,

Jon
 
vahid azimi responded:  2015-05-13 16:27
Jon,

Thanks for the reply. I made the change to the Labkey.xml file as you suggested. I am now getting the following error:

HTTP Status 404 - /labkey

type Status report
message /labkey
Description The requested resource is not available

Any ideas?

Thanks,
Vahid
 
Jon (LabKey DevOps) responded:  2015-05-13 17:12
Hi Vahid,

I took a second look at your error and saw "FATAL: Ident authentication failed for user "postgres"" listed as the reason why it didn't connect the first time.

Can you change your labkey.xml file back to the way it was before without the port number and then do the following for me using psql:

Run the command:

psql -h localhost -U postgres -d labkey

When it prompts for the password, try the password you said you changed it to: Pass01@

If it doesn't work, then I believe your password didn't actually get changed here.

Regards,

Jon
 
vahid azimi responded:  2015-05-14 09:21
Hi Jon,

I changed the labkey.xml back to the way it was, and ran the command you suggested using psql. Oddly, I did not get prompted for the password.

Thanks,
Vahid
 
Jon (LabKey DevOps) responded:  2015-05-14 09:43
Hi Vahid,

That's interesting. It should have asked for a password unless your machine has the password saved in the pgpass file.

http://www.postgresql.org/docs/9.3/static/libpq-pgpass.html

Can you locate your pgpass file and confirm whether you have your password stored there and if so, confirm that it matches what you had originally set it to and then retry the psql command?

Regards,

Jon
 
Jon (LabKey DevOps) responded:  2015-05-14 10:36
Hi Vahid,

Additionally, can you also provide us with two more things?

1. Can you send us the contents of your pg_hba.conf file? That should be located in the PGDATA directory of your PostgreSQL installation.

2. Can you run the following command and send us the output?

netstat -an | grep 5432

Regards,

Jon
 
vahid azimi responded:  2015-05-14 11:42
Jon,

I wasn't able to locate a pgpass file anywhere on my system. Is it possible that there isn't one? Again, thanks for bearing with my limited knowledge of Linux.

1. I attached the contents of the pg_hba.conf file to this post.

2. The output of the command netstat -an | grep 5432:

tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN
tcp 0 0 ::1:5432 :::* LISTEN
unix 2 [ ACC ] STREAM LISTENING 119567 /tmp/.s.PGSQL.5432


Thanks for your patience.

-Vahid
 
Jon (LabKey DevOps) responded:  2015-05-14 13:25
Hi Vahid,

Thanks for providing that to us.

Our Operations Specialist looked over your configuration and provided us with the changes you need to make to your pg_hba.conf file:


# "local" is for Unix domain socket connections only
local all all ident
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication postgres peer
#host replication postgres 127.0.0.1/32 ident
#host replication postgres ::1/128 ident

Can you make the following changes above to your file and then restart PostgreSQL so it takes the changes?

Regards,

Jon
 
vahid azimi responded:  2015-05-14 13:49
Hi Jon,

Thanks for the suggestion. I made the following changes, and am now back to the error I was getting at the beginning (in my first post).

-Vahid
 
Jon (LabKey DevOps) responded:  2015-05-14 13:52
Hi Vahid,

Does the error also say this as well within it?

"Caused by: org.postgresql.util.PSQLException: FATAL: Ident authentication failed for user "postgres""

Regards,

Jon
 
vahid azimi responded:  2015-05-14 13:54
Jon,

Yes, it does.

-Vahid
 
Jon (LabKey DevOps) responded:  2015-05-14 14:15
Hi Vahid,

Did you restart the PostgreSQL server as well, shutting down PostgreSQL and then starting it back up?

I'd like to confirm this by having you run the following command:

ps -ef | grep postg

This will let us see the process for PostgreSQL on the machine and see how long it has been up.

Please send us the output when you're done.

Regards,

Jon
 
vahid azimi responded:  2015-05-14 14:47
Hi Jony,

Please see the output of "ps -ef | grep postg" below after I stopped and started postgres:

postgres 11611 1 0 00:05 ? 00:00:00 /usr/pgsql-9.4/bin/postmaster -D /var/lib/pgsql/9.4/data
postgres 11613 11611 0 00:05 ? 00:00:00 postgres: logger process
postgres 11615 11611 0 00:05 ? 00:00:00 postgres: checkpointer process
postgres 11616 11611 0 00:05 ? 00:00:00 postgres: writer process
postgres 11617 11611 0 00:05 ? 00:00:00 postgres: wal writer process
postgres 11618 11611 0 00:05 ? 00:00:00 postgres: autovacuum launcher process
postgres 11619 11611 0 00:05 ? 00:00:00 postgres: stats collector process
postgres 11666 11611 0 00:05 ? 00:00:00 postgres: postgres labkey 127.0.0.1(43654) idle
root 11670 11520 0 00:05 pts/2 00:00:00 grep postg

Thanks,
Vahid
 
Jon (LabKey DevOps) responded:  2015-05-14 15:19
Hi Vahid,

Ok, now retry the psql command from earlier:

psql -h localhost -U postgres -d labkey

This time, it should prompt for a password and we can tell whether your password that you set is actually correct.

Regards,

Jon
 
vahid azimi responded:  2015-05-14 15:30
Hi Jon,

I rebooted my virtual machine, logged back in, and followed your directions.

It prompted me for my password; I entered Pass01@ ...here is the command line:

[root@localhost Downloads]# psql -h localhost -U postgres -d labkey
Password for user postgres:
psql (9.4.1)
Type "help" for help.

labkey=#


I then opened up localhost:9090/labkey in my browser and it worked! Thank you so much for your help.

-Vahid
 
Jon (LabKey DevOps) responded:  2015-05-14 15:52
Fantastic! Glad it finally started up for you!

Regards,

Jon