This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-01-03
Channels
- # aws (27)
- # beginners (64)
- # boot (14)
- # calva (10)
- # cider (36)
- # cljs-dev (13)
- # cljsrn (79)
- # clojure (58)
- # clojure-berlin (8)
- # clojure-france (1)
- # clojure-italy (18)
- # clojure-nl (9)
- # clojure-russia (1)
- # clojure-spec (28)
- # clojure-uk (29)
- # clojurescript (55)
- # core-async (20)
- # cursive (5)
- # datomic (105)
- # emacs (17)
- # figwheel-main (13)
- # fulcro (20)
- # graphql (4)
- # hoplon (1)
- # hyperfiddle (2)
- # jobs (7)
- # jobs-discuss (110)
- # off-topic (23)
- # pathom (1)
- # perun (2)
- # re-frame (87)
- # reitit (2)
- # shadow-cljs (8)
- # spacemacs (2)
- # tools-deps (118)
- # vim (11)
@marshall this is what is contained in the CloudWatch logs:
"Error": "Fault",
"CognitectAnomaliesMessage": "java.lang.AssertionError: Assert failed: cfg, compiling:(core.clj:25:1)"
line 25 is the last line of the following block:
(defonce system "datomic")
(defonce region "us-east-1")
(defonce cfg {:server-type :ion
:region region
:system system
:creds-profile "personal"
:endpoint (format " " system region)
:proxy-port 8182})
(defonce client (d/client cfg))
tried inlining the cfg
as follows and am still getting the same error (although there is no longer a binding named cfg
):
(defonce client (d/client {:server-type :ion <== error points to this line
:region region
:system system
:creds-profile "personal"
:endpoint (format " " system region)
:proxy-port 8182}))
yep, it works locally. i just tried without the cred-profile because that is needed for local only
but i just found that the ion-starter has a :query-group specified which i am missing
yeah that’s the only real difference I can see between what you have and what my Ions code looks like
"Msg": ":datomic.cluster-node/-main failed: java.lang.AssertionError: Assert failed: cfg, compiling:(core.clj:17:1)",
"Ex": {
"Cause": "java.lang.AssertionError: Assert failed: cfg, compiling:(core.clj:17:1)",
"Via": [
{
"Type": "clojure.lang.ExceptionInfo",
"Message": "java.lang.AssertionError: Assert failed: cfg, compiling:(core.clj:17:1)",
"Data": {
"CognitectAnomaliesCategory": "CognitectAnomaliesFault",
"DatomicAnomaliesException": {
"Cause": "Assert failed: cfg",
"Via": [
{
"Type": "clojure.lang.Compiler$CompilerException",
"Message": "java.lang.AssertionError: Assert failed: cfg, compiling:(core.clj:17:1)",
"At": [
"clojure.lang.Compiler",
"load",
"Compiler.java",
7526
]
},
{
"Type": "java.lang.AssertionError",
"Message": "Assert failed: cfg",
"At": [
"datomic.client.impl.local$create_client",
"invokeStatic",
"local.clj",
97
]
}
],
"Trace": [
[
"datomic.client.impl.local$create_client",
"invokeStatic",
"local.clj",
97
],
[
"datomic.client.impl.local$create_client",
"invoke",
"local.clj",
94
],
[
"clojure.lang.Var",
"invoke",
"Var.java",
381
],
[
"datomic.client.api.impl$dynarun",
"invokeStatic",
"impl.clj",
19
],
...
{:allow [
;; lambda handlers
core/ion-func
]
:lambdas {:load-chains
{:fn core/ion-func
:description "A description."}
}
:app-name "datomic"}
{:paths ["src" "resources"]
:extra-paths ["resources"]
:deps
{clj-time {:mvn/version "0.15.0"}
com.rpl/specter {:mvn/version "1.1.2"}
aleph {:mvn/version "0.4.6"}
org.clojure/clojure {:mvn/version "1.9.0"}
com.datomic/ion {:mvn/version "0.9.28"}
com.datomic/client-cloud {:mvn/version "0.8.71"}
org.clojure/data.json {:mvn/version "0.2.6"}
com.cognitect/transit-java #:mvn{:version "0.8.311"}
com.datomic/client-api #:mvn{:version "0.8.12"}
org.msgpack/msgpack #:mvn{:version "0.6.10"},
com.cognitect/transit-clj #:mvn{:version "0.8.285"}
com.cognitect/s3-creds #:mvn{:version "0.1.22"}
com.amazonaws/aws-java-sdk-kms #:mvn{:version "1.11.349"}
com.amazonaws/aws-java-sdk-s3 #:mvn{:version "1.11.349"}}
:mvn/repos {"datomic-cloud" {:url ""}}
:aliases
{:dev {:extra-deps {com.datomic/ion-dev {:mvn/version "0.9.186"}}}}}
hm, I wonder if it could be the fact that you’re creating the client when your code is first run
in the Ions tutorial / example (which I pretty much copied), they define get-client
:
(defonce get-client
;; "This function will return a local implementation of the client
;; interface when run on a Datomic compute node. If you want to call
;; locally, fill in the correct values in the map."
(memoize #(d/client {:server-type :ion
:region "us-west-2"
:system "datomic"
:query-group "datomic"
:endpoint " "
:proxy-port 8182})))
I made it a defonce
for REPL-ing but it’s still a function, that has to be invoked when your Ion is first invokedI know there’s a bunch of spinning up and down that the Datomic system does when new code gets deployed. For example, a lot of times the first request I send after a deployment fails because it can’t connect to the database
btw, the docs at: https://docs.datomic.com/cloud/ions/ions-reference.html don't mention the need to delay
the client creation
@johanatan this page mentions the specific error you got https://docs.datomic.com/cloud/troubleshooting.html#assert-failed
it changed recently, because previously you could do this, although it wasn't recommended, but now, with the preloading of the active databases, you can't do this anymore
Oh ok. It might be a good idea to update the rest of the documentation (linked to previously) so that people don’t continue going down this path.
Hi, is there a way to pull :db/ident values (like enums). E.g. taking the tutorial example of colors and inventory items (https://docs.datomic.com/cloud/tutorial/assertion.html):
clojure
(d/pull db
{:selector [:inv/type :inv/size :inv/color]
:eid [:inv/sku "SKU-60"]})
; =>
; #:inv{:type #:db{:id 15617463160930376, :ident :shirt},
; :size #:db{:id 29304183903486023, :ident :xlarge},
; :color #:db{:id 32330039903125571, :ident :yellow}}
I would like to retrieve: #:inv{:type :shirt :size :xlarge :color :yellow}
without transforming the query result. Is this possible?Anyone know if there are plans to bring the datomic cloud find-spec up to date with the on-prem version? For example, support for . and ... to return scalars and vectors?
I have a strange issue. The following rule works fine when invoked via the REPL, but fails when invoked via a Lambda in Datomic Cloud. However, if I deploy, invoke the rule via the REPL, and then invoke it via Datomic Cloud Lambda, it will work from then on when invoked via Lambda.
Code:
[(foo ?x ?y)
[(my.namespace/foo ?x ?y) [?q ?r]]]
Initial error when invoking from Datomic Cloud:
The following forms do not name predicates or fns: (my.namespace/foo)
@dmarjenburgh: basically no, to my knowledge, though you could use [{:inv/type [:db/ident]} {:inv/size [:db/ident]}]
as your pull expression to elide the :db/id stuff out of there. One possible alternative is to just use keywords as your data types for enum values, though there are tradeoffs.
Ok, thanks
it’s not gonna work, AFAIK with pull, as they’re just regular distinct entities as far as datomic is concerned, even though we group them together ‘mentally’. We do what you’re after with regular queries. Like the following returns all of our :action/..
enums
:where
[?a :db/ident ?i] ;;finds all :db/idents
[((comp #{"action"} namespace) ?i)]
There's a bit of background on the difference between how those approaches behave here, although this is in a datomic on-prem/peer context, not a cloud/client context: http://docs.workframe.com/stillsuit/current/manual/#_stillsuit_enums
hey, I assume the answer to this question is "no, that's not a thing, you have to use a query", but is there any way to specify the combination of a key and a value as a unique identifier. so, only one user at a time (who I would like to have easy access to) will have ::role ::admin
but many users might have ::role ::moderator
. so I'd love to be able to use [::role ::admin]
as an eid.
As in a db.unique/identifier
? Well the fact that for certain values of ::role, multiple distinct entities can share the same value
are you sure you only ever want one admin role? I don’t know your use case but almost everywhere I look that has a role-based permission system has the capability to add more than one administrator
Honestly role is the wrong semantics to signal. We have a smart contract that ensures the existence of one and only one admin.
Technically there is one admin and one 'owner' where the only thing the owner can do is assign a new admin
sounds like the best way would be to use a bool value then IME. ::admin true
::owner true
Oh ok. It might be a good idea to update the rest of the documentation (linked to previously) so that people don’t continue going down this path.
hi, is there an env var i can check the presence for to determine if my ion is running in the cloud or locally?
i ended up going with:
(clojure.core/string? (System/getenv "AWS_LAMBDA_FUNCTION_NAME"))
(which should work fine)i am getting an error when trying to query my solo datomic instance while a process is inserting data in the bkg:
1. Unhandled clojure.lang.ExceptionInfo
Datomic Client Exception
{:cognitect.anomalies/category :cognitect.anomalies/busy,
:http-result
{:status 429,
:headers
{"content-length" "9",
"server" "Jetty(9.3.7.v20160115)",
"date" "Thu, 03 Jan 2019 20:44:43 GMT",
"content-type" "text/plain"},
:body nil}}
is this because my solo server can't handle the load I'm trying to place on it?https://docs.datomic.com/cloud/troubleshooting.html#busy @johanatan You should either retry or potentially, yes, move up to production
fyi.. i did a simple distribution of my load (~20 reqs spaced 250 ms apart) and it fixed my "busy" issue:
(defn- distribute-load [funcs stagger]
(map-indexed (fn [idx itm] (mt/in (* idx stagger) itm)) funcs))
anyone know what's going on with this?
13:49 $ clojure -A:dev -m datomic.ion.dev '{:op :push :creds-profile "personal"}'
{:command-failed "{:op :push :creds-profile \"personal\"}",
:causes
({:message
"Bad Request (Service: Amazon S3; Status Code: 400; Error Code: 400 Bad Request; Request ID: 98AED4A6FE429CBB; S3 Extended Request ID: LsWqYlVK8gDQAwmUPwh32CFjQp6B2UCos0IDDnNGzwnxokfkPJkeJLrw4wiurwi517UY42Rho8g=)",
:class AmazonS3Exception})}
@johanatan try explicitly adding :region
looks good to me:
{:allow [
;; lambda handlers
core/load-chains
core/volatility-skews
]
:lambdas {:load-chains
{:fn core/load-chains
:description "Loads latest option chain data from td ameritrade into datomic."
:timeout-secs 900}
:volatility-skews
{:fn core/volatility-skews
:description "Returns any current volatility skew opportunities."
:timeout-secs 60}
}
:app-name "datomic"}
not sure what else could be responsible if your creds profile file is correct and all
you can submit an AWS support ticket with the Request ID and the extended request ID and they might be able to tell you what the actual error cause was
this works so the creds seem valid:
14:37 $ aws s3 --profile personal ls
2018-12-28 13:07:14 datomic-code-2025dbc4-e342-4b10-99d8-24ce8346fec1
2018-12-28 13:03:05 datomic-storagef7f305e7-ulwi6f7m5ipi-s3datomic-1xpzc6j152563
2017-05-02 19:20:12 numerai-data
are there additional diagnostic steps I can take? I’m not sure if I can call AWS support as this is just a personal playground account
If I'm not wrong, you are entitled to cognitect support: https://support.cognitect.com/hc/en-us/requests/new
ah solo doesn't have standard support https://www.datomic.com/pricing.html