<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Datomic Knowledgebase - Recent questions tagged client api</title>
<link>https://ask.datomic.com/index.php/tag/client+api</link>
<description>Powered by Question2Answer</description>
<item>
<title>Error connecting to datomic cloud</title>
<link>https://ask.datomic.com/index.php/861/error-connecting-to-datomic-cloud</link>
<description>&lt;p&gt;I'm trying to connect with the datomic cloud, but when I connect with the client I get the following error:&lt;br&gt;
Execution error (NoClassDefFoundError) at com.amazonaws.services.s3.AmazonS3ClientBuilder/standard (AmazonS3ClientBuilder.java:46).&lt;br&gt;
Could not initialize class com.amazonaws.services.s3.S3CredentialsProviderChain&lt;/p&gt;
</description>
<category>Client API</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/861/error-connecting-to-datomic-cloud</guid>
<pubDate>Mon, 12 Dec 2022 00:30:29 +0000</pubDate>
</item>
<item>
<title>java.lang.IllegalArgumentException: Cannot resolve key: 24a96e20-f526-4f7f-ba38-4f684caa5607</title>
<link>https://ask.datomic.com/index.php/720/illegalargumentexception-resolve-24a96e20-4f684caa5607</link>
<description>&lt;p&gt;I am trying to implement resursive rule (loglcal OR) by following this video - Lucas Cavalcanti &amp;amp; Edward Wible - Exploring four hidden superpowers of Datomic&lt;/p&gt;
&lt;p&gt;Here the code&lt;/p&gt;
&lt;p&gt;(defn owns? [cid pid db]&lt;br&gt;
  (d/q '{:find [?pur]&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;     :in [$ ?cus-id ?pur %]
     :where
     [(owns? ?cus-id ?pur)]}
db cid [:purchase/id pid] owner-rules))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(comment&lt;br&gt;
  (owns?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#uuid &quot;0fb7ea94-44af-46fa-98ca-0ddb5eb23123&quot;
#uuid &quot;24a96e20-f526-4f7f-ba38-4f684caa5607&quot;
(d/db bank-conn)))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;While running the above example I am getting this error: &lt;br&gt;
java.lang.IllegalArgumentException Cannot resolve key: 24a96e20-f526-4f7f-ba38-4f684caa5607&lt;/p&gt;
&lt;p&gt;Here is the full code:&lt;/p&gt;
&lt;p&gt;(def purchase-schema&lt;br&gt;
  [{:db/ident :purchase/id&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:db/doc &quot;The purchase ID&quot;
:db/unique :db.unique/identity
:db/valueType :db.type/uuid
:db/cardinality :db.cardinality/one}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;   {:db/ident :purchase/account&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:db/doc &quot;Purchase Account&quot;
:db/valueType :db.type/ref
:db/cardinality :db.cardinality/one}])
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(def account-schema&lt;br&gt;
  [{:db/ident :account/id&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:db/doc &quot;The Account ID&quot;
:db/unique :db.unique/identity
:db/valueType :db.type/uuid
:db/cardinality :db.cardinality/one}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;   {:db/ident :account/customer&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:db/doc &quot;Customer who own's this account&quot;
:db/valueType :db.type/ref
:db/cardinality :db.cardinality/one}])
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(def customer-schema&lt;br&gt;
  [{:db/ident :customer/id&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:db/doc &quot;Customer ID&quot;
:db/unique :db.unique/identity
:db/valueType :db.type/uuid
:db/cardinality :db.cardinality/one}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;   {:db/ident :customer/name&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:db/doc &quot;Customer name&quot;
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one}])
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;;;&lt;br&gt;
;; Create client&lt;br&gt;
(def client (d/client {:server-type :dev-local&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;                   :system &quot;dev&quot;}))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;;; Create connections&lt;br&gt;
(def bank-conn    (d/connect client {:db-name &quot;bank&quot;}))&lt;/p&gt;
&lt;p&gt;;; Transact schemas&lt;br&gt;
(comment&lt;br&gt;
  (d/transact  bank-conn {:tx-data purchase-schema})&lt;br&gt;
  (d/transact  bank-conn {:tx-data account-schema})&lt;br&gt;
  (d/transact  bank-conn {:tx-data customer-schema})&lt;br&gt;
  (d/tx-range  bank-conn {:start 6}))&lt;/p&gt;
&lt;p&gt;(comment&lt;br&gt;
  (java.util.UUID/randomUUID))&lt;/p&gt;
&lt;p&gt;;; Transact fake data&lt;br&gt;
(def cid #uuid &quot;0fb7ea94-44af-46fa-98ca-0ddb5eb23123&quot;)&lt;br&gt;
(def sample-customer {:customer/id cid&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;                  :customer/name &quot;Jon Snow&quot;})
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(def aid #uuid &quot;c579a9f6-f6c3-4718-8ecf-c3003021ee9a&quot;)&lt;br&gt;
(def sample-account {:account/id aid&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;                 :account/customer [:customer/id cid]})
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(def pid #uuid &quot;24a96e20-f526-4f7f-ba38-4f684caa5607&quot;)&lt;br&gt;
(def sample-purchase {:purchase/id  pid&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;                  :purchase/account [:account/id aid]})
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(comment&lt;br&gt;
  (d/transact bank-conn {:tx-data [sample-customer]})&lt;br&gt;
  (d/transact bank-conn {:tx-data [sample-account]})&lt;br&gt;
  (d/transact bank-conn {:tx-data [sample-purchase]}))&lt;/p&gt;
&lt;p&gt;(comment&lt;br&gt;
  (d/q '[:find ?cus&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;     :in $ ?cid ?pid
     :where
     [?pur :purchase/id ?pid]
     [?pur :purchase/account ?acc]
     [?acc :account/customer ?cus]
     [?cus :customer/id ?cid]]
  (d/db bank-conn)
  (:customer/id sample-customer)
  (:purchase/id sample-purchase)))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;;; owns v1&lt;br&gt;
(defn ownsv1? [cid pid db]&lt;br&gt;
  (d/q '[:find ?cus&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;     :in $ ?customer-id ?purchase-id
     :where
     [?pur :purchase/id ?purchase-id]
     [?pur :purchase/account ?acc]
     [?acc :account/customer ?cus]
     [?cus :customer/id ?customer-id]]
db cid pid))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(comment&lt;br&gt;
  (ownsv1?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(:customer/id sample-customer)
(:purchase/id sample-purchase)
(d/db bank-conn)))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;;; recursive rule (logical OR)&lt;br&gt;
(def owner-rules&lt;br&gt;
  '[[(owns? ?cus-id ?e)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; [?e :customer/id ?cus-id]]
[(owns? ?cus-id ?e)
 [?e ?ref-attr ?r]
 (owns? ?cus-id ?r)]])
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(defn owns? [cid pid db]&lt;br&gt;
  (d/q '{:find [?pur]&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;     :in [$ ?cus-id ?pur %]
     :where
     [(owns? ?cus-id ?pur)]}
db cid [:purchase/id pid] owner-rules))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;;;&lt;br&gt;
(comment&lt;br&gt;
  (owns?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(:customer/id sample-customer)
(:purchase/id sample-purchase)
(d/db bank-conn)))
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Client API</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/720/illegalargumentexception-resolve-24a96e20-4f684caa5607</guid>
<pubDate>Mon, 06 Jun 2022 19:37:30 +0000</pubDate>
</item>
<item>
<title>`Unable to read keyfile` error when trying to initialize Datomic Cloud with Client API</title>
<link>https://ask.datomic.com/index.php/653/unable-keyfile-error-trying-initialize-datomic-cloud-client</link>
<description>&lt;p&gt;Howdy all.&lt;/p&gt;
&lt;p&gt;I'm testing setting up Datomic Cloud using an IntelliJ IDE. I'm following the Client API tut from Datomic but am stuck initializing the client. &lt;/p&gt;
&lt;p&gt;The spec from an API client is &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.datomic.com/client-api/datomic.client.api.async.html#var-client&quot;&gt;here&lt;/a&gt;, and the tut is &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.datomic.com/cloud/tutorial/client.html&quot;&gt;here&lt;/a&gt;, under the step Using Datomic Cloud.&lt;/p&gt;
&lt;p&gt;So the tut says to init a client like so:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(require '[datomic.client.api :as d])
(def cfg {:server-type :ion
      :region &quot;&amp;lt;your AWS Region&amp;gt;&quot; ;; e.g. us-east-1
      :system &quot;&amp;lt;system name&amp;gt;&quot;
      :creds-profile &quot;&amp;lt;your_aws_profile_if_not_using_the_default&amp;gt;&quot;
      :endpoint &quot;&amp;lt;your endpoint&amp;gt;&quot;})
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;They say to include an AWS profile if not using the default. I am using the default as far as I know--I'm not part of an org in AWS. &lt;/p&gt;
&lt;p&gt;This is the (partially redacted) code from my tutorial.core namespace, where I'm trying to init Datomic:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(ns tutorial.core   
(:gen-class))
(require '[datomic.client.api :as d])
(def cfg {:server-type :cloud
      :region &quot;us-east-2&quot;
      :system &quot;roam&quot;
      :endpoint &quot;https://API_ID.execute-api.us-east-2.amazonaws.com&quot;
      })
(def client (d/client cfg))
(d/create-database client {:db-name &quot;blocks&quot;})
(d/connect client {:db-name &quot;blocks&quot;})
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;However, I'm getting an error from Datomic like: &lt;code&gt;Forbidden to read keyfile at s3://URL/roam/datomic/access/admin/.keys. Make sure that your endpoint is correct, and that your ambient AWS credentials allow you to GetObject on the keyfile.&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Do I need some sort of credential? Could anything else be causing this error? I got the endpoint URL from the ClientApiGatewayEndpoint in my CloudFormation Datomic stack. &lt;/p&gt;
&lt;p&gt;Please let me know if I should provide more info! Thanks. &lt;/p&gt;
</description>
<category>Client API</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/653/unable-keyfile-error-trying-initialize-datomic-cloud-client</guid>
<pubDate>Mon, 23 Aug 2021 13:25:08 +0000</pubDate>
</item>
<item>
<title>How to authenticate and authorize access to API Gateway endpoints for datomic?</title>
<link>https://ask.datomic.com/index.php/651/authenticate-authorize-access-gateway-endpoints-datomic</link>
<description>&lt;p&gt;I'm currently evaluating Datomic and I've deployed a production topology using a split stack. DatomicCloudVersion is 9095 and DatomicCFTVersion is 884. The CloudFormation stack created two API Gateway endpoints: &lt;code&gt;datomic-[system]-client-api&lt;/code&gt; and &lt;code&gt;datomic-[system]-ions&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;From my local computer I can get a client by using &lt;code&gt;datomic-[system]-client-api&lt;/code&gt; endpoint:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(d/client {:system &quot;my-system&quot;
           :server-type :ion
           :region &quot;us-east-1&quot;
           :endpoint &quot;https://[endpoint-id].execute-api.us-east-1.amazonaws.com/&quot;})
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Above, &lt;code&gt;https://[endpoint-id].execute-api.us-east-1.amazonaws.com/&lt;/code&gt; is the client-api API Gateway endpoint. It works, but the endpoint is open to the world. I then added an IAM authorizer to &lt;code&gt;datomic-[system]-client-api&lt;/code&gt; and used an authorized IAM user to make a request to the now authenticated endpoint:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;awscurl --service execute-api -X GET https://[endpoint-id].execute-api.us-east-1.amazonaws.com --profile datomic
{:s3-auth-path &quot;long s3 path&quot;}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;awscurl&lt;/code&gt; is just a tool to make authenticated calls to AWS services. As you can see, I can get a response from the endpoint by using my local profile named &quot;datomic&quot;. If I try using regular curl without the v4 AWS signature it fails:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;curl -X GET https://[endpoint-id].execute-api.us-east-1.amazonaws.com
{&quot;message&quot;:&quot;Forbidden&quot;}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Works as expected. The problem is now I can't get a client using:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(d/client {:system &quot;my-system&quot;
           :server-type :ion
           :region &quot;us-east-1&quot;
           :creds-profile &quot;datomic&quot;
           :endpoint &quot;https://[endpoint-id].execute-api.us-east-1.amazonaws.com/&quot;})
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The response I get is:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{:status 403,
:headers
{&quot;apigw-requestid&quot; &quot;EUsyNi9aIAMEPlg=&quot;,
&quot;connection&quot; &quot;keep-alive&quot;,
&quot;content-length&quot; &quot;23&quot;,
&quot;date&quot; &quot;Thu, 19 Aug 2021 17:01:40 GMT&quot;,
&quot;content-type&quot; &quot;application/json&quot;},
:body &quot;{\&quot;message\&quot;:\&quot;Forbidden\&quot;}&quot;}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It is as if the &lt;code&gt;d/client&lt;/code&gt; call is ignoring the profile or not generating the proper signature. I tried setting the &lt;code&gt;AWS_PROFILE&lt;/code&gt; environment variable as well, to no avail.&lt;/p&gt;
&lt;p&gt;Is using an IAM Authorizer not the proper way to go? How can I protect both the client-api and ions endpoints? Finally, what's the difference between the client-api and ions endpoints?&lt;/p&gt;
</description>
<category>Cloud</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/651/authenticate-authorize-access-gateway-endpoints-datomic</guid>
<pubDate>Thu, 19 Aug 2021 17:05:29 +0000</pubDate>
</item>
<item>
<title>How to properly configure access to IonApiGateway?</title>
<link>https://ask.datomic.com/index.php/646/how-to-properly-configure-access-to-ionapigateway</link>
<description>&lt;p&gt;How to properly configure access to IonApiGateway? Can IAM be used and how? Or is there some other approach?&lt;/p&gt;
&lt;p&gt;I would be very glad if you can help. I read the documentation, but did not find a solution for configuring access.&lt;/p&gt;
</description>
<category>Ions</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/646/how-to-properly-configure-access-to-ionapigateway</guid>
<pubDate>Fri, 16 Jul 2021 14:50:26 +0000</pubDate>
</item>
<item>
<title>d/client external server communication</title>
<link>https://ask.datomic.com/index.php/637/d-client-external-server-communication</link>
<description>&lt;p&gt;&lt;strong&gt;Environment&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;com.datomic/client-cloud 0.8.105&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;History&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Get the docstring for &lt;code&gt;d/client&lt;/code&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(clojure.repl/doc d/client)
-------------------------
datomic.client.api/client
([arg-map])
  Create a client for a Datomic system. This function does not
communicate with a server and returns immediately.

For a cloud system, arg-map requires:

  :server-type   - :cloud
  :region        - AWS region, e.g. &quot;us-east-1&quot;
  :system        - your system name
  :endpoint      - IP address of your system or query group

Optionally, a cloud system arg-map accepts:

  :creds-provider  - instance of com.amazonaws.auth.AWSCredentialsProvider. Defaults to DefaultAWSCredentialsProviderChain
  :creds-profile   - name of an AWS Named Profile. See http://docs.aws.amazon.com/cli/latest/userguide/cli-multiple-profiles.html
  :proxy-port      - local port for SSH tunnel to bastion 

  Note: :creds-provider and :creds-profile are mutually exclusive, providing both will result in an error.

For a dev-local system, arg-map comprises:

  :server-type   - :dev-local (required)
  :system        - a system name (required)
  :storage-dir   - optional, overrides :storage-dir in ~/.datomic/dev-local.edn

dev-local stores databases under ${storage-dir}/${system}/${db-name}.

For a peer-server system, arg-map requires:

  :server-type   - :peer-server
  :access-key    - access-key from peer server launch
  :secret        - secret from peer server launch
  :endpoint      - peer server host:port
  :validate-hostnames  - false

Returns a client object.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note the second sentence in the docstring: &quot;This function does not communicate with a server and returns immediately.&quot; Next call &lt;code&gt;d/client&lt;/code&gt; with an endpoint that does not exist.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(d/client {:server-type :ion
             :system      &quot;my-system&quot;
             :endpoint    &quot;http://i-dont-exist.datomic.net:8182&quot;
             :region      &quot;us-west-2&quot;})
Execution error (ExceptionInfo) at datomic.client.impl.cloud/get-s3-auth-path (cloud.clj:179).
Unable to connect to http://i-dont-exist.datomic.net:8182
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Expectation&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Calling &lt;code&gt;d/client&lt;/code&gt; does not communicate with a server.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Actual&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Calling &lt;code&gt;d/client&lt;/code&gt; does communicate with a server.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Evidence&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The above reproducible example indicates the &lt;code&gt;d/client&lt;/code&gt; function call is attempted to communicate the the passing in &lt;code&gt;:endpoint&lt;/code&gt; string given the exception thrown.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Impact&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;d/client&lt;/code&gt; docstring misleads the user by saying no server communication will occur when it does occur. The result is calls to &lt;code&gt;d/client&lt;/code&gt; can fail in unexpected ways when an external server communication is not accounted for. For example, we spin up Datomic Cloud query groups dynamically and attempt to communicate with the newly spun up cluster. Until the cluster is up and healthy, we expect calls to fail at &lt;code&gt;d/connect&lt;/code&gt; with an unavailable anomaly, and instead the calls would fail at &lt;code&gt;d/client&lt;/code&gt; with an unavailable anomaly.&lt;/p&gt;
</description>
<category>Cloud</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/637/d-client-external-server-communication</guid>
<pubDate>Thu, 24 Jun 2021 14:55:59 +0000</pubDate>
</item>
<item>
<title>Add default :timeout to client api ns docstring</title>
<link>https://ask.datomic.com/index.php/563/add-default-timeout-to-client-api-ns-docstring</link>
<description>&lt;p&gt;It'd be great to have the default value for &lt;code&gt;:timeout&lt;/code&gt; (60000) included in the &lt;code&gt;datomic.client.api&lt;/code&gt; ns docstring. Currently this value can only be found in the &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.datomic.com/cloud/client/client-api.html#timeouts&quot;&gt;docs on the website&lt;/a&gt;. As of client-cloud 0.8.102, the ns docstring specifies the default value for &lt;code&gt;:limit&lt;/code&gt;. &lt;/p&gt;
</description>
<category>Client API</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/563/add-default-timeout-to-client-api-ns-docstring</guid>
<pubDate>Thu, 24 Dec 2020 00:12:44 +0000</pubDate>
</item>
<item>
<title>Datomic Client API equivalent to on-prem tx-&gt;t, t-&gt;tx</title>
<link>https://ask.datomic.com/index.php/562/datomic-client-api-equivalent-to-on-prem-tx-t-t-tx</link>
<description>&lt;p&gt;The Datomic client API does not provider &lt;code&gt;tx-&amp;gt;t&lt;/code&gt; or &lt;code&gt;t-&amp;gt;tx&lt;/code&gt;. These functions can be useful for very specific scenarios (e.g., you have a tx id and want to know if the database has &quot;moved forward&quot;). &lt;/p&gt;
&lt;p&gt;This was also requested on &lt;a rel=&quot;nofollow&quot; href=&quot;https://forum.datomic.com/t/datomic-client-api-equivalent-to-on-prem-tx-t/851&quot;&gt;the forums&lt;/a&gt;. A workaround was provided for the user's specific case but the request is still relevant. &lt;/p&gt;
</description>
<category>Client API</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/562/datomic-client-api-equivalent-to-on-prem-tx-t-t-tx</guid>
<pubDate>Mon, 21 Dec 2020 00:25:17 +0000</pubDate>
</item>
<item>
<title>Datomic cloud client get-s3-auth-path: Unable to connect to localhost:8182</title>
<link>https://ask.datomic.com/index.php/521/datomic-cloud-client-auth-path-unable-connect-localhost-8182</link>
<description>&lt;p&gt;I could use some help debugging recent connection issues we're having with&lt;br&gt;
a Datomic cloud solo topology. We were working to add analytics support so enabled it in Cloud&lt;br&gt;
Formation, added and synced a config directory and adjusted our internal AWS&lt;br&gt;
subaccounts to access via IAM roles.&lt;/p&gt;
&lt;p&gt;After this we're unable to establish a connection through the client even though&lt;br&gt;
it seems like all of the parts are working and wired up. I tried some&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://clojurians-log.clojureverse.org/datomic/2020-07-01&quot;&gt;debugging by Google&lt;/a&gt; &lt;br&gt;
and tried the suggestions of restarting the worker and gateway nodes but&lt;br&gt;
unfortunately that didn't help.&lt;/p&gt;
&lt;p&gt;If anyone could provide pointers to what to poke or try next to re-establish&lt;br&gt;
authentication. it would be much appreciated.&lt;/p&gt;
&lt;p&gt;Now all the details, first we successfully connect to the access Gateway:&lt;br&gt;
&lt;code&gt;`&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ datomic client access -r us-east-2 datomic-solo
OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n  7 Dec 2017
[...]
debug1: Authentication succeeded (publickey).
Authenticated to 18.216.250.130 ([18.216.250.130]:22).
debug1: Local connections to LOCALHOST:8182 forwarded to remote address socks:0
debug1: Local forwarding listening on ::1 port 8182.
debug1: channel 0: new [port listener]
debug1: Local forwarding listening on 127.0.0.1 port 8182.
debug1: channel 1: new [port listener]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: exec
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;`&lt;/code&gt;&lt;br&gt;
The gateway connection seems to work:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ curl -x socks5h://localhost:8182
http://entry.datomic-solo.us-east-2.datomic.net:8182/
{:s3-auth-path &quot;datomic-solo-storagef7f305e7-wutene4nee-s3datomic-ci7fce3hk2gj&quot;}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But when trying to connect in Clojure (&lt;code&gt;(d/client cfg)&lt;/code&gt;), it times out:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Execution error (ExceptionInfo) at datomic.client.impl.cloud/get-s3-auth-path (cloud.clj:179).
Unable to connect to localhost:8182

ginkgo.metadata.core=&amp;gt; *e
#error {
 :cause &quot;Unable to connect to localhost:8182&quot;
 :data {:cognitect.anomalies/category :cognitect.anomalies/unavailable, :cognitect.anomalies/message &quot;Total timeout 60000 ms elapsed&quot;, :config {:server-type :cloud, :region &quot;us-east-2&quot;, :system &quot;datomic-solo&quot;, :endpoint &quot;http://entry.datomic-solo.us-east-2.datomic.net:8182&quot;, :proxy-port 8182, :endpoint-map {:headers {&quot;host&quot; &quot;entry.datomic-solo.us-east-2.datomic.net:8182&quot;}, :scheme &quot;http&quot;, :server-name &quot;entry.datomic-solo.us-east-2.datomic.net&quot;, :server-port 8182}}}
 :via
 [{:type java.lang.RuntimeException
   :message &quot;could not start [#'ginkgo.metadata.ferment/conn] due to&quot;
   :at [mount.core$up$fn__247 invoke &quot;core.cljc&quot; 94]}
  {:type clojure.lang.ExceptionInfo
   :message &quot;Unable to connect to localhost:8182&quot;
   :data {:cognitect.anomalies/category :cognitect.anomalies/unavailable, :cognitect.anomalies/message &quot;Total timeout 60000 ms elapsed&quot;, :config {:server-type :cloud, :region &quot;us-east-2&quot;, :system &quot;datomic-solo&quot;, :endpoint &quot;http://entry.datomic-solo.us-east-2.datomic.net:8182&quot;, :proxy-port 8182, :endpoint-map {:headers {&quot;host&quot; &quot;entry.datomic-solo.us-east-2.datomic.net:8182&quot;}, :scheme &quot;http&quot;, :server-name &quot;entry.datomic-solo.us-east-2.datomic.net&quot;, :server-port 8182}}}
   :at [datomic.client.impl.cloud$get_s3_auth_path invokeStatic &quot;cloud.clj&quot; 179]}]
 :trace
 [[datomic.client.impl.cloud$get_s3_auth_path invokeStatic &quot;cloud.clj&quot; 179]
  [datomic.client.impl.cloud$get_s3_auth_path invoke &quot;cloud.clj&quot; 170]
  [datomic.client.impl.cloud$create_client invokeStatic &quot;cloud.clj&quot; 211]
  [datomic.client.impl.cloud$create_client invoke &quot;cloud.clj&quot; 194]
```
On the access client side it seems to connect and forward okay:
```
debug1: Connection to port 8182 forwarding to socks port 0 requested.
debug1: channel 2: new [dynamic-tcpip]
debug1: channel 2: free: direct-tcpip: listening port 8182 for
entry.datomic-solo.us-east-2.datomic.net port 8182, connect from 127.0.0.1 port
59870 to 127.0.0.1 port 8182, nchannels 3
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is where I'm a bit stuck and not sure where to debug next. Does anyone have&lt;br&gt;
suggestions for what to poke or try next? Thanks much.&lt;/p&gt;
</description>
<category>Cloud</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/521/datomic-cloud-client-auth-path-unable-connect-localhost-8182</guid>
<pubDate>Thu, 19 Nov 2020 18:55:38 +0000</pubDate>
</item>
<item>
<title>Usage of datomic client API's with in order to simulate facts without asserting.</title>
<link>https://ask.datomic.com/index.php/499/usage-datomic-client-order-simulate-facts-without-asserting</link>
<description>&lt;p&gt;Hello Clojurians,&lt;/p&gt;
&lt;p&gt;According to Datomic client API the (with db tx-data) allows to make queries on a database with additionnal facts without asserting them.  Afaik, it's also known as &quot;what-if&quot; query.&lt;/p&gt;
&lt;p&gt;The docs says that the tx-data should be exactly the sam as in a transact.&lt;/p&gt;
&lt;p&gt;But on my machine, this works:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(d/transact conn {:tx-data [{:token/color :blue}]})        
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But this doesn't:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(d/q '[:find (count ?e1)                             
       :in $                                                                                                                                         
       :where [?e1 :token/color :grey]]                                                                                                 
     (d/with (d/db conn) {:tx-data [{:token/color :grey}]})) 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With this error:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  Show: Project-Only All                                                                                                                                                                                             
  Hide: Clojure Java REPL Tooling Duplicates  (11 frames hidden)                                                                                                                                                     
                                                                                                                                                                                                                     
1. Unhandled clojure.lang.ExceptionInfo                                                                                                                                                                              
   Datomic Client Exception                                                                                                                                                                                          
   {:cognitect.anomalies/category :cognitect.anomalies/incorrect,                                                                                                                                                    
    :http-result                                                                                                                                                                                                     
    {:status 400,                                                                                                                                                                                                    
     :headers                                                                                                                                                                                                        
     {&quot;server&quot; &quot;Jetty(9.4.27.v20200227)&quot;,                                                                                                                                                                            
      &quot;content-length&quot; &quot;247&quot;,                                                                                                                                                                                        
      &quot;date&quot; &quot;Sun, 01 Nov 2020 16:13:07 GMT&quot;,                                                                                                                                                                        
      &quot;content-type&quot; &quot;application/transit+msgpack&quot;},                                                                                                                                                                 
     :body nil}}                                                                                                                                                                                                     
                 async.clj:   58  datomic.client.api.async/ares                                                                                                                                                      
                 async.clj:   54  datomic.client.api.async/ares                                                                                                                                                      
                  sync.clj:  120  datomic.client.api.sync/eval27181/fn                                                                                                                                               
             protocols.clj:  126  datomic.client.api.protocols/fn/G                                                                                                                                                  
                   api.clj:  363  datomic.client.api/with                                                                                                                                                            
                   api.clj:  353  datomic.client.api/with                                                                                                                                                            
                      REPL:  275  four.core/eval28597                                                                                                                                                                
                  core.clj: 3214  clojure.core/eval                                                                                                                                                                  
                  core.clj: 3210  clojure.core/eval                                                                                                                                                                  
                  main.clj:  437  clojure.main/repl/read-eval-print/fn                                                                                                                                               
                  main.clj:  458  clojure.main/repl/fn                                                                                                                                                               
                  main.clj:  368  clojure.main/repl                                                                                                                                                                  
               RestFn.java: 1523  clojure.lang.RestFn/invoke                                                                                                                                                         
                  AFn.java:   22  clojure.lang.AFn/run                                                                                                                                                               
                  AFn.java:   22  clojure.lang.AFn/run                                                                                                                                                               
               Thread.java:  844  java.lang.Thread/run                                                                                                                                                               
     
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Any clue ?&lt;/p&gt;
</description>
<category>Client API</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/499/usage-datomic-client-order-simulate-facts-without-asserting</guid>
<pubDate>Sun, 01 Nov 2020 16:48:56 +0000</pubDate>
</item>
<item>
<title>`gcDeletedDBs` available in peer API</title>
<link>https://ask.datomic.com/index.php/471/gcdeleteddbs-available-in-peer-api</link>
<description>&lt;p&gt;It would be very helpful to be able to call &lt;code&gt;gcDeletedDBs&lt;/code&gt; programmatically from the API.  Providing the felxibility of passing in a Datasource. Allows users to get GC capabilities in the app.&lt;/p&gt;
</description>
<category>Peer API</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/471/gcdeleteddbs-available-in-peer-api</guid>
<pubDate>Sun, 25 Oct 2020 19:36:18 +0000</pubDate>
</item>
<item>
<title>Store values encrypted, allowing key rotation.</title>
<link>https://ask.datomic.com/index.php/464/store-values-encrypted-allowing-key-rotation</link>
<description>&lt;p&gt;In our application we have a requirement to store certain fields encrypted. This encryption is done in the application. However, we would like to be able to rotate the encryption key should it become compromised, and retain the historical query features that you would get with unencrypted storage. In order to rotate the key, we have to excise the data and re-transact it with the new key, or store the encrypted values outside of Datomic. It would be nice to have an encryption API that enabled this use case.&lt;/p&gt;
</description>
<category>Datomic</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/464/store-values-encrypted-allowing-key-rotation</guid>
<pubDate>Sun, 25 Oct 2020 19:14:02 +0000</pubDate>
</item>
<item>
<title>Ability to limit the number of results from query</title>
<link>https://ask.datomic.com/index.php/446/ability-to-limit-the-number-of-results-from-query</link>
<description>&lt;p&gt;Currently there is no built in way to limit the results from a query. This puts the task on the user to limit the results by first querying for entity ids, limiting that number and then pulling the data.&lt;/p&gt;
</description>
<category>Datomic</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/446/ability-to-limit-the-number-of-results-from-query</guid>
<pubDate>Thu, 22 Oct 2020 17:42:57 +0000</pubDate>
</item>
<item>
<title>Client library for Python</title>
<link>https://ask.datomic.com/index.php/425/client-library-for-python</link>
<description>&lt;p&gt;Provide client implementation in Python&lt;/p&gt;
</description>
<category>Client API</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/425/client-library-for-python</guid>
<pubDate>Thu, 22 Oct 2020 16:45:51 +0000</pubDate>
</item>
<item>
<title>Client API: tx-report-queue equivalent</title>
<link>https://ask.datomic.com/index.php/424/client-api-tx-report-queue-equivalent</link>
<description>&lt;p&gt;One of the features I miss a lot in the client API is TX report queues. Would it be possible to add something like this to the client? Perhaps tx-range could get an option that, when no :end is given, keeps the channel open and waits for future transactions?&lt;/p&gt;
</description>
<category>Client API</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/424/client-api-tx-report-queue-equivalent</guid>
<pubDate>Thu, 22 Oct 2020 16:25:01 +0000</pubDate>
</item>
<item>
<title>Query explain for datalog</title>
<link>https://ask.datomic.com/index.php/447/query-explain-for-datalog</link>
<description>One of the places that we struggle with the most is understanding query performance. In general we get the idea that in order to write a fast query you need to reduce the search space as quickly as possible. As a result the most specific datalog clause should go first. However, we have found cases when that is not always true. For example when an attribute is a reference or when an attribute is indexed. Since we have little insight into how the query planner works its hard for us to tell what will make a query fast. We can and do optimize our queries by hand. But as our system grows and we add more queries this hand optimization becomes more burdensome. It would be great to have a tool, similar to a sql explain, that would give us the fastest ordering of the datalog clauses and provide suggestions for adding indexes.</description>
<category>Datomic</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/447/query-explain-for-datalog</guid>
<pubDate>Thu, 22 Oct 2020 16:24:23 +0000</pubDate>
</item>
<item>
<title>Sorting and Pagination for Datomic Query results</title>
<link>https://ask.datomic.com/index.php/448/sorting-and-pagination-for-datomic-query-results</link>
<description>&lt;p&gt;Provide sorting and pagination for query results in the client and peer api's query.&lt;/p&gt;
</description>
<category>Datomic</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/448/sorting-and-pagination-for-datomic-query-results</guid>
<pubDate>Thu, 22 Oct 2020 16:08:51 +0000</pubDate>
</item>
<item>
<title>Expose standby/active transactor status in on-prem metrics.</title>
<link>https://ask.datomic.com/index.php/434/expose-standby-active-transactor-status-in-on-prem-metrics</link>
<description>&lt;p&gt;Provide a method through an API to allow monitoring of standby/active status of transactors in on-prem.&lt;/p&gt;
</description>
<category>On-Prem</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/434/expose-standby-active-transactor-status-in-on-prem-metrics</guid>
<pubDate>Thu, 22 Oct 2020 16:00:30 +0000</pubDate>
</item>
</channel>
</rss>