Fork me on GitHub
#datomic
<
2018-09-07
>
kenny15:09:28

Is it safe to always set the :server-type to :ion?

kenny16:09:59

i.e. if your app is deployed remotely, the :ion :server-type would connect as a client, and if your app is deployed as an ion, it would use the in-memory client.

stuarthalloway16:09:07

@kenny that understanding is correct. The only reason :ion is even a separate thing is the (very) unusual case where you might have one Datomic app be a client to others

lilactown16:09:14

is there anything wrong with calling datomic.client.api/connect multiple times?

stuarthalloway16:09:15

@U4YGF4NGM connect roundtrips with a server when remote, but that isn't right or wrong without context

lilactown16:09:57

I think I asked the wrong question. I’m trying to work around an issue I’m having where if my REPL loads a ns at startup that calls datomic.client.api/client, the REPL hangs

lilactown16:09:20

if I defer running the client function until I have a REPL, it loads just fine

lilactown16:09:44

I copied the get-client and ensure-dataset functions from the starter repo and was running those in a top-level (def client (get-client)), but I’m moving them into the functions that need them now to avoid hanging my REPL

lilactown16:09:31

also I can see it connect successfully in my socks proxy terminal, though it also doesn’t error out if it can’t connect

kenny16:09:43

I have a development k8s cluster deployed in an existing VPC. Because VPC endpoints are only supported in a production tolopology, is my only option for running tests on my k8s cluster that use Datomic to have a production topology system deployed? Seems like an expensive way to run tests when I don't have any HA requirements for tests.

stuarthalloway20:09:19

@kenny can you test through the socks proxy & bastion to a solo node?

stuarthalloway20:09:36

Some of our tests work that way.

kenny20:09:00

Perhaps. Do you run the socks proxy in the background?

stuarthalloway22:09:10

some of our test suites launch the socks proxy from the CLI

kenny22:09:41

That is a blocking script - you'd have to run it in the background somehow. You'd also want to ensure that the socks proxy script connects prior to your tests running.

sparkofreason23:09:38

Barring a local option, which could be run as a test jig or containerized, VPC peering to the solo topology would be very helpful.

stuarthalloway13:09:42

@kenny both points true, we have craptaculous CLI automation for that stuff

kenny17:09:31

@U072WS7PE Those tools are expensive to develop, especially on a small team. We need to focus on product development, not tools to work with our database. If a database requires a craptaculous amount of CLI automation to use it in common use cases, it should provide that automation to its users.

👍 1
linus_gv18:09:14

We’ve discovered that any call to a user function in a not-join will cause something to be recompiled every time we invoke the query. We know because criterium doesn’t converge. Is this expected?

linus_gv18:09:24

(`not` works fine.)

kenny18:09:22

Do you need to remove :proxy-port from the client arg-map in production?

stijn19:09:41

@kenny: I think the proxy-port should only be there if you connect through the socks proxy. we don't have that parameter in our solo deployments either, only for local dev

kenny19:09:30

I have :proxy-port set in my config and I'm getting Connection refused, not the SOCKS4 tunnel failed message.

kenny19:09:43

Removing :proxy-port fixed it. I suggest adding that to the docs.

kenny19:09:25

Deploying an ion is failing at the ValidateService step. The Log Trail in CodeDeploy has a bunch of [stdout]Received 503.

lilactown19:09:25

@kenny check your cloudwatch logs

kenny19:09:48

Are there docs on what to look for? There's a lot of stuff in there.

kenny19:09:57

There are a bunch of these under the Alerts search.

kenny20:09:33

Turns out my datomic config was not correct causing the those misleading alerts. It'd be much more obvious if the regular anomaly was thrown saying it cannot connect.

eoliphant20:09:28

You guys are the best lol

kenny20:09:04

If my Ion returns a 500 and there are no Exceptions in the log, where else should I look?

kenny23:09:08

If I run my Ion via the API Gateway, I receive this in the logs:

Fri Sep 07 23:08:30 UTC 2018 : Endpoint response body before transformations: {"headers":{"Content-Type":"application\/transit+json","Set-Cookie":["ring-session=a8d0bf20-fe5b-4a3a-9d4d-9299003ce1dd;Path=\/;HttpOnly"]},"statusCode":200,"body":"WyJeICJd","isBase64Encoded":true}
Fri Sep 07 23:08:30 UTC 2018 : Endpoint response headers: {Date=Fri, 07 Sep 2018 23:08:30 GMT, Content-Type=application/json, Content-Length=198, Connection=keep-alive, x-amzn-RequestId=ef88cd93-b2f2-11e8-8a46-7fe9b475b814, x-amzn-Remapped-Content-Length=0, X-Amz-Executed-Version=$LATEST, X-Amzn-Trace-Id=root=1-5b9304ee-cb4b86778c5717156acdceed;sampled=0}
Fri Sep 07 23:08:30 UTC 2018 : Execution failed due to configuration error: Malformed Lambda proxy response
Fri Sep 07 23:08:30 UTC 2018 : Method completed with status: 502

kenny23:09:30

It may be the headers. I'm just using the regular Ring cookies middleware.

kenny23:09:53

That must be it. The web docs say :headers is a map string->string https://docs.datomic.com/cloud/ions/ions-reference.html#web-code which does not adhere to the Ring Spec for responses https://github.com/ring-clojure/ring/blob/master/SPEC#L117-L122 😞

kenny23:09:42

Looks like others have ran into this too: https://github.com/ring-clojure/ring/issues/338