Fork me on GitHub
#datomic
<
2019-11-08
>
Jon Walch04:11:44

Anyone seen this one before? I attached a Service Account to my EKS Cluster with S3ReadOnlyPerms, so it should be able to access it. If I'm using a VPC Endpoint to connect to my Datomic VPC, which VPS Endpoint DNS name am I supposed to use?

{:type clojure.lang.ExceptionInfo
   :message Forbidden to read keyfile at s3://<redacted>/datomic/access/admin/.keys. Make sure that your endpoint is correct, and that your ambient AWS credentials allow you to GetObject on the keyfile.
   :data {:cognitect.anomalies/category :cognitect.anomalies/forbidden, :cognitect.anomalies/message Forbidden to read keyfile at s3://<redacted>/datomic/access/admin/.keys. Make sure that your endpoint is correct, and that your ambient AWS credentials allow you to GetObject on the keyfile.

Jon Walch04:11:07

Does my application need more than S3ReadOnly to access that keyfile?

Jon Walch04:11:08

Using the VPC Endpoint
You must use the VPC Endpoint DNS (or Route53 entry if you created one) and port 8182 for the :endpoint parameter in your Datomic client configuration when connecting from your VPC:

(def cfg {:server-type :ion
          :region "<your AWS Region>" ;; e.g. us-east-1
          :system "<system-name>"
          :endpoint "http://<VpcEndpointDns>:8182"})
The endpoint DNS name can be found in the Outputs of the VPC Endpoint CloudFormation Stack under the VpcEndpointDns key.

Jon Walch04:11:16

VpcEndpointDns no longer exists

onetom06:11:36

is there some concise idiom for replacing eids in :tx-data returned by d/transact or d/with, so we can see attribute idents at least?

onetom06:11:41

something like

(->> (d/with (d/db conn) [])
       ((fn [{:keys [db-after tx-data]}]
          (map (fn [datom]
                 (map #(or (d/ident db-after %) %)
                      ((juxt :e :a :v :tx :added) datom)))
               tx-data))))
=> ((13194140516868 :db/txInstant #inst"2019-11-08T06:34:31.229-00:00" 13194140516868 true))

pvillegas1219:11:42

I’m getting

http-endpoint fail failed
                "Type": "java.lang.IllegalStateException",
                "Message": "AsyncContext completed and/or Request lifecycle recycled",
                "At": [
                    "org.eclipse.jetty.server.AsyncContextState",
                    "state",
                    "AsyncContextState.java",
                    54
                ]
in my datomic logs

pvillegas1219:11:01

Is entity/index a reserved keyword in datomic for schema?

Brian22:11:11

Should be a simple question if someone can answer it regarding transaction functions. I'm making this call which uses a transaction function update-tags-tx:

(let [hash (ffirst hashes)
        hash-type (second (first hashes))
        tx ['(update-tags-tx hash hash-type tags)]]
        (d/transact
         conn
         {:tx-data tx}))
` But getting Unable to resolve entity: hash-type which to me means that's not being evaluated due to the ' which makes sense. In the docs (https://docs.datomic.com/cloud/transactions/transaction-functions.html#calling) they use raw values. How can I do this with variables?

ghadi23:11:33

Quote the symbol alone instead of the whole list