# Unable to create a VirtualGraph with a PostgreSQL Server

**URL:** <https://community.stardog.com/t/unable-to-create-a-virtualgraph-with-a-postgresql-server/1649>\
**Category:** Support\
**Created:** [May 9, 2019, 8:03am UTC](https://community.stardog.com/t/unable-to-create-a-virtualgraph-with-a-postgresql-server/1649 "2019-05-09T08:03:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lavhal](https://avatars.discourse-cdn.com/v4/letter/l/f9ae1b/32.png) [@lavhal](https://community.stardog.com/u/lavhal)\
**Post date:** [May 9, 2019, 8:03am UTC](https://community.stardog.com/t/unable-to-create-a-virtualgraph-with-a-postgresql-server/1649/1 "2019-05-09T08:03:58Z")

</div>

Hi,

I am trying to create a VirtualGraph for a relational database hosted in a PostgreSQL Server using the following command:

> stardog-admin virtual add database.properties databaseMappings.ttl --format r2rml

The error that I am receiving is:

` The server requested password-based authentication, but no password was provided.`

and this is the error log:

```
`ERROR 2019-05-08 15:10:41,133 [stardog-user-38] com.stardog.http.server.undertow.ErrorHandling:writeError(138): Unexpected error on the server

```

java.lang.RuntimeException: org.postgresql.util.PSQLException: The server requested password-based authentication, but no password was provided.  
at com.complexible.stardog.virtual.RdbmsDataSource.lambda$connect$0(RdbmsDataSource.java:46) ~[stardog-virtual-core-6.1.3.jar:?]  
at com.complexible.stardog.virtual.vega.RuntimeDriverLoader.executeUnderClassLoader(RuntimeDriverLoader.java:124) ~[stardog-virtual-core-6.1.3.jar:?]  
at com.complexible.stardog.virtual.RdbmsDataSource.connect(RdbmsDataSource.java:41) ~[stardog-virtual-core-6.1.3.jar:?]  
at com.complexible.stardog.virtual.vega.rdbms.RdbmsVirtualGraphFactory.create(RdbmsVirtualGraphFactory.java:60) ~[stardog-virtual-core-6.1.3.jar:?]  
at com.complexible.stardog.virtual.vega.rdbms.RdbmsVirtualGraphFactory.create(RdbmsVirtualGraphFactory.java:44) ~[stardog-virtual-core-6.1.3.jar:?]  
at com.complexible.stardog.virtual.DefaultVirtualGraphRegistry.createVirtualGraph(DefaultVirtualGraphRegistry.java:309) ~[stardog-virtual-core-6.1.3.jar:?]  
at com.complexible.stardog.virtual.DefaultVirtualGraphRegistry.createVirtualGraph(DefaultVirtualGraphRegistry.java:295) ~[stardog-virtual-core-6.1.3.jar:?]  
at com.complexible.stardog.virtual.DefaultVirtualGraphRegistry.add(DefaultVirtualGraphRegistry.java:169) ~[stardog-virtual-core-6.1.3.jar:?]  
at com.complexible.stardog.virtual.SecuredVirtualGraphRegistry.add(SecuredVirtualGraphRegistry.java:133) ~[stardog-virtual-core-6.1.3.jar:?]  
at com.complexible.stardog.protocols.http.server.virtual.admin.VirtualGraphHttpService.addVG(VirtualGraphHttpService.java:344) ~[stardog-virtual-protocols-http-server-6.1.3.jar:?]  
at com.complexible.stardog.protocols.http.server.virtual.admin.VirtualGraphHttpService.add(VirtualGraphHttpService.java:144) ~[stardog-virtual-protocols-http-server-6.1.3.jar:?]  
at com.stardog.http.server.undertow.jaxrs.ExtractRoutes.lambda$handleIt$5(ExtractRoutes.java:192) ~[stardog-protocols-http-server-6.1.3.jar:?]  
at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120) [shiro-core-1.2.3.jar:1.2.3]  
at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108) [shiro-core-1.2.3.jar:1.2.3]  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0\_191]  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0\_191]  
at java.lang.Thread.run(Thread.java:748) [?:1.8.0\_191]  
Caused by: org.postgresql.util.PSQLException: The server requested password-based authentication, but no password was provided.  
at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:533) ~[postgresql-42.2.5.jre7.jar:42.2.5.jre7]  
at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:141) ~[postgresql-42.2.5.jre7.jar:42.2.5.jre7]  
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:192) ~[postgresql-42.2.5.jre7.jar:42.2.5.jre7]  
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49) ~[postgresql-42.2.5.jre7.jar:42.2.5.jre7]  
at org.postgresql.jdbc.PgConnection.(PgConnection.java:195) ~[postgresql-42.2.5.jre7.jar:42.2.5.jre7]  
at org.postgresql.Driver.makeConnection(Driver.java:454) ~[postgresql-42.2.5.jre7.jar:42.2.5.jre7]  
at org.postgresql.Driver.connect(Driver.java:256) ~[postgresql-42.2.5.jre7.jar:42.2.5.jre7]  
at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:310) ~[tomcat-jdbc-9.0.2.jar:?]  
at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:203) ~[tomcat-jdbc-9.0.2.jar:?]  
at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:738) ~[tomcat-jdbc-9.0.2.jar:?]  
at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:670) ~[tomcat-jdbc-9.0.2.jar:?]  
at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:482) ~[tomcat-jdbc-9.0.2.jar:?]  
at org.apache.tomcat.jdbc.pool.ConnectionPool.(ConnectionPool.java:154) ~[tomcat-jdbc-9.0.2.jar:?]  
at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:118) ~[tomcat-jdbc-9.0.2.jar:?]  
at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:107) ~[tomcat-jdbc-9.0.2.jar:?]  
at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:131) ~[tomcat-jdbc-9.0.2.jar:?]  
at com.complexible.stardog.virtual.RdbmsDataSource.lambda$connect$0(RdbmsDataSource.java:43) ~[stardog-virtual-core-6.1.3.jar:?]  
... 16 more  
`

Below are connections details that I am using (concrete details replaced):

> jdbc.url=jdbc:postgresql://servername/database  
> jdbc.driver=org.postgresql.Driver  
> jdbc.user=user1  
> jdbc.password=password

I configured the PostgreSQL Server to allow remote connections, and I am able to connect using Ontop tool as well as PgAdmin, both from my local machine.

I tried the following JDBC drivers and placed in the folder as described in Stardog documentation:

[PostgreSQL JDBC 4.2 Driver, 42.2.5] ([https://jdbc.postgresql.org/download/postgresql-42.2.5.jar](https://jdbc.postgresql.org/download/postgresql-42.2.5.jar))

[PostgreSQL JDBC 4.1 Driver, 42.2.5.jre7] ([https://jdbc.postgresql.org/download/postgresql-42.2.5.jre7.jar](https://jdbc.postgresql.org/download/postgresql-42.2.5.jre7.jar))

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![stephen](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/stephen/32/27_2.png) [@stephen](https://community.stardog.com/u/stephen)\
**Post date:** [May 9, 2019, 12:17pm UTC](https://community.stardog.com/t/unable-to-create-a-virtualgraph-with-a-postgresql-server/1649/2 "2019-05-09T12:17:20Z")

</div>

Hi,

In your properties file, it looks like you have `jdbc.user` instead of `jdbc.username`. Try changing that out and you should be able to connect.

---

<div class="post-metadata">

**Author:** ![lavhal](https://avatars.discourse-cdn.com/v4/letter/l/f9ae1b/32.png) [@lavhal](https://community.stardog.com/u/lavhal)\
**Post date:** [May 10, 2019, 6:39am UTC](https://community.stardog.com/t/unable-to-create-a-virtualgraph-with-a-postgresql-server/1649/3 "2019-05-10T06:39:08Z")

</div>

Hi,

I used also with jdbc.username, but the error message was the same.

Since our Stardog server is running behind a Proxy, we solved the problem based on the following link:  
[https://community.stardog.com/t/stardog-connection-via-http-proxy/483/2](https://community.stardog.com/t/stardog-connection-via-http-proxy/483/2) , via putting the following command into STARDOG\_JAVA\_ARGS:

`STARDOG_JAVA_ARGS="-Xmx2g -Xms2g -XX:MaxDirectMemorySize=1g -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=53128"`

Please note, in the original link there is a tiny misspell error, instead of "-Dhttp.protyPort=53128", it should be "-Dhttp.proxyPort=53128".

Running behind a proxy caused the problem of not correctly handing federated queries, as described in the following link: [https://community.stardog.com/t/unable-to-run-federated-queries/1651](https://community.stardog.com/t/unable-to-run-federated-queries/1651) . Basically, both problems are solved using the above command. I interlinked these two problems in case some else encounters them in the future.

Thank you for your support.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/e/ed66b48a616f505106a4acde3c9cee7e6da9bc67.svg) [@system](https://community.stardog.com/u/system)\
**Post date:** [May 24, 2019, 6:45am UTC](https://community.stardog.com/t/unable-to-create-a-virtualgraph-with-a-postgresql-server/1649/4 "2019-05-24T06:45:46Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
