I try to set up datomic (v.0.9.5951) locally on my windows 10 machine. I set up a postgresql server and created the required tables and so on by the use of the scripts provided by datomic. Then i run the transactor inside WSL which runs fine. I am able to connect, create databases and run queries against it by running the peer api in the repl.
My problem starts when i try to start up a peer-server connecting to that running transactor.
Exception in thread “main” java.util.concurrent.ExecutionException: org.postgresql.util.PSQLException: The server requested password-based authentication, but no password was provided.
Is there another way to provide sql user and password then to put it in the connection string? Or is there something else i do wrong?
I know you mentioned that you created the tables from the scripts, but I want to confirm that you also created the Datomic user from the bin/sql/postgres-user.sql script?
jbin at Jarets-MacBook-Pro in ~/Desktop/Jaret/Tools/releasetest/storagetest/datomic-pro-0.9.5951
$ psql -U postgres
psql (11.4)
Type "help" for help.
postgres=# \du
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------------------+-----------
datomic | Create DB | {}
jbin | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
It looks like this is a windows specific issue. From my limited testing you’ll need to escape portions of the peer-server command:
C:\Users\Administrator>echo bin/run -m datomic.peer-server -h localhost -p 8998 -a myaccesskey,mysecret -d pts,datomic:sql://pts?jdbc:postgresql://localhost:5432/datomic?user=datomic&password=datomic
bin/run -m datomic.peer-server -h localhost -p 8998 -a myaccesskey,mysecret -d pts,datomic:sql://pts?jdbc:postgresql://localhost:5432/datomic?user=datomic
'password' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\Administrator>echo bin/run -m datomic.peer-server -h localhost -p 8998 -a myaccesskey,mysecret -d pts,datomic:sql://pts?jdbc:postgresql://localhost:5432/datomic?user=datomic^&password=datomic
bin/run -m datomic.peer-server -h localhost -p 8998 -a myaccesskey,mysecret -d pts,datomic:sql://pts?jdbc:postgresql://localhost:5432/datomic?user=datomic&password=datomic
You’ll note in my above example that I used echo to identify which portions of the command need to be escaped. Per this test it looks like you’ll need to escape the &. You may also be able to add quotes around the entire URI: