Sol
Sol

Reputation: 107

How to fix "Could not find datomic in catalog"

I'm trying to run datomic pro using a local postgresql, transactor an peer.

I'm able to start both the database and the transactor without any problem:

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 with no success. Can someone help me?

Upvotes: 1

Views: 334

Answers (1)

meamuri
meamuri

Reputation: 23

I faced with the same issue but I've found a solution after carefully docs exploring.

The key is presented in this section of the documentation: https://docs.datomic.com/on-prem/overview/storage.html#connecting-to-transactor

After running a transactor and before you run a peer, go to datomic base dir and execute following:

bin/shell

## for now you are inside datomic shell

uri = "datomic:sql://datomic?jdbc:postgresql://localhost:5432/datomic?user=datomic&password=datomic";

Peer.createDatabase(uri);

## Terminate your datomic shell

That's all. After that you can run peer server as you mentioned

Upvotes: 0

Related Questions