Fork me on GitHub

I’m deploying the Specter lib with my Ions. At load time I am seeing a stackoverflow in the logs. I’ll paste it below. This code loads/runs fine on my laptop using the same deps although I do see a deps override warning during push. What is the best way to debug something like this? I’m using Clojure 1.9.0 on my laptop and I presume the same on Ions/Cloud.


hi @U0510KXTU The Solo template is economized at every level, including having a smaller stack max. I have seen this happen with deep compilation, and (sigh) it can be nondeterministic. AOTing the problem library may help. The problem will definitely go away on Prod.


thanks @U072WS7PE that’s good to know. in this case it seems that a classpath issue (still undiscovered) was the real issue, which was then masked by the stackoverflow. maybe there’s greater memory consumption when classpath exceptions occur?


either way, some docs on this would be good for others since lots of folks will try ever more libs on Ions/Solo over time. I’m fully sorted now, just got my api working so stoked!


    "Msg": ":datomic.cluster-node/-main failed: java.lang.StackOverflowError, compiling:(com/rpl/specter/util_macros.clj:61:29)",
    "Ex": {
        "Cause": null,
        "Via": [
                "Type": "clojure.lang.Compiler$CompilerException",
                "Message": "java.lang.StackOverflowError, compiling:(com/rpl/specter/util_macros.clj:61:29)",
                "At": [
                "Type": "java.lang.StackOverflowError",
                "Message": null,
                "At": [


here’s the deps I’m using

org.clojure/clojure        {:mvn/version "1.9.0"}
             com.datomic/client-cloud   {:mvn/version "0.8.56"}
             com.datomic/ion            {:mvn/version "0.9.16"}
             org.clojure/data.json      {:mvn/version "0.2.6"}
             com.rpl/specter            {:mvn/version "1.1.1"}
             com.stuartsierra/component {:mvn/version "0.3.2"}
             com.taoensso/timbre        {:mvn/version "4.10.0"}


strange. I just fixed it but not sure how. I changed some of the dependencies from the push warning. I’ll follow up with more info if I can clarify


I’m now rendering a webpage through an Ion, which is awesome. Http-kit works great for developing the page locally. - A couple of questions on top of this: how can I set up API Gateway to allow rendering of /? - What’s the recommended way of serving static content? Should I set a custom domain, create S3 buckets for images, js and css? Or do I serve those directly from the Ion?


I’ve attached a domain to API Gateway. But I’m getting "Missing Authentication Token" for . works fine of course.


Alright, I seem to have figured this one out: create proxy method directly on the root / in API Gateway.


Checkout cloudfront. My app has a /html/render/* that generates the index.html Static images and js go to s3 Cloudfront do this redirect / ->> api/html/render, /static ->> s3 You can also do others rules


Oh, right! I just set up a custom domain directly in API Gateway. I’ll dismantle that and figure out Cloudfront instead. Thanks!


@U2J4FRT2T I’m having trouble figuring out how to redirect to API Gateway, while allowing to be redirected to s3. The sources I’m reading are all saying that this only can be done with subdomains. How do you go about routing / and /static respectively?


Those sources were apparently fallacious! I think I got it.


Create a distribution (on create, you need to assign it to your loadbalancer/apigateway) in this distribution, create another Origin, assign your S3 bucker. then create some Behaviors to redirect to each origin. be careful with caching. "Cache-Control" "max-age=xxx" is your friend. API call's through cloudfront bay not be a good idea. (Unless you REALLY want the caching thing) You can not do complex regexp on Behaviors.


@U2J4FRT2T Do you have to do anything special with Route 53 when associating the domain name? The domain redirects to the API Gateway <gunk>. rather than hiding it.


just alias on r53 it will probably offer you this endpoint as an option for the alias


Right. But it does a redirect, so the raw API Gateway URL ends up exposed to the user.


The path pattern for s3, should it be for example /static/*?


Yep. that simple patterns are ok. But at first, i tryied to write "anything that ends with 'dot' + 2 or 3 alphaletters" but that regexp engine dont accept that kind of pattern


I could not for the life of me get Cloudfront to alias instead of redirect, so I ripped it apart and set up S3 to be accessed through the API Gateway.


Then, just for the heck of it, I set up Cloudfront, and for some reason it’s no longer redirecting, but aliasing properly. But now API Gateway is already handling the S3 stuff.


I guess the downside is that I can’t control the caching strategy for the static assets separate to the caching strategy for API Gateway.


question about datomic client (not cloud) and peer server. when calling (first (d/tx-range conn {:start 1000 :end 1001})), i’m getting exception like this:

Datomic Client Exception
   {:cognitect.anomalies/category :cognitect.anomalies/fault,
    :datomic.client/http-result {:status nil, :headers nil, :body nil}}
The peer server log has following warning:
2018-07-24 10:32:33.112 WARN  default    datomic.cast2slf4j - {:msg "Could not marshal response", :type :alert, :tid 12, :timestamp 1532428353111, :pid 1560}
java.lang.RuntimeException: java.lang.Exception: Not supported: class clojure.lang.Delay
	at com.cognitect.transit.impl.WriterFactory$2.write( ~[transit-java-0.8.311.jar:na]
	at cognitect.transit$write.invokeStatic(transit.clj:149) ~[datomic-transactor-pro-0.9.5661.jar:na]
	at cognitect.transit$write.invoke(transit.clj:146) ~[datomic-transactor-pro-0.9.5661.jar:na]
	at cognitect.nano_impl.marshaling$transit_encode.invokeStatic(marshaling.clj:59) ~[datomic-transactor-pro-0.9.5661.jar:na]


is tx-range not supported in datomic client with peer server?


Hmm... What does this error message mean? tempid used only as value in transaction


Does it mean that I have a tempid somewhere which isn't used in as a value for db/id?


Also, is it possible to figure out which tempid it is refering to? I have a pretty big transaction 😕


I believe that means you’ve asserted an entity that has no attributes.


Probably you could filter the txn for a map that only has a :db/id key.


The problem was a typo somewhere in my code. 😛


Would've been much easier to find if the error message included which tempid caused problems though :thinking_face:

✔️ 4