Peer-server problem: Could not find datomic in catalog

Hi everyone. So here is my situation: I’m trying to start using datomic in my company’s projects so in order to do this I’m trying to deploy a on-premisses containerized solution using Posgresql and the Datomic Pro Starter Edition.

As I’m just prototyping in order to better understand datomic’s ecosystem I’m naming all the things datomic (the database, database user and database password is datomic-password).

I’m already able to start the transactor without any probles:

db-storage       | 2019-09-01 21:26:34.823 UTC [1] LOG:  starting PostgreSQL 12beta3 on x86_64-pc-linux-musl, compiled by gcc (Alpine 8.3.0) 8.3.0, 64-bit
db-storage       | 2019-09-01 21:26:34.823 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
db-storage       | 2019-09-01 21:26:34.823 UTC [1] LOG:  listening on IPv6 address "::", port 5432
db-storage       | 2019-09-01 21:26:34.835 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db-storage       | 2019-09-01 21:26:34.849 UTC [18] LOG:  database system was shut down at 2019-09-01 21:25:15 UTC
db-storage       | 2019-09-01 21:26:34.852 UTC [1] LOG:  database system is ready to accept connections
db-transactor    | Launching with Java options -server -Xms1g -Xmx1g -XX:+UseG1GC -XX:MaxGCPauseMillis=50
db-transactor    | Starting datomic:sql://<DB-NAME>?jdbc:postgresql://localhost:5432/datomic?user=datomic&password=datomic-password, you may need to change the user and password parameters to work with your jdbc driver ...
db-transactor    | System started datomic:sql://<DB-NAME>?jdbc:postgresql://localhost:5432/datomic?user=datomic&password=datomic-password, you may need to change the user and password parameters to work with your jdbc driver

(They’re all running on containers with a network_mode=host) I think that theses warnings may come from the fact that I’m using datomic as the user and the database name, but I’m not sure.

But then, when I try to start a peer server, I’m faced with the following error:

$ ./bin/run -m datomic.peer-server -h localhost -p 8998 -a datomic-peer-user,datomic-peer-password -d datomic,datomic:sql://datomic?jdbc:postgresql://localhost:5432/datomic?user=datomic\&password=datomic-password
Exception in thread "main" java.lang.RuntimeException: Could not find datomic in catalog
    at datomic.peer$get_connection$fn__18852.invoke(peer.clj:681)
    at datomic.peer$get_connection.invokeStatic(peer.clj:669)
    at datomic.peer$get_connection.invoke(peer.clj:666)
    at datomic.peer$connect_uri.invokeStatic(peer.clj:763)
    at datomic.peer$connect_uri.invoke(peer.clj:755)
        (...)
    at clojure.main$main.doInvoke(main.clj:561)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.lang.Var.applyTo(Var.java:705)
    at clojure.main.main(main.java:37)

I’ve already tried changing a bunch of configurations and deployment tatics with no success.

This is my transactor.properties file:

protocol=sql
host=localhost
port=4334
license-key=...
sql-url=jdbc:postgresql://localhost:5432/datomic
sql-user=datomic
sql-password=datomic-password
sql-driver-class=org.postgresql.Driver
memory-index-threshold=32m
memory-index-max=256m
object-cache-max=256m

Can someone tell me what I’m I getting wrong?

Peer Server does not create or delete databases and must be connected to an already-existing logical database within the Datomic system.

Your connection URI datomic:sql://datomic?jdbc:postgresql://localhost:5432/datomic?user=datomic\&password=datomic-password includes the database name of “datomic” (the part right after the :5432/). You would need to have connected to your system with a peer directly and created that database before you can use the Peer Server to connect to it.

See: https://docs.datomic.com/on-prem/peer-getting-started.html and https://docs.datomic.com/on-prem/dev-setup.html#run-dev-transactor