This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-02
Channels
- # aleph (14)
- # boot (4)
- # cider (3)
- # clara (1)
- # cljs-dev (62)
- # cljsrn (20)
- # clojure (81)
- # clojure-berlin (2)
- # clojure-russia (76)
- # clojure-spec (35)
- # clojure-turkiye (1)
- # clojurescript (84)
- # cursive (2)
- # data-science (6)
- # datomic (4)
- # hoplon (92)
- # lumo (35)
- # om-next (1)
- # pedestal (2)
- # re-frame (2)
- # reagent (36)
- # ring-swagger (10)
- # unrepl (30)
- # untangled (124)
@petr Sounds like an ipv6 issue. What OS are you running on, try adding -Djava.net.preferIPv4Stack=true to your JAVA_OPTS
Is there an obvious way to write the following without repeating x
? (if (some-pred? x) y x)
Hi, guys when i am tring to deploy library to clojurejars i get “gpg: signing failed: Inappropriate ioctl for device “. I generated key, published it and i added it’s id to ~/.lein/profiles.clj What can be a root of problem?
The solution is to add this line to .bash_profile export GPG_TTY=$(tty)
@mbertheau maybe look at cond-> ?
@val_waeselynck You'd have to repeat x
just the same
this gives me a list of the names of all the interesting nodes in my XML:
(xml-> zipped :parameters :parameter (attr :name))
this works for me since I know how many :parameter
nodes I have and I know they all have :name
these work similarily:
(xml-> zipped :parameters :parameter :description text)
(xml-> zipped :parameters :parameter :default text)
(xml-> zipped :parameters :parameter :options :option text)
I get a list of descriptions, default values or options…
however! not all my paramater nodes have a :`description`, :default
or :options
sub tag.
So the lists don’t have the same ordering as the :name attr
we pulled out earlier…
Is there a simple way to pull out these values for each parameter? with say nil
returned if it’s not present?
@triss Perhaps something like:
(for [p (xml-> (z/xml-zip xml) :parameters :parameter), :let [z (z/xml-zip p)]]
{:description (xml-> z :description text)
:default (xml-> z :default text)
:options (xml-> z :options :option text)})
Or alternatively:
(defn parse-parameter [z]
[{:description (xml-> z :description text)
:default (xml-> z :default text)
:options (xml-> z :options :option text)}])
(xml-> zipped :parameters :parameter parse-parameter)
@jgeraert It’s actually a docker container I use for my dev environment. I have set that environment variable to no avail. Have you had this issue?
petr: I'm not sure about docker, i only recall that that specific exception was related to ipv6 on a non-clojure project.
@petr is it something that happens to leiningen regardless of the project code? is it a specific network operation in the code that is getting that error?
@noisesmith It seems to only happen when running on my docker-container. The repl is being started with this function:
(defn start-repl-server []
(loop [port (get-repl-server-port)]
(if-let [server (try (nrepl-server/start-server :port port
:handler cider-nrepl/cider-nrepl-handler)
(catch java.net.BindException _ nil))]
(reset! repl-server server)
(recur (inc port)))))
If I start it using lein repl
it starts fine just fine (please excuse the indentation, slack appears to have messed it up)
what I'm asking is that if it's only with your project in the container that lein gets the error, or if other projects give a similar error
there's two likely failure points here, one internal to leiningen, the other specific to your project...
another thing you could test is whether an uberjar of your project, run without leiningen gets this error
@noisesmith it is the only project I’ve experienced with this error. But I don’t usually do things this way. (with starting the repl in that way)
do you need to whitelist the ports your process in the container can use?
@noisesmith I do, and I have whitelisted those ports
how does (get-repl-server-port)
pick a port?
it might be worth trying to just listen to the port it should be listening on using nc
eg nc -l 8888
should listen on port 8888 and wait for one connection and print whatever gets sent to it
It picks it from an environment variable:
(defn- get-repl-server-port []
(let [repl-port-string (get env :repl-server-port "7888")
maybeNumber (clojure.edn/read-string repl-port-string)]
(if (number? maybeNumber)
maybeNumber
(do
(log/warn "Unable to parse port number for REPL_SERVER_PORT")
nil))))
Let’s move this to a thread, if you don’t mind? @noisesmith
I’m unable to start the server while listening to that port. The address is already in use
what I meant was to test if you could open the port with nc - that rules out another point of failure
Oh yes, the port is definitely open. The api serves traffic. The nrepl server just won’t start
I'm talking about the nrepl port not the api port, but OK
OK - that verifies it's an nrepl problem then?
is it trying to bind to localhost?
you could double check eg. that localhost is resolved in the vm
sometimes you need to add that mapping by hand
and localhost not being found would be consistent with that error
So that might actually be it, when I start the nrepl server using lein repl
, I also add lein repl :headless :host 0.0.0.0 :port 4343
you could try adding :host to the args map to start-server
Different error, not sure if it’s failing sooner: Exception in thread "main" java.lang.NumberFormatException: Invalid number: 0.0.0.0
wait, are you providing 0.0.0.0
or "0.0.0.0" because clojure will give that error for the first one
0.0.0.0 is an invalid literal in clojure, is what that means
I found this: https://github.com/clojure/tools.nrepl/blob/9eed58bed6aa01cfeb3c328adc5a12d487a5d305/CHANGELOG.md
right - just make sure :host is a String
I bet that will work
sweet!
Thanks for that @noisesmith
np - glad I could help
Thanks for that @noisesmith
btw it might be better for security to adjust /etc/hosts so that localhost is defined, rather than providing 0.0.0.0 as your host - I'm not an expert on these things though
IIRC 127.0.0.1 can be used instead of 0.0.0.0 and is safer (but if you intend to connect from outside the vm... maybe you need the 0.0.0.0 binding)
You’re right. If this were to be deployed with an nrepl server started it would certainly be a security concern
anyway, at least you know the precise parameters now and can make an informed decision
I seem to recall a recommendation to bind on 127.0.0.1 inside the vm, and use an ssh tunnel to access it from the host
but maybe that's silly.
@mpenet hello! I’m trying out https://github.com/mpenet/spandex, and I’m getting this error when take!
-ing from a scroll-chan
:
#error {
:cause Response Exception
:data #qbits.spandex.Response{:body {:error {:root_cause [{:type illegal_argument_exception, :reason Failed to parse request body}], :type illegal_argument_exception, :reason Failed to parse request body, :caused_by {:type json_parse_exception, :reason Unrecognized token 'DnF1ZXJ5VGhlbkZldGNoBQAAAAAAAAEKFlFLeXR6MDh2UTRxLVdkLVhEbXZSMFEAAAAAAAABCxZRS3l0ejA4dlE0cS1XZC1YRG12UjBRAAAAAAAAAQ0WUUt5dHowOHZRNHEtV2QtWERtdlIwUQAAAAAAAAEMFlFLeXR6MDh2UTRxLVdkLVhEbXZSMFEAAAAAAAABDhZRS3l0ejA4dlE0cS1XZC1YRG12UjBR': was expecting ('true', 'false' or 'null')