Fork me on GitHub
#babashka
<
2022-09-29
>
Crispin06:09:55

Today a new babashka pod is released: bbssh https://github.com/epiccastle/bbssh Was derived from the spire codebase. Refactored and improved along the way. Documented it as I went. Is just ssh and scp. Interoperates with babashka.process. Enjoy!

🎉 11
❤️ 2
Lone Ranger11:09:24

:rolling_on_the_floor_laughing: that also happens to be the AKC registered name for my Yorkie :rolling_on_the_floor_laughing: I have to abbreviate it because "Peanut Butter Cup *B*lue*B*erry *S*un*S*hine *H*ead" wouldn't fit on the pen/paper form :rolling_on_the_floor_laughing: I love it!!!!

Crispin12:09:01

BlueBerry SunShine Head could be the unofficial name of the pod

🫐 2
🌞 2
❤️ 1
🤯 1
craftybones14:09:24

Hello, have some issues here

user=> (pods/load-pod 'epiccastle/bbssh "0.1.0")
Downloading pod epiccastle/bbssh (0.1.0)
Successfully installed pod epiccastle/bbssh (0.1.0)
java.lang.Exception: Unable to resolve classname: java.lang.ref.Cleaner [at <repl>:22:3]
Am I on the wrong version of Babashka if I am on 0.9.162?

craftybones14:09:18

the version requirement was in the API docs

Crispin09:09:25

should work partially on 163 (everything but streaming support from a SshProcess to a babashka.process). The change to make that work lands in 164

respatialized14:09:37

besides #datascript and #datalevin, are there any bb-compatible datalog DBs?

weavejester16:09:11

Hey folks! Is there anything for Babashka like lein new or clj-new?

rads17:09:32

Check out neil new: https://github.com/babashka/neil It works with any deps-new template: https://github.com/seancorfield/deps-new (Sorry for the Slack spam, I don't know how to remove the previews on my phone 😅)

❤️ 1
weavejester17:09:57

Ah, I should have guessed that neil would have one.

richiardiandrea19:09:27

I there, I was wondering if the is a way to add dynamic default args in babashka.clj I see https://github.com/babashka/cli#adding-default-args but it is for static one, I know I can postprocess and that's good to do it that why, worth asking it here I guess 😄

borkdude19:09:42

How are the default args static?

richiardiandrea19:09:37

right! I was looking at the bb integration, I guess they are not if I use the cli/parse-args directly

👍 1
Sebastián Dario Wandelow22:09:33

Hi folks! a babashka newbie here I'm using bb scripts to run some queries using the postgres pod. Today i updated to version v0.10.163 using brew and now i'm having this error when i run my scripts. Did someone have a similar issue?

----- Error --------------------------------------------------------------------
Type:     javax.net.ssl.SSLHandshakeException
Message:  PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

----- Context ------------------------------------------------------------------
 7: (require '[cheshire.core :as json])
 8: (require '[babashka.fs :as fs])
 9: (import 'java.time.format.DateTimeFormatter)
10:
11: (pods/load-pod 'org.babashka/postgresql "0.1.1")
    ^--- PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
12: (pods/load-pod 'justone/tabl "0.2.0")
13:
14: (require '[pod.babashka.postgresql :as pg])
15: (require '[pod.tabl.fancy :as fancy])
16:

----- Stack trace --------------------------------------------------------------
sun.security.ssl.CertificateMessage/T13CertificateConsumer - <built-in>
babashka.pods.impl.resolver/download                       - <built-in>
babashka.pods.impl.resolver/pod-manifest                   - <built-in>
babashka.pods.impl.resolver/resolve                        - <built-in>
babashka.pods.impl/resolve-pod                             - <built-in>
babashka.pods.impl/load-pod                                - <built-in>
babashka.pods.sci/load-pod/fn--27394                       - <built-in>
babashka.pods.sci/load-pod                                 - <built-in>
clojure.core/apply                                         - <built-in>
babashka.impl.pods/load-pod                                - <built-in>

Bob B23:09:47

The gist is that the certificate offered up by the source site (github in this case) is not 'verifiable' (in the sense that its certification path doesn't roll up to a trusted certificate in substrate JVM's keystore). My experience with this is a workplace that does network traffic interception (so the traffic is signed with an internal cert, not the 'real' cert). Assuming you have a JVM keystore with the appropriate certs (which is a much longer conversation, but is fairly well-documented on SO and the like), you can instruct bb (really the substrate JVM it uses) to use that keystore by specifying the trustStore property:

; deliberately broken
>bb -Djavax.net.ssl.trustStore=nocerts "(slurp \"\")"
----- Error --------------------------------------------------------------------
Type:     javax.net.ssl.SSLHandshakeException
Message:  PKIX path building failed: ....

; with the right cert in place
>bb -Djavax.net.ssl.trustStore=withcerts "(slurp \"\")"
"{\n  \"args\": {}..."

Crispin00:09:57

It's having the cert chain verification issue as it tries to download the pod. That pod is hosted on github so it's having the problem connecting to http://github.com via https. In the worst case if you cant fix your local keystore you can download the pod and install it manually. What OS and arch are you on? You could take the pod archive from matching :artifact/url here: https://github.com/babashka/pod-registry/blob/master/manifests/org.babashka/postgresql/0.1.1/manifest.edn extract out the listed :artifact/executable from it, and store it in ~/.babashka/pods/repository/org.babashka/postgresql/0.1.1/<MACHINE>/<ARCH>/pod-babashka-postgresql and then babashka would see it as already installed and use that instead of downloading it. On my machine it's /home/crispin/.babashka/pods/repository/org.babashka/postgresql/0.1.1/linux/x86_64/pod-babashka-postgresql

lispyclouds07:09:36

Also are you running by any chance in an alpine or something similar container?

Sebastián Dario Wandelow03:10:22

I'm running in a mac of my workplace and a netskope client is installed. As Bob well guessed, this was causing the certificate problems. I just managed to disable it for a moment (it restart by itself automatically) and my script could download the postgres pod manifest. Now it's working well again. Thank you all for your help 🙂

👍 1