Fork me on GitHub
#datomic
<
2018-09-04
>
lilactown00:09:01

I have a lambda ion type, and one thing I’ve noticed is that my ion will continuously execute if it does not respond with a value (e.g. an error occurs, or I return nil)

stuarthalloway00:09:58

hi @U4YGF4NGM what do you mean by "continuously execute"?

lilactown00:09:22

my ion seems to be called over and over again

lilactown00:09:09

I’m actually now not sure if it’s the fact that I have it connected to SQS; it might be that it’s putting it back in the queue when the lambda doesn’t return a success

lilactown00:09:47

I don’t see any messages in the queue as it’s happening, but that might not be accurate I guess?

stuarthalloway01:09:10

I would guess that the over-and-over is an AWS retry

stuarthalloway01:09:41

you might prove that by invoking it from the CLI or UI instead

stuarthalloway01:09:34

... but if if in the end you think that the ion plumbing is behaving badly, let us know!

lilactown01:09:59

thanks for that. It’s not happening when I invoke the lambda from the UI. so I’m 97% sure it’s SQS retrying. Ion plumbing seems fine 👍

lilactown00:09:09

is there a way to control this behavior?

Twan06:09:44

If I'd save an emoji in an entity, I get ? on retrieving that value. It does not happen when running the database in memory, only when doing it on Postgres. Do you have a suggestion what could cause this?

jaret02:09:05

How are you storing the emoji’s? (what data/type-- unicode strings?) What is the schema for the emoji? How are you querying?

lambdam10:09:26

Hello. Does someone know if it is possible to alias the namespace part of a namespaced keyword. In other words (or codes), from this

(ns foo.bar.baz
  (:require [clojure.spec.alpha :as s]))

(s/def :company.sub-category.sub-sub-cateory/field-a keyword?)
(s/def :company.sub-category.sub-sub-cateory/field-b string?)
(s/def :company.sub-category.sub-sub-cateory/field-c integer?)
to something like this
(ns foo.bar.baz
  (:require [clojure.spec.alpha :as s]))

(kwd-alias 'css 'company.sub-category.sub-sub-cateory)

(s/def ::css/field-a keyword?)
(s/def ::css/field-b string?)
(s/def ::css/field-c integer?)
or even
(ns foo.bar.baz
  (:require [clojure.spec.alpha :as s]))

(with-kwd-alias ['css 'company.sub-category.sub-sub-cateory]
  (s/def ::css/field-a keyword?)
  (s/def ::css/field-b string?)
  (s/def ::css/field-c integer?))
The regular alias function doesn't work since the company.sub-category.sub-sub-cateory namespace doesn't exist in the code.

stijn10:09:58

(ns foo.bar.baz
  (:require [clojure.spec.alpha :as s]
            [company.sub-category.sub-sub-cateory :as css]))

(s/def ::css/field-a keyword?)
(s/def ::css/field-b string?)
(s/def ::css/field-c integer?)

lambdam10:09:05

It throws

1. Unhandled java.io.FileNotFoundException
   Could not locate company__init.class or company.clj on classpath.
The company.sub-category.sub-sub-category (example here) exists in Datomic, not in my code.

Alex Miller (Clojure team)10:09:55

You can’t alias a namespace that doesn’t exist in loadable form. You can use create-ns to fake that before you alias it though

lambdam13:09:42

Thanks @alexmiller 1. Is it idiomatic? 2. Do you think that with create-ns it is possible to do it in a scoped way, like in the (with-kwd-alias ['foo 'bar] & forms) example, or a side effect on the global environment is inevitable (I took a quick look at the source)?

Alex Miller (Clojure team)15:09:04

Rich has some stuff in mind for managing keyword aliases - future work

favila14:09:52

It's not "idiomatic" if by that you just mean "common"

favila14:09:57

you can unmap aliases with ns-unalias, so it seems like scoping is possible. (Not sure of the caveats there.)

favila14:09:51

also none of this is possible for CLJS because it doesn't have create-ns (or real namespaces)

Ben Hammond14:09:03

I am trying to connect to a datomic where both the Postgres storage and transactor are inside an AWS private network. I am outside that network I have ssh tunnels set up into the Bastion for port 5432, forwarding to Postgres storage and 4334, forwarding to the transactor I have /etc/hosts configured to point the postgres machine name at 127.0.0.1 and point the transactor machine name at 127.0.0.1 and yet when I attempt to connect locally I see the error

`org.apache.activemq.artemis.api.core.ActiveMQSecurityException: AMQ119031: Unable to validate user
                                    clojure.lang.ExceptionInfo: Error communicating with HOST ip-10-0-1-228.eu-central-1.compute.internal on PORT 4334
                       clojure.lang.Compiler$CompilerException: clojure.lang.ExceptionInfo: Error communicating with HOST ip-10-0-1-228.eu-central-1.compute.internal on PORT 4334 {:alt-host nil, :peer-version 2, :password "<<excised>>", :username "SE3P59I1dDLm/A6MH5zKpJqluSf1qOae3LrPKPVMfwc=", :port 4334, :host "ip-10-0-1-228.eu-central-1.compute.internal", :version "0.9.5561.50", :timestamp 1536071491707, :encrypt-channel true}, compiling:(NO_SOURCE_FILE:1:9)

Ben Hammond14:09:55

I can connect a Socket to that address/port though

(bean (Socket. "ip-10-0-1-228.eu-central-1.compute.internal" 4334))
=>
{:closed false,
 :localAddress #object[java.net.Inet4Address 0x4997a018 "/127.0.0.1"],
 :remoteSocketAddress #object[java.net.InetSocketAddress
                              0x48aade08
                              "ip-10-0-1-228.eu-central-1.compute.internal/127.0.0.1:4334"],

Ben Hammond14:09:17

so I am at a loss as to what else I need to do

favila14:09:06

could it just be a bad password?

Ben Hammond14:09:26

well I have specifically cut thata out of the post

Ben Hammond14:09:43

its just a randomly generated string as far as I can see

favila14:09:55

"unable to validate user" part is strange

Ben Hammond14:09:58

have no clue as to whether its good or bad ...

favila14:09:13

that's transactor communication

favila14:09:20

so it reached storage

Ben Hammond14:09:38

yes, postgres comms never seem to be the problem

Ben Hammond14:09:09

I can watch the log on the transactor process

Ben Hammond14:09:20

that contains username/passwords

favila14:09:37

I've done this kind of forwarding too (both storage and txor over ssh tunnels with etc/hosts tricks) and never had this problem; I don't know how to proceed

Ben Hammond14:09:47

i can see a

Sep 04 14:40:07 transactor_i-0150df410b59045b6 datomicTransactor[1755]: {:event :transactor/remote-ips, :ips #{"10.0.2.55" "10.0.101.200" "10.0.1.115"}, :pid 1755, :tid 35}
pop up on the txtor

Ben Hammond14:09:17

that's when I achieve a connection from within the private network

Ben Hammond14:09:42

as the 10.0.2.55 address

Ben Hammond15:09:37

oh I was running a dev transactor locally, which was already squatting on TCP port 4334

Ben Hammond15:09:49

Its working now. Thanks for your help

lambdam15:09:31

Thanks @favila, that's exactly the point.

jdkealy17:09:57

Hi, I'm very confused about memcache. This would indicate that my memcache is not being used at all right?

jdkealy17:09:34

i get these warnings in my datomic logs

2018-09-03 02:17:34.381 WARN  default    n.spy.memcached.MemcachedConnection - Could not redistribute to another node, retrying primary node for 5b8c95a3-691a-436b-a048-3f85e3546bbe.
2018-09-03 02:17:34.392 WARN  default    n.spy.memcached.MemcachedConnection - Could not redistribute to another node, retrying primary node for 5b8c99be-dc0a-41c1-b4f0-d273a6aa0e14.