Using d/with-db in a query fails on Cloud

Hi, I’m trying to run a query on cloud using a with-db as the data source. The query runs perfectly when I run it locally with using Datomic Access, but it fails when I deploy the ions.

The functionality is similar to this:

(defn find-sub-entities [db entity-id]
  (d/q '[:find ?se
         :in $ ?en-id
         [?en :entity/id ?en-id]
         [?en :entity/sub-entities ?se]]
       db entity-id))

(defn future-sub-entites [conn tx-data entity-id]
  (let [with-db (d/with-db conn)
        result  (d/with with-db {:tx-data tx-data})
        sub-entities (find-sub-entities (:db-after result) entity-id)]

This is the exception I get from ions:

  "cognitect.anomalies/category": "cognitect.anomalies/busy",
  "cognitect.anomalies/message": "Database does not yet have t=271",
  "basis": 270,
  "needed-t": 271

Any idea what I might be doing wrong? Thanks in advance!

1 Like

What version of Datomic Cloud are you running?
You can find the version in the Outputs tab for the Datomic Compute stack of your CloudFormation dashboard.

Hi Marshall,

I’m running the version 8812. I tried it both before I updated to this version and after the update, still the same result.


Hi @marshall,

Any updates on this? If you need any more information, let me know. If it’s easier to have access our Datomic installation, I can provide that as well.


Hi Furkan,

I’ve reproduced this behavior and we are investigating.


Thanks for the update!

I’ll wait with my PR until there is a fix for this. I didn’t want to implement an ugly workaround.

Let me know if I can help with anything.