Non-standard Postgres port doesn't appear to be implemented in build-db as suggested in docs

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Non-standard Postgres port doesn't appear to be implemented in build-db as suggested in docs

Sam Hokin-2
I need to create databases on a PostgreSQL server with a non-5432 port, and according to the tutorial, I should be able to specify a
port as follows in my .intermine/foomine.properties file:

# Access to the postgres database to build into and access from the webapp
db.production.datasource.serverName=butler
db.production.datasource.port=5433
db.production.datasource.databaseName=chadomine
db.production.datasource.user=intermine
db.production.datasource.password=SOMEPASS

However, when I do so, dbmodel/ant clean build-db fails with the following:

-do-build-db:
  [build-db] [main] INFO com.zaxxer.hikari.HikariDataSource - HikariCP pool db.production is starting.
  [build-db] Our new url -> jdbc:postgresql://butler/chadomine

BUILD FAILED
/home/shokin/intermine-beta-1.54/imbuild/objectstore.xml:51: The following error occurred while executing this line:
/home/shokin/intermine-beta-1.54/imbuild/task.xml:180: org.postgresql.util.PSQLException: FATAL: password authentication failed for
user "intermine" - for database: db.production

Note that the "new url" does not specify a port. The URL should be jdbc:postgresql://butler:5433/chadomine, right? (There is another
Postgres running on port 5432, so the error may not be what you'd expect from a port that's not in use.)

Just to confirm, I can connect to the chadomine database on port 5433 using psql:

$ psql -h butler -p 5433 -U intermine chadomine
Password for user intermine:
psql (9.3.9)
Type "help" for help.

chadomine=>

_______________________________________________
dev mailing list
[hidden email]
http://mail.intermine.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Non-standard Postgres port doesn't appear to be implemented in build-db as suggested in docs

Sergio Contrino
dear sam,
thank you for the notification. we will investigate
regards
sergio


On 11/09/15 16:59, Sam Hokin wrote:

> I need to create databases on a PostgreSQL server with a non-5432 port,
> and according to the tutorial, I should be able to specify a port as
> follows in my .intermine/foomine.properties file:
>
> # Access to the postgres database to build into and access from the webapp
> db.production.datasource.serverName=butler
> db.production.datasource.port=5433
> db.production.datasource.databaseName=chadomine
> db.production.datasource.user=intermine
> db.production.datasource.password=SOMEPASS
>
> However, when I do so, dbmodel/ant clean build-db fails with the following:
>
> -do-build-db:
>   [build-db] [main] INFO com.zaxxer.hikari.HikariDataSource - HikariCP
> pool db.production is starting.
>   [build-db] Our new url -> jdbc:postgresql://butler/chadomine
>
> BUILD FAILED
> /home/shokin/intermine-beta-1.54/imbuild/objectstore.xml:51: The
> following error occurred while executing this line:
> /home/shokin/intermine-beta-1.54/imbuild/task.xml:180:
> org.postgresql.util.PSQLException: FATAL: password authentication failed
> for user "intermine" - for database: db.production
>
> Note that the "new url" does not specify a port. The URL should be
> jdbc:postgresql://butler:5433/chadomine, right? (There is another
> Postgres running on port 5432, so the error may not be what you'd expect
> from a port that's not in use.)
>
> Just to confirm, I can connect to the chadomine database on port 5433
> using psql:
>
> $ psql -h butler -p 5433 -U intermine chadomine
> Password for user intermine:
> psql (9.3.9)
> Type "help" for help.
>
> chadomine=>
>
> _______________________________________________
> dev mailing list
> [hidden email]
> http://mail.intermine.org/cgi-bin/mailman/listinfo/dev
>

--
sergio contrino                  InterMine, University of Cambridge
https://sergiocontrino.github.io           http://www.intermine.org

_______________________________________________
dev mailing list
[hidden email]
http://mail.intermine.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Non-standard Postgres port doesn't appear to be implemented in build-db as suggested in docs

Sam Hokin-2
I found it, Sergio. Lines 303, 304 of intermine/objectstore/main/src/org/intermine/sql/Database.java are as follows:

303    if (settings.get("datasource.portName") != null) {
304        urlBuffer.append(":" + (String) settings.get("datasource.portName"));
305    }

this is clearly a confusion between settings, which is drawn from foomine.properties, and dsProps, which is created in the Database
constructor with a bunch of renaming for HikariCP compatibility, particularly:

     renameProperty(dsProps, "port", "dataSource.portNumber");

So the fix was just to replace "portName" with "port" in lines 303, 304:

303    if (settings.get("datasource.port") != null) {
304        urlBuffer.append(":" + (String) settings.get("datasource.port"));
305    }

resulting in:

-do-build-db:
[build-db] [main] INFO com.zaxxer.hikari.HikariDataSource - HikariCP pool db.production is starting.
[build-db] Our new url -> jdbc:postgresql://butler:5433/chadomine
[build-db] Our new url -> jdbc:postgresql://butler:5433/chadomine
[create-indexes] [main] INFO com.zaxxer.hikari.HikariDataSource - HikariCP pool db.production is starting.

I'm happy to fix this on github and submit a pull request. It's not totally clear to me how much you want folks to do via posts to
this mailing list versus submitting issues, fixes and pull requests on the github.

On 09/11/2015 11:17 AM, sergio contrino wrote:

> dear sam,
> thank you for the notification. we will investigate
> regards
> sergio
>
>
> On 11/09/15 16:59, Sam Hokin wrote:
>> I need to create databases on a PostgreSQL server with a non-5432 port,
>> and according to the tutorial, I should be able to specify a port as
>> follows in my .intermine/foomine.properties file:
>>
>> # Access to the postgres database to build into and access from the webapp
>> db.production.datasource.serverName=butler
>> db.production.datasource.port=5433
>> db.production.datasource.databaseName=chadomine
>> db.production.datasource.user=intermine
>> db.production.datasource.password=SOMEPASS
>>
>> However, when I do so, dbmodel/ant clean build-db fails with the following:
>>
>> -do-build-db:
>>   [build-db] [main] INFO com.zaxxer.hikari.HikariDataSource - HikariCP
>> pool db.production is starting.
>>   [build-db] Our new url -> jdbc:postgresql://butler/chadomine
>>
>> BUILD FAILED
>> /home/shokin/intermine-beta-1.54/imbuild/objectstore.xml:51: The
>> following error occurred while executing this line:
>> /home/shokin/intermine-beta-1.54/imbuild/task.xml:180:
>> org.postgresql.util.PSQLException: FATAL: password authentication failed
>> for user "intermine" - for database: db.production
>>
>> Note that the "new url" does not specify a port. The URL should be
>> jdbc:postgresql://butler:5433/chadomine, right? (There is another
>> Postgres running on port 5432, so the error may not be what you'd expect
>> from a port that's not in use.)
>>
>> Just to confirm, I can connect to the chadomine database on port 5433
>> using psql:
>>
>> $ psql -h butler -p 5433 -U intermine chadomine
>> Password for user intermine:
>> psql (9.3.9)
>> Type "help" for help.
>>
>> chadomine=>
>>
>> _______________________________________________
>> dev mailing list
>> [hidden email]
>> http://mail.intermine.org/cgi-bin/mailman/listinfo/dev
>>
>

_______________________________________________
dev mailing list
[hidden email]
http://mail.intermine.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Non-standard Postgres port doesn't appear to be implemented in build-db as suggested in docs

Julie Sullivan
Hi Sam!

A pull request would be great, thanks!

We don't have any rules for GitHub vs. mailing list so whichever works
for you. I think what you did is the best way -- discuss on the list
then post the ticket / fix on GitHub.

Cheers
Julie

On 11/09/15 21:27, Sam Hokin wrote:

> I found it, Sergio. Lines 303, 304 of
> intermine/objectstore/main/src/org/intermine/sql/Database.java are as
> follows:
>
> 303    if (settings.get("datasource.portName") != null) {
> 304        urlBuffer.append(":" + (String)
> settings.get("datasource.portName"));
> 305    }
>
> this is clearly a confusion between settings, which is drawn from
> foomine.properties, and dsProps, which is created in the Database
> constructor with a bunch of renaming for HikariCP compatibility,
> particularly:
>
>      renameProperty(dsProps, "port", "dataSource.portNumber");
>
> So the fix was just to replace "portName" with "port" in lines 303, 304:
>
> 303    if (settings.get("datasource.port") != null) {
> 304        urlBuffer.append(":" + (String)
> settings.get("datasource.port"));
> 305    }
>
> resulting in:
>
> -do-build-db:
> [build-db] [main] INFO com.zaxxer.hikari.HikariDataSource - HikariCP
> pool db.production is starting.
> [build-db] Our new url -> jdbc:postgresql://butler:5433/chadomine
> [build-db] Our new url -> jdbc:postgresql://butler:5433/chadomine
> [create-indexes] [main] INFO com.zaxxer.hikari.HikariDataSource -
> HikariCP pool db.production is starting.
>
> I'm happy to fix this on github and submit a pull request. It's not
> totally clear to me how much you want folks to do via posts to this
> mailing list versus submitting issues, fixes and pull requests on the
> github.
>
> On 09/11/2015 11:17 AM, sergio contrino wrote:
>> dear sam,
>> thank you for the notification. we will investigate
>> regards
>> sergio
>>
>>
>> On 11/09/15 16:59, Sam Hokin wrote:
>>> I need to create databases on a PostgreSQL server with a non-5432 port,
>>> and according to the tutorial, I should be able to specify a port as
>>> follows in my .intermine/foomine.properties file:
>>>
>>> # Access to the postgres database to build into and access from the
>>> webapp
>>> db.production.datasource.serverName=butler
>>> db.production.datasource.port=5433
>>> db.production.datasource.databaseName=chadomine
>>> db.production.datasource.user=intermine
>>> db.production.datasource.password=SOMEPASS
>>>
>>> However, when I do so, dbmodel/ant clean build-db fails with the
>>> following:
>>>
>>> -do-build-db:
>>>   [build-db] [main] INFO com.zaxxer.hikari.HikariDataSource - HikariCP
>>> pool db.production is starting.
>>>   [build-db] Our new url -> jdbc:postgresql://butler/chadomine
>>>
>>> BUILD FAILED
>>> /home/shokin/intermine-beta-1.54/imbuild/objectstore.xml:51: The
>>> following error occurred while executing this line:
>>> /home/shokin/intermine-beta-1.54/imbuild/task.xml:180:
>>> org.postgresql.util.PSQLException: FATAL: password authentication failed
>>> for user "intermine" - for database: db.production
>>>
>>> Note that the "new url" does not specify a port. The URL should be
>>> jdbc:postgresql://butler:5433/chadomine, right? (There is another
>>> Postgres running on port 5432, so the error may not be what you'd expect
>>> from a port that's not in use.)
>>>
>>> Just to confirm, I can connect to the chadomine database on port 5433
>>> using psql:
>>>
>>> $ psql -h butler -p 5433 -U intermine chadomine
>>> Password for user intermine:
>>> psql (9.3.9)
>>> Type "help" for help.
>>>
>>> chadomine=>
>>>
>>> _______________________________________________
>>> dev mailing list
>>> [hidden email]
>>> http://mail.intermine.org/cgi-bin/mailman/listinfo/dev
>>>
>>
>
> _______________________________________________
> dev mailing list
> [hidden email]
> http://mail.intermine.org/cgi-bin/mailman/listinfo/dev
>

_______________________________________________
dev mailing list
[hidden email]
http://mail.intermine.org/cgi-bin/mailman/listinfo/dev