Fork me on GitHub

What’s the proper way of setting environment variables for Ions?


@henrik we had this discussion late last week. Stu implied that this question will be answered soon so, for now, we wait




In the meantime I’ll proceed with a dirty and/or unsecure hack.


same here. just go in an manually add the env vars to the lambdas


I add a ENV=XXX tag to the config, then use that to ‘root’ grabbing stuff out of the AWS param store. hacky but works, looking forward to thenative solution

👍 4

has anyone experienced this when creating a datomic cloud client?

(d/client (get-in env [:datomic :client]))
CompilerException java.lang.IllegalArgumentException: Can't define method not in interfaces: recent_db, compiling:(datomic/client/impl/shared.clj:304:1) 


i don't get the error with 0.8.46, but i do when i upgrade to 0.8.54+


This is a persistent problem for me:

java.lang.Exception: namespace 'cheshire.factory' not found, compiling:(cheshire/core.clj:1:1)
Cheshire works fine locally, but pushed to AWS (Datomic Ions), it generates an error. Why might this be?

Joe Lane13:07:41

@henrik jackson conflict possibly, look at the deps tree

Joe Lane13:07:43

clojure -Stree

Joe Lane13:07:12

Compare that list with any deps conflicts that datomic ions barks about when you push your code up.

Joe Lane13:07:44

I’ve found that I dont actually need cheshire, and that works well enough, however I understand thats not a great answer.


@lanejo01 I don’t quite get it, these are the deps listed for cheshire:

cheshire/cheshire 5.8.0
  com.fasterxml.jackson.dataformat/jackson-dataformat-cbor 2.9.0
  com.fasterxml.jackson.core/jackson-core 2.9.0
  tigris/tigris 0.1.1
  com.fasterxml.jackson.dataformat/jackson-dataformat-smile 2.9.0
They only appear for cheshire, nowhere else, including jackson.

Joe Lane15:07:10

I dont see com.datomic/client-cloud included


Whops! I might have moved that into dev deps.

Joe Lane15:07:21

Well thats a bit of a problem haha

😄 4
Joe Lane15:07:22

Also, for the dev deps, what version of com.datomic/ion-dev do you have?

Joe Lane15:07:19

Update to "0.9.175", it includes as output (when you push) a collection of dependency conflicts.


Where can I see what the most recent versions of the libs are?

Joe Lane15:07:09

Which I believe your issue is rooted in.

👍 8

Right, it’s telling me explicitly about the conflicts now, that’s nice.


It’s kind of weird that Cognitect is using outdated versions of their own libraries


@henrik we should be on 0.9.175 throughout docs and repos. May I ask where you got 0.9.160 from? so I can make sure we update that.


@jaret Oh sorry, I meant the deps. It’s telling me that in Datomic Cloud, com.cognitect/transit-clj #:mvn{:version "0.8.285" is used, while I’m relying on com.cognitect/transit-clj {:mvn/version "0.8.309"}. Or can I control which version Datomic Cloud uses?

Joe Lane16:07:12

Yeah, I ran into some issues with things like the priority-map library and the aws java sdk.


Well, good news is I got a different error now. Connection refused


Such great news 😉. Are you sourcing your AWS creds?


@jaret Thank you! 🙂 Possibly, I have no idea what that means. What would I be doing in this case?


Let me back up. When are you getting this error?


API Gateway is reporting this as I’m trying to access the web server endpoint. It was working fine as of 0.9.160 and no cheshire. The house of cards started collapsing with the introduction of cheshire, alas.


And you pushed/re-deployed after removing cheshire?


Not yet, I’m trying that just now.


@lanejo01 btw I wanted to ask if you had a link to your ion tutorial/talk.


I was going to add it to the documentation as a community example, but was only able to find your talk notes on your github.

Joe Lane16:07:18

I’ve got several (unpublished…) small projects with ions if you’re in going to start adding community examples. Do you mean a blogpost or video? Because the source code should be present.


I know we’d love to see more community examples in whatever format you have them in. Github links work as well, but I know you mentioned on twitter after your websocket IOT Ion talk that a tutorial/talk would follow.


I don’t want to put any pressure on you 🙂 Just want to make people can find the great stuff everyone is making.

Joe Lane16:07:10

haha yeah, thats on my todo list. Need a platform to host it first.

Joe Lane16:07:23

(read: yak shave)


Understood. ✂️ 🙂


Need a yak shave emoji


No dice, I’m afraid. I’ll downgrade to 0.9.160, see if that gets it up and running again.

Joe Lane16:07:27

What is giving the connection refused error?


I’m not sure. This is as reported by the “test” tool in API Gateway.


Though the List of Reprimands is smaller:

  {commons-codec/commons-codec #:mvn{:version "1.10"},
   org.slf4j/jcl-over-slf4j #:mvn{:version "1.7.14"},
   com.fasterxml.jackson.core/jackson-core #:mvn{:version "2.9.5"},
   com.cognitect/http-client #:mvn{:version "0.1.80"}, #:mvn{:version "18.0"},
   com.cognitect/s3-creds #:mvn{:version "0.1.18"},
   org.slf4j/slf4j-api #:mvn{:version "1.7.14"},
   com.amazonaws/aws-java-sdk-kms #:mvn{:version "1.11.349"},
   com.amazonaws/aws-java-sdk-s3 #:mvn{:version "1.11.349"}},}


I can't get ions to work 😕 I'm pretty certain the problem is related to my deps, but I'm unable to re-create the StackOverflow error localy after applying the deps clojure.ions warns about. 😕 (details in thread)


My deps.edn:

{:paths ["backend" "resources"]
 {org.clojure/clojure {:mvn/version "1.9.0"}
  com.datomic/ion {:mvn/version "0.9.16"}
  ring/ring-core {:mvn/version "1.7.0-RC1"}
  ring/ring-json {:mvn/version "0.4.0"}
  email-validator {:mvn/version "0.1"}
  clj-mailgun {:mvn/version "0.2.0"}
  crypto-password {:mvn/version "0.2.0"}
  danlentz/clj-uuid {:mvn/version "0.1.7"} {:mvn/version "0.3.2"}}

 :mvn/repos {"datomic-cloud" {:url ""}}

 {:dev {:extra-deps {com.datomic/client-cloud {:mvn/version "0.8.54"}
                     com.datomic/ion-dev {:mvn/version "0.9.175"}
                     ring/ring-jetty-adapter {:mvn/version "1.7.0-RC1"}
                     org.eclipse.jetty/jetty-server {:mvn/version "9.4.9.v20180320"}
                     org.eclipse.jetty/jetty-client {:mvn/version "9.4.9.v20180320"}}}
  :test {:extra-paths ["tests"]
         :extra-deps {expectations {:mvn/version "2.2.0-rc3"}}}}}


the error message:

"Msg": "IonLambdaDispatcherFailedtoStart",
    "Ex": {
        "Cause": null,
        "Via": [
                "Type": "clojure.lang.Compiler$CompilerException",
                "Message": "java.lang.StackOverflowError, compiling:(potemkin/namespaces.clj:88:34)",
                "At": [
                "Type": "java.lang.StackOverflowError",
                "Message": null,
                "At": [

Joe Lane16:07:24

Look in clojure -Stree for a dependency that requires potemkin and then remove it. See if the issue persists. That lib does some crazy stuff and I wouldn’t be surprised if its causing issues.

👍 4

I see clj-http depends on potemkin 😕


@lanejo01 Do you track ion-starter to keep up to date with the releases? Or is there a release page somewhere?


Oh man, what’s going on?

java.lang.Exception: namespace 'clj-http.headers' not found, compiling:(clj_http/core.clj:1:1)


@henrik can you try the base tutorial? That looks like you may have some basic auth in your app?


Or are you getting that error with the base tutorial and ion-starter git repo?


@jaret No, this is after moving some stuff over from another project. It includes things that talk to Google Cloud, hence cheshire and clj-http.


Are some libraries unsupported in Ions? I’m not sure I understand the patterns behind what works and not.


I ripped out the deps I added from my other project, and now it works fine. Some or all of these are the culprit(s):

buddy/buddy-sign {:mvn/version "3.0.0"}
environ {:mvn/version "1.1.0"}
org.clojure/data.json {:mvn/version "0.2.6"}
clj-http {:mvn/version "3.9.0"}
clj-time {:mvn/version "0.14.4"}


How do you guys approach testing with Datomic Cloud? I see Stu mentioned here ( that he has some "tricks" to unit test with Datomic, but I have not seen any posts about that. Our approach right now is to create a new db with a unique suffix on each test run, deleting the db after each test completes. This ensures a clean DB for each test. Is there a better approach to this? With the peer library you could simply create a new in-memory connection for each test, allowing you to use your normal DB names without a suffix. It'd be great if there was something similar for Datomic Cloud. Is there a more reasonable solution to this problem?

👍 8

we do pretty much the same thing. Moved a clj/datomic microservice into ion code, moved to client api, then just updated my test fixture that would dynamically create and tear down an in-mem db to do what you described. Pretty much just worked


it’s not blessed by Cognitect (yet) but works well for me. I can reproduce all cloud behaviours in local/mem db (at least those that I need)


I just wrote an (almost) exact version of that haha


Favorite datomic-ish ER tool besides Omnigraffle?


So, buddy-sign, unfortunately has this dep tree:

buddy/buddy-sign 3.0.0
  buddy/buddy-core 1.5.0
    org.bouncycastle/bcprov-jdk15on 1.59
    commons-codec/commons-codec 1.11
    org.bouncycastle/bcpkix-jdk15on 1.59
    cheshire/cheshire 5.8.0
      com.fasterxml.jackson.dataformat/jackson-dataformat-cbor 2.9.0
      com.fasterxml.jackson.core/jackson-core 2.9.0
      tigris/tigris 0.1.1
      com.fasterxml.jackson.dataformat/jackson-dataformat-smile 2.9.0
    net.i2p.crypto/eddsa 0.3.0
Meaning it contains cheshire, which is Forbidden.
java.lang.Exception: namespace 'cheshire.factory' not found, compiling:(cheshire/core.clj:1:1)


Is it just a fact of life that anything referencing cheshire is going to blow up when it reaches the Cloud?


can you exclude it?


I do need to sign jwt tokens. Maybe there’s another lib I can use.


i’m using cheshire as a top level dep


no probs so far


But how! Would you mind sharing your deps.edn?


sorry just saw. did the upgrade to 402 fix your problem?


Yes, it did, thank you!

Joe Lane18:07:16

The issue is due to that particular version of cheshire having a jackson dep conflict with the version of jackson-core used in datomic-cloud.


Are you on that CFT?


We updated the jackson libs in 402-8396.


You’ll want to upgrade your Datomic Cloud System to that and I think you should be fine to include Cheshire.


Ah, no, 397. That might be it!


@jaret observation: datomic-free hasn't been updated to the latest version in clojars