babashka

agorgl 2025-09-10T07:47:25.069159Z

I noticed that some script that I have works with babashka v1.12.197 but does not work with latest babashka v1.12.208 , as it throws .ssl.SSLHandshakeException: (handshake_failure) Received fatal alert: handshake failure when using the built in http client

βœ… 1
agorgl 2025-09-10T08:04:10.335609Z

I tried version bisecting it, and it seems that the issue appeared in v1.12.198 . I tried the following, downloading the versions from github: v1.12.196 -> works v1.12.197 -> works v1.12.198 -> handshake_failure random versions between v1.12.198..v1.12.208 -> handshake_failure

agorgl 2025-09-10T09:09:13.434679Z

btw, running the same poc with regular clojure works without problems

borkdude 2025-09-10T11:07:42.056449Z

define "the http client", do you mean babashka.http-client?

agorgl 2025-09-10T11:08:03.542909Z

yes

agorgl 2025-09-10T11:08:38.825509Z

the thing is i can only reproduce this with some specific internal hosts, i've been trying to find a public host that has this problem but I couldn't

agorgl 2025-09-10T11:08:58.415849Z

a simple (http/get url) reproduces the problem

agorgl 2025-09-10T11:09:28.761239Z

i really cannot understand why this worked until v1.12.197 but does not work after v1.12.198 though

borkdude 2025-09-10T11:09:45.798549Z

Please make a Github issue with a repro. Perhaps we can find what changed between 197 and 198 in terms of: β€’ GraalVM version on CI β€’ Changes in babashka.http-client Also please specify your OS in the Github issue.

borkdude 2025-09-10T11:10:18.162949Z

You can also try org.httpkit.client which is built-in. also babashka.curl

borkdude 2025-09-10T11:10:23.394209Z

to see if they have the same problem

agorgl 2025-09-10T11:10:32.000879Z

the poc is pretty simple, i just cannot find a url that reproduces this outside my work's private infrastructure

agorgl 2025-09-10T11:10:56.908219Z

yeah let me try the other clients

agorgl 2025-09-10T11:16:18.764589Z

Issue reproducible by both babashka.http-client and org.httpkit.client

agorgl 2025-09-10T11:16:34.336259Z

Using babashka.curl works

agorgl 2025-09-10T11:44:24.751839Z

Performed same test in both windows (employer's machine) and linux (in a docker container inside employer's machine) and the difference betwen 197 and 198 is reproducible in both of them, so it is not OS dependent

agorgl 2025-09-10T11:54:56.595259Z

stack trace of error if it helps somehow:

#error {
 :cause "(handshake_failure) Received fatal alert: handshake_failure"
 :via
 [{:type clojure.lang.ExceptionInfo
   :message "(handshake_failure) Received fatal alert: handshake_failure"
   :data {:type :sci/error, :line 1, :column 1, :message "(handshake_failure) Received fatal alert: handshake_failure", :sci.impl/callstack #object[clojure.lang.Volatile 0x4e8f608a {:status :ready, :val ({:line 1, :column 1, :ns #object[sci.lang.Namespace 0x4e4b285b "user"], :file "C:\\Users\\User\\Workdir\\", :sci.impl/f-meta {:arglists ([uri] [uri opts]), :doc "Convenience wrapper for `request` with method `:get`", :ns #object[sci.lang.Namespace 0x3cf0b15 "babashka.http-client"], :name get}} {:line 1, :column 1, :ns #object[sci.lang.Namespace 0x4e4b285b "user"], :file "C:\\Users\\User\\Workdir\\", :sci.impl/f-meta {:arglists ([uri] [uri opts]), :doc "Convenience wrapper for `request` with method `:get`", :ns #object[sci.lang.Namespace 0x3cf0b15 "babashka.http-client"], :name get}})}], :file "C:\\Users\\User\\Workdir\\"}
   :at [sci.impl.utils$rethrow_with_location_of_node invokeStatic "utils.cljc" 140]}
  {:type javax.net.ssl.SSLHandshakeException
   :message "(handshake_failure) Received fatal alert: handshake_failure"
   :at [jdk.internal.net.http.HttpClientImpl send "HttpClientImpl.java" 928]}
  {:type javax.net.ssl.SSLHandshakeException
   :message "(handshake_failure) Received fatal alert: handshake_failure"
   :at [sun.security.ssl.Alert createSSLException "Alert.java" 130]}]
 :trace
 [[sun.security.ssl.Alert createSSLException "Alert.java" 130]
  [sun.security.ssl.Alert createSSLException "Alert.java" 117]
  [sun.security.ssl.TransportContext fatal "TransportContext.java" 363]
  [sun.security.ssl.Alert$AlertConsumer consume "Alert.java" 287]
  [sun.security.ssl.TransportContext dispatch "TransportContext.java" 202]
  [sun.security.ssl.SSLTransport decode "SSLTransport.java" 172]
  [sun.security.ssl.SSLEngineImpl decode "SSLEngineImpl.java" 734]
  [sun.security.ssl.SSLEngineImpl readRecord "SSLEngineImpl.java" 689]
  [sun.security.ssl.SSLEngineImpl unwrap "SSLEngineImpl.java" 504]
  [sun.security.ssl.SSLEngineImpl unwrap "SSLEngineImpl.java" 480]
  [javax.net.ssl.SSLEngine unwrap "SSLEngine.java" 673]
  [jdk.internal.net.http.common.SSLFlowDelegate$Reader unwrapBuffer "SSLFlowDelegate.java" 556]
  [jdk.internal.net.http.common.SSLFlowDelegate$Reader processData "SSLFlowDelegate.java" 452]
  [jdk.internal.net.http.common.SSLFlowDelegate$Reader$ReaderDownstreamPusher run "SSLFlowDelegate.java" 283]
  [jdk.internal.net.http.common.SequentialScheduler$LockingRestartableTask run "SequentialScheduler.java" 182]
  [jdk.internal.net.http.common.SequentialScheduler$CompleteRestartableTask run "SequentialScheduler.java" 149]
  [jdk.internal.net.http.common.SequentialScheduler$SchedulableTask run "SequentialScheduler.java" 207]
  [java.util.concurrent.ThreadPoolExecutor runWorker "ThreadPoolExecutor.java" 1095]
  [java.util.concurrent.ThreadPoolExecutor$Worker run "ThreadPoolExecutor.java" 619]
  [java.lang.Thread runWith "Thread.java" 1460]
  [java.lang.Thread run "Thread.java" 1447]
  [com.oracle.svm.core.thread.PlatformThreads threadStartRoutine "PlatformThreads.java" 832]
  [com.oracle.svm.core.thread.PlatformThreads threadStartRoutine "PlatformThreads.java" 808]]}

agorgl 2025-09-10T13:25:01.932169Z

Some progress on this So I run this poc:

bb -Djavax.net.debug=all -e "(require '[babashka.http-client :as http]) (http/get \"\")"
with both v197 and v198, and collected the logs. I carefully diffed them (after removing datetimes to avoid noise etc) and I got these very interesting results:

agorgl 2025-09-10T13:25:22.177629Z

diff between log output using: -Djavax.net.debug=all

-javax.net.ssl|DEBUG|HttpClient-1-Worker-0|<datetime> UTC|ClientHello.java:640|Produced ClientHello handshake message (
+javax.net.ssl|DEBUG|HttpClient-1-Worker-0|<datetime> UTC|ClientHello.java:638|Produced ClientHello handshake message (
 "ClientHello": {
   "client version"      : "TLSv1.2",
-  "random"              : "C02680E18468257EE8E4B16446E4D5C8C98300D339F4B556975C768D213BCE23",
-  "session id"          : "D664A8DDE4770782CC330B080B8DBF0EBB8E2E578116BA4CF3CE3F2E7EBC1DEF",
-  "cipher suites"       : "[TLS_AES_256_GCM_SHA384(0x1302), TLS_AES_128_GCM_SHA256(0x1301), TLS_CHACHA20_POLY1305_SHA256(0x1303), TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384(0xC02C), TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256(0xC02B), TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256(0xCCA9), TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384(0xC030), TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256(0xCCA8), TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256(0xC02F), TLS_DHE_RSA_WITH_AES_256_GCM_SHA384(0x009F), TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256(0xCCAA), TLS_DHE_DSS_WITH_AES_256_GCM_SHA384(0x00A3), TLS_DHE_RSA_WITH_AES_128_GCM_SHA256(0x009E), TLS_DHE_DSS_WITH_AES_128_GCM_SHA256(0x00A2), TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384(0xC024), TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384(0xC028), TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256(0xC023), TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256(0xC027), TLS_DHE_RSA_WITH_AES_256_CBC_SHA256(0x006B), TLS_DHE_DSS_WITH_AES_256_CBC_SHA256(0x006A), TLS_DHE_RSA_WITH_AES_128_CBC_SHA256(0x0067), TLS_DHE_DSS_WITH_AES_128_CBC_SHA256(0x0040), TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA(0xC00A), TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA(0xC014), TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA(0xC009), TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA(0xC013), TLS_DHE_RSA_WITH_AES_256_CBC_SHA(0x0039), TLS_DHE_DSS_WITH_AES_256_CBC_SHA(0x0038), TLS_DHE_RSA_WITH_AES_128_CBC_SHA(0x0033), TLS_DHE_DSS_WITH_AES_128_CBC_SHA(0x0032), TLS_RSA_WITH_AES_256_GCM_SHA384(0x009D), TLS_RSA_WITH_AES_128_GCM_SHA256(0x009C), TLS_RSA_WITH_AES_256_CBC_SHA256(0x003D), TLS_RSA_WITH_AES_128_CBC_SHA256(0x003C), TLS_RSA_WITH_AES_256_CBC_SHA(0x0035), TLS_RSA_WITH_AES_128_CBC_SHA(0x002F), TLS_EMPTY_RENEGOTIATION_INFO_SCSV(0x00FF)]",
+  "random"              : "5A2C4BB30DFDBA28911409AEECE328E7C4CD7CBC2C0200BF09FB9352ADB05DD6",
+  "session id"          : "64EB1A16EFA7B27059B20C624B2733A00181B6957E3C7843E3BBEF2CD54880B3",
+  "cipher suites"       : "[TLS_AES_256_GCM_SHA384(0x1302), TLS_AES_128_GCM_SHA256(0x1301), TLS_CHACHA20_POLY1305_SHA256(0x1303), TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384(0xC02C), TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256(0xC02B), TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256(0xCCA9), TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384(0xC030), TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256(0xCCA8), TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256(0xC02F), TLS_DHE_RSA_WITH_AES_256_GCM_SHA384(0x009F), TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256(0xCCAA), TLS_DHE_DSS_WITH_AES_256_GCM_SHA384(0x00A3), TLS_DHE_RSA_WITH_AES_128_GCM_SHA256(0x009E), TLS_DHE_DSS_WITH_AES_128_GCM_SHA256(0x00A2), TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384(0xC024), TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384(0xC028), TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256(0xC023), TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256(0xC027), TLS_DHE_RSA_WITH_AES_256_CBC_SHA256(0x006B), TLS_DHE_DSS_WITH_AES_256_CBC_SHA256(0x006A), TLS_DHE_RSA_WITH_AES_128_CBC_SHA256(0x0067), TLS_DHE_DSS_WITH_AES_128_CBC_SHA256(0x0040), TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA(0xC00A), TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA(0xC014), TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA(0xC009), TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA(0xC013), TLS_DHE_RSA_WITH_AES_256_CBC_SHA(0x0039), TLS_DHE_DSS_WITH_AES_256_CBC_SHA(0x0038), TLS_DHE_RSA_WITH_AES_128_CBC_SHA(0x0033), TLS_DHE_DSS_WITH_AES_128_CBC_SHA(0x0032), TLS_EMPTY_RENEGOTIATION_INFO_SCSV(0x00FF)]",
...
-javax.net.ssl|DEBUG|HttpClient-1-Worker-0|<datetime> UTC|SSLEngineOutputRecord.java:529|WRITE: TLSv1.3 handshake, length = 465
+javax.net.ssl|DEBUG|HttpClient-1-Worker-0|<datetime> UTC|SSLEngineOutputRecord.java:529|WRITE: TLSv1.3 handshake, length = 453
...
-javax.net.ssl|DEBUG|HttpClient-1-Worker-0|<datetime> UTC|SSLEngineInputRecord.java:176|Raw read (
...
...
...
-)
-javax.net.ssl|DEBUG|HttpClient-1-Worker-0|<datetime> UTC|SSLEngineInputRecord.java:213|READ: TLSv1.2 handshake, length = 81
-javax.net.ssl|DEBUG|HttpClient-1-Worker-0|<datetime> UTC|ServerHello.java:892|Consuming ServerHello handshake message (
-"ServerHello": {
-  "server version"      : "TLSv1.2",
-  "random"              : "FA46A225E44E8BFD9719A2F0FF6EDC84B0A97B606F20B7D5164241193DF18496",
-  "session id"          : "B69C59D64A210DFB1FE4E28231E93402940D60B25861505E7DF6910702798413",
-  "cipher suite"        : "TLS_RSA_WITH_AES_256_GCM_SHA384(0x009D)",
-  "compression methods" : "00",
-  "extensions"          : [
-    "renegotiation_info (65,281)": {
-      "renegotiated connection": [<no renegotiated connection>]
-    }
-  ]
-)
+javax.net.ssl|DEBUG|HttpClient-1-Worker-0|<datetime> UTC|SSLEngineInputRecord.java:176|Raw read (
+  0000: 15 03 03 00 02 02 28                               ......(
+)
+javax.net.ssl|DEBUG|HttpClient-1-Worker-0|<datetime> UTC|SSLEngineInputRecord.java:213|READ: TLSv1.2 alert, length = 2
+javax.net.ssl|DEBUG|HttpClient-1-Worker-0|<datetime> UTC|Alert.java:232|Received alert message (
+"Alert": {
+  "level"      : "fatal",
+  "description": "handshake_failure"
+)
...
-javax.net.ssl|DEBUG|HttpClient-1-Worker-0|<datetime> UTC|ServerHello.java:988|Negotiated protocol version: TLSv1.2

agorgl 2025-09-10T13:25:54.479189Z

it seems that v198 is missing TLS_RSA_WITH_AES_256_GCM_SHA384 cipher that the server uses

agorgl 2025-09-10T13:28:32.853279Z

To be very precise, these suites are missing from v198:

TLS_RSA_WITH_AES_256_GCM_SHA384(0x009D)
TLS_RSA_WITH_AES_128_GCM_SHA256(0x009C)
TLS_RSA_WITH_AES_256_CBC_SHA256(0x003D)
TLS_RSA_WITH_AES_128_CBC_SHA256(0x003C)
TLS_RSA_WITH_AES_256_CBC_SHA(0x0035)
TLS_RSA_WITH_AES_128_CBC_SHA(0x002F)

agorgl 2025-09-10T13:56:51.108409Z

And the simplest POC of all:

bb -e "(import '[javax.net.ssl SSLSocketFactory]) (run! println (.getSupportedCipherSuites (javax.net.ssl.SSLSocketFactory/getDefault)))"

agorgl 2025-09-10T13:57:09.635229Z

this gives 37 ciphers in v197 and 31 ciphers in v198

agorgl 2025-09-10T14:13:06.455029Z

Found it

agorgl 2025-09-10T14:13:18.833559Z

I got bitten by jdk 24: https://www.oracle.com/java/technologies/javase/24-relnote-issues.html#JDK-8245545 (and consequently by graalvm 24 upgrade)

agorgl 2025-09-10T14:13:45.824869Z

Issue is reproducible with regular clojure between jdk 23 and jdk 24

agorgl 2025-09-10T14:14:34.218409Z

So now my question is, how do I edit java.security for graalvm baked apps like babashka

borkdude 2025-09-10T15:00:20.645499Z

> Issue is reproducible with regular clojure between jdk 23 and jdk 24 Ah good to hear it's not a bug in bb. How would you fix this with normal clojure?

agorgl 2025-09-10T15:09:15.310719Z

You remove TLS_RSA_* from jdk.tls.disabledAlgorithms property in java.security file

borkdude 2025-09-10T15:10:35.715889Z

where is this file?

agorgl 2025-09-10T15:12:11.815889Z

Depends on your jdk installation, on linux it is in /etc/java-openjdk/security/java.security

borkdude 2025-09-10T15:14:44.690439Z

I asked a question in the GraalVM native-image slack channel: https://graalvm.slack.com/archives/CN9KSFB40/p1757517264072409

borkdude 2025-09-10T17:58:39.736849Z

I guess you could use babashka.curl as a workaround meanwhile

borkdude 2025-09-10T17:59:40.428129Z

or upgrade your servers to a safer cipher suite config

borkdude 2025-10-01T12:43:11.762829Z

@agorglouk Good news. In the next bb version this is possible:

(deftest java-security-setProperty-test
  (is (= 37
         (bb nil '(do (java.security.Security/setProperty "jdk.tls.disabledAlgorithms" "SSLv3, TLSv1, TLSv1.1, DTLSv1.0, RC4, DES, MD5withRSA, DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL, ECDH, rsa_pkcs1_sha1 usage HandshakeSignature, ecdsa_sha1 usage HandshakeSignature, dsa_sha1 usage HandshakeSignature")
                      (count (.getSupportedCipherSuites (javax.net.ssl.SSLSocketFactory/getDefault))))))))
So you can modify "jdk.tls.disabledAlgorithms" yourself at runtime Thanks to Jovan Stevanovic on GraalVM slack

borkdude 2025-10-01T12:43:49.708669Z

you could put this in BABASHKA_PRELOADS in your CI env or so as well

agorgl 2025-10-01T12:43:53.055559Z

This is amazing!

agorgl 2025-10-01T12:44:12.207579Z

I'll use the runtime trick for now :)

borkdude 2025-10-01T12:44:49.081569Z

good. just realize it doesn't work with the current bb. but I can merge this and you can download a dev release if you want in 30 minutes or so

agorgl 2025-10-01T12:45:15.511619Z

yeah ping me up to give it a try

agorgl 2025-10-01T16:41:05.095119Z

Just tested bb 1.12.209-SNAPSHOT and the fix seems to be working, thank you very much!

agorgl 2025-10-01T16:48:57.867539Z

Also, TIL about BABASHKA_PRELOADS :)

borkdude 2025-10-01T17:07:39.818359Z

Ah it works on master? I’m preparing a PR that also allows some security file to be set with a property but I guess the move to GraalVM 25 did it

borkdude 2025-10-01T17:08:07.386809Z

Or maybe it works in 208 as well?

agorgl 2025-10-01T17:09:45.879579Z

i just grabbed the artifact from the java.security pr pipeline and tested it

agorgl 2025-10-01T17:11:13.612529Z

do you want me to try the 208 release and the latest master build respectively?

borkdude 2025-10-01T17:11:48.395779Z

Would be interesting

agorgl 2025-10-01T17:11:59.875399Z

ok let me try these

agorgl 2025-10-01T17:15:36.229679Z

208 does not work

πŸ‘ 1
borkdude 2025-10-01T17:16:19.037989Z

and master?

agorgl 2025-10-01T17:17:07.164269Z

master doesn't work either

borkdude 2025-10-01T17:17:26.007209Z

ok then I know merging this is definitely the right thing to do

βœ… 1
borkdude 2025-10-01T17:17:44.132329Z

once I can get past failing tests in other areas :)

borkdude 2025-09-29T11:00:09.884029Z

@agorglouk I've been talking to a GraalVM engineer and he has currently the solution to build babashka yourself with a custom java.security file that you can point to with "-J-Djava.security.properties=/tmp/java.security" Unfortunately overriding with a Java property at runtime currently doesn't work due to a bug in OpenJDK. But he has a substitution that can be applied as part of native-image and will be part of some future version of GraalVM.

agorgl 2025-09-29T11:01:30.035179Z

Yeah I thought that the security file should be baked inside bb at some point

agorgl 2025-09-29T11:02:22.690229Z

Do you have the change/pr in graalvm in order to keep track of it?

borkdude 2025-09-29T11:03:11.583789Z

no, just an issue: https://github.com/oracle/graal/issues/12164#issuecomment-3346167410 the PR will be made by https://github.com/jovanstevanovic

borkdude 2025-09-29T11:04:11.062289Z

normally the security file should not have to be baked in, but due to a bug in OpenJDK you can't override this specific property at runtime in native-image

borkdude 2025-09-29T11:04:15.250649Z

and this will be fixed

agorgl 2025-09-29T11:04:42.864519Z

Thanks for getting into this!

leifericf 2025-09-10T08:39:14.041539Z

I installed Babashka on a Windows machine for the first time, using Scoop (as described https://github.com/babashka/babashka?tab=readme-ov-file#scoop). It went smoothly, and I had the REPL working fine in VS Code via Calva. However, after rebooting my machine, I get the following error:

; java.io.FileNotFoundException: Could not locate babashka/json.bb, babashka/json.clj or babashka/json.cljc on classpath. user c:\Code\test\src\test.clj:2:3
Does anyone know what's happened? It looks like some environment variable or something was not persisted. Update: I tried uninstalling and reinstalling Babashka via Scoop, but the same issue persists (before and after rebooting).

βœ… 1
leifericf 2025-11-13T09:56:28.347719Z

@borkdude: This just happened again out of the blue after rebooting my machine. I checked C:\\Users\\leifercf\\.m2\\repository\\org\\babashka\\json\\0.1.6\\json-0.1.6.jar and it is indeed still present.

java.io.FileNotFoundException: Could not locate babashka/json.bb, babashka/json.clj or babashka/json.cljc on classpath. user c:\Code\bamboo-utils\src\bamboo_utils.clj:2:3
Interestingly, the Babashka REPL starts just fine in VS Code, and I am able to evaluate other expressions like (+ 1 2)

leifericf 2025-11-13T10:08:49.190219Z

I'm requiring things like this:

(ns bamboo-utils
  (:require [babashka.fs :as fs]
            [babashka.http-client :as http]
            [babashka.json :as json]
            [clojure.string :as str]))
When I evaluate those requires one at a time, it works fine for babashka.fs and babashka.http-client Requiring clojure.string also works fine on its own. The FileNotFoundException is triggering when I try to require babashka.json

leifericf 2025-11-13T10:27:11.925769Z

Interesting. I see the following files in C:\Users\leifercf\.m2\repository\babashka

.
β”œβ”€β”€ babashka.curl
β”‚   └── 0.1.2
β”‚       β”œβ”€β”€ babashka.curl-0.1.2.jar
β”‚       β”œβ”€β”€ babashka.curl-0.1.2.jar.sha1
β”‚       β”œβ”€β”€ babashka.curl-0.1.2.pom
β”‚       β”œβ”€β”€ babashka.curl-0.1.2.pom.sha1
β”‚       └── _remote.repositories
β”œβ”€β”€ fs
β”‚   └── 0.5.25
β”‚       β”œβ”€β”€ fs-0.5.25.jar
β”‚       β”œβ”€β”€ fs-0.5.25.jar.sha1
β”‚       β”œβ”€β”€ fs-0.5.25.pom
β”‚       β”œβ”€β”€ fs-0.5.25.pom.sha1
β”‚       └── _remote.repositories
└── process
    └── 0.6.23
        β”œβ”€β”€ process-0.6.23.jar
        β”œβ”€β”€ process-0.6.23.jar.sha1
        β”œβ”€β”€ process-0.6.23.pom
        β”œβ”€β”€ process-0.6.23.pom.sha1
        └── _remote.repositories
But json (and some other Babashka stuff) is in a different directory, C:\Users\leifercf\.m2\repository\org\babashka:
.
β”œβ”€β”€ babashka.impl.java
β”‚   └── 0.1.10
β”‚       β”œβ”€β”€ babashka.impl.java-0.1.10.jar
β”‚       β”œβ”€β”€ babashka.impl.java-0.1.10.jar.sha1
β”‚       β”œβ”€β”€ babashka.impl.java-0.1.10.pom
β”‚       β”œβ”€β”€ babashka.impl.java-0.1.10.pom.sha1
β”‚       └── _remote.repositories
β”œβ”€β”€ cli
β”‚   └── 0.8.66
β”‚       β”œβ”€β”€ cli-0.8.66.jar
β”‚       β”œβ”€β”€ cli-0.8.66.jar.sha1
β”‚       β”œβ”€β”€ cli-0.8.66.pom
β”‚       β”œβ”€β”€ cli-0.8.66.pom.sha1
β”‚       └── _remote.repositories
β”œβ”€β”€ http-client
β”‚   └── 0.4.23
β”‚       β”œβ”€β”€ http-client-0.4.23.jar
β”‚       β”œβ”€β”€ http-client-0.4.23.jar.sha1
β”‚       β”œβ”€β”€ http-client-0.4.23.pom
β”‚       β”œβ”€β”€ http-client-0.4.23.pom.sha1
β”‚       └── _remote.repositories
β”œβ”€β”€ json
β”‚   └── 0.1.6
β”‚       β”œβ”€β”€ json-0.1.6.jar
β”‚       β”œβ”€β”€ json-0.1.6.jar.sha1
β”‚       β”œβ”€β”€ json-0.1.6.pom
β”‚       β”œβ”€β”€ json-0.1.6.pom.sha1
β”‚       └── _remote.repositories
└── sci.impl.types
    └── 0.0.2
        β”œβ”€β”€ _remote.repositories
        β”œβ”€β”€ sci.impl.types-0.0.2.jar
        β”œβ”€β”€ sci.impl.types-0.0.2.jar.sha1
        β”œβ”€β”€ sci.impl.types-0.0.2.pom
        └── sci.impl.types-0.0.2.pom.sha1
Is Babashka supposed to be "split" into those two different directories? I'm unsure if that's a relevant fact or related to the issue I'm seeing.

leifericf 2025-11-13T10:30:57.753569Z

And in C:\Users\leifercf\scoop\apps\babashka, I have:

.
β”œβ”€β”€ 1.12.208
β”‚   β”œβ”€β”€ bb.exe
β”‚   β”œβ”€β”€ install.json
β”‚   └── manifest.json
β”œβ”€β”€ 1.12.209
β”‚   β”œβ”€β”€ bb.exe
β”‚   β”œβ”€β”€ install.json
β”‚   └── manifest.json
└── current -> /mnt/c/Users/leifercf/scoop/apps/babashka/1.12.209

leifericf 2025-11-13T10:37:47.286909Z

Ah, JFC. As is often the case, I was being an idiot πŸ€¦β€β™‚οΈ I had removed the dependency to babashka.json from my bb.edn after switching to cheshire.core when we were testing things earlier. It works again now after re-adding the dependency to my bb.edn:

{:paths ["src"]
 :deps {org.babashka/json {:mvn/version "0.1.6"}}}
I forget babashka.json is not included in Babashka itself.

borkdude 2025-09-10T08:59:11.617829Z

Perhaps you deleted something from gitlibs or m2 folder? Try the -Sforce flag

leifericf 2025-09-10T09:05:33.750969Z

Oh, how odd. I installed latest Java, but after reboot, it looks like my system has reverted to an older version somehow:

PS C:\Users\leifercf> java -version
java version "1.8.0_461"
Java(TM) SE Runtime Environment (build 1.8.0_461-b11)
Java HotSpot(TM) Client VM (build 25.461-b11, mixed mode, sharing)

leifericf 2025-09-10T09:10:54.068389Z

Hmmm. Reinstalling latest Java and rebooting didn't do anything. I'm not sure how/where to use the -Sforce flag, but I'll look into that.

borkdude 2025-09-10T09:18:22.013339Z

Just as the first argument to bb

πŸ‘ 1
borkdude 2025-09-10T09:18:44.316409Z

See the help output of bb

leifericf 2025-09-10T09:18:48.087049Z

I'm bb it via Calva in VS Code. Will try to run it "manually."

leifericf 2025-09-10T09:29:25.151349Z

Finally managed to fix my Java version, just in case πŸ˜…

PS C:\Users\leifercf> java -version
java version "24.0.2" 2025-07-15
Java(TM) SE Runtime Environment (build 24.0.2+12-54)
Java HotSpot(TM) 64-Bit Server VM (build 24.0.2+12-54, mixed mode, sharing)

leifericf 2025-09-10T09:30:58.061039Z

Yeah, so bb runs fine it seems:

PS C:\Users\leifercf\scoop\apps\babashka\current> .\bb.exe -Sforce
Babashka v1.12.208 REPL.
Use :repl/quit or :repl/exit to quit the REPL.
Clojure rocks, Bash reaches.

user=>

borkdude 2025-09-10T09:34:44.368449Z

Try looking in your home folders .babashka folder and show what’s in it

borkdude 2025-09-10T09:35:29.249859Z

And also try to run bb from the same for as Calva does it with Sforce

leifericf 2025-09-10T09:37:12.783279Z

Try looking in your home folders .babashka folder [...]Oh, I don't even have a .babashka folder in C:\Users\leifercf

borkdude 2025-09-10T09:41:14.240859Z

I’ll get back to you, it’s very hard for me to diagnose this from a phone

leifericf 2025-09-10T09:41:16.061799Z

I just nuked these caches as well for good measure:

C:\Code\test\.lsp\.cache
C:\Code\test\.clj-kondo

leifericf 2025-09-10T09:41:53.101679Z

No worries, and thanks for the help so far! In all likelihood, I'm just doing something stupid or my system is messed up.

borkdude 2025-09-10T10:24:46.781719Z

ok, I'm back at the keyboard. So in test.clj are you using babashka.json?

leifericf 2025-09-10T11:39:08.083509Z

Yeah, I only have two files in my project. bb.edn

{:paths ["src"]
 :deps {org.babashka/json {:mvn/version "0.1.6"}}}
kuri.clj (I just renamed it to test.clj earlier for Slack):
(ns kuri
  (:require [babashka.http-client :as http]
            [babashka.json :as json]))

(def company-name (System/getenv "BAMBOOHR_COMPANY_NAME"))
(def api-uri (str "" company-name))
(def api-credentials {:user (System/getenv "BAMBOOHR_API_KEY") :pass "x"})

(def employees
  {:method :get
   :uri (str api-uri "/v1/employees/directory")
   :headers {"Accept" "application/json"}
   :basic-auth api-credentials})

(defn fetch
  "Execute HTTP request and get the body as JSON."
  [request]
  (-> request
      (http/request)
      :body
      (json/read-str keyword)))

(defn get-employees
  "Get data for all employees (selected fields) from BambooHR."
  []
  (let [fields-to-keep [:workEmail
                        :displayName
                        :jobTitle
                        :department
                        :division
                        :supervisor]]
    (doall (->> (fetch employees)
                :employees
                (pmap #(select-keys % fields-to-keep))))))

(comment
  (get-employees))
And my project structure looks like this:
.
β”œβ”€β”€ bb.edn
└── src
    └── kuri.clj

leifericf 2025-09-10T11:40:02.881339Z

Note that I had everything working fine yesterday. But I shut down my PC, and when I returned today, it no longer worked πŸ˜…

leifericf 2025-09-10T11:45:59.184759Z

This is what I have in .gitlibs:

.
└── babashka.core
    └── 52a6037bd4b632bffffb04394fb4efd0cdab6b1e
        β”œβ”€β”€ deps.edn
        β”œβ”€β”€ LICENSE
        β”œβ”€β”€ README.md
        └── src
            └── babashka
                └── core.clj
Path: /mnt/c/Users/leifercf/.gitlibs/libs/babashka

leifericf 2025-09-10T11:48:50.362369Z

And this is what I have in .m2:

.
β”œβ”€β”€ babashka.curl
β”‚   └── 0.1.2
β”‚       β”œβ”€β”€ babashka.curl-0.1.2.jar
β”‚       β”œβ”€β”€ babashka.curl-0.1.2.jar.sha1
β”‚       β”œβ”€β”€ babashka.curl-0.1.2.pom
β”‚       β”œβ”€β”€ babashka.curl-0.1.2.pom.sha1
β”‚       └── _remote.repositories
β”œβ”€β”€ fs
β”‚   └── 0.5.25
β”‚       β”œβ”€β”€ fs-0.5.25.jar
β”‚       β”œβ”€β”€ fs-0.5.25.jar.sha1
β”‚       β”œβ”€β”€ fs-0.5.25.pom
β”‚       β”œβ”€β”€ fs-0.5.25.pom.sha1
β”‚       └── _remote.repositories
└── process
    └── 0.6.23
        β”œβ”€β”€ process-0.6.23.jar
        β”œβ”€β”€ process-0.6.23.jar.sha1
        β”œβ”€β”€ process-0.6.23.pom
        β”œβ”€β”€ process-0.6.23.pom.sha1
        └── _remote.repositories
Path: /mnt/c/Users/leifercf/.m2/repository/babashka

leifericf 2025-09-10T11:54:57.290949Z

It seems like something is wrong with my environment variables after rebooting. Somehow, I don't see JAVA_HOME or MAVEN_HOME there. I'm looking into that now and will try to set those manually.

borkdude 2025-09-10T15:01:07.578889Z

What is weird is that there is no babashka.json in the mvn repo

borkdude 2025-09-10T15:01:51.158819Z

can you check if there is a ~/.babashka/.cpcache directory? it is hidden

πŸ‘€ 1
borkdude 2025-09-10T15:02:00.979909Z

if you remove that, the issue should resolve itself

leifericf 2025-09-12T07:42:17.498799Z

In this directory: /mnt/c/Users/leifercf/scoop/apps/babashka/current I only have these files:

drwxrwxrwx 1 leifericf leifericf     4096 Sep 10 11:28 .
drwxrwxrwx 1 leifericf leifericf     4096 Sep 10 11:28 ..
-rwxrwxrwx 1 leifericf leifericf 70868992 Sep  4 14:09 bb.exe
-rwxrwxrwx 1 leifericf leifericf       67 Sep 10 11:28 install.json
-rwxrwxrwx 1 leifericf leifericf      831 Sep  9 10:34 manifest.json

leifericf 2025-09-12T07:43:10.683179Z

There is no hidden .babashka directory anywhere in my home directory, as far as I can tell πŸ€” I'm doing a system-wide search for it now. Maybe it's somewhere else.

leifericf 2025-09-12T07:44:16.788139Z

I found a cache named babashka#1.12.208#7784600.zip here: C:\Users\leifercf\scoop\cache

borkdude 2025-09-12T07:49:41.393459Z

that's not it. maybe it would help if you just wiped your /.m2 folder and your /.gitlibs folder

πŸ’‘ 1
borkdude 2025-09-12T07:50:07.808809Z

or maybe just rename them, just in case

πŸ‘ 1
leifericf 2025-09-12T07:56:07.418409Z

That did the trick, yeah!

leifericf 2025-09-12T07:56:26.297899Z

Thanks a lot for the help, and sorry for wasting your time on my messed-up system. I have no idea how that broke after a reboot.

leifericf 2025-09-12T07:56:38.323219Z

I'll try to reboot again now, to make sure it doesn't happen again πŸ˜…

borkdude 2025-09-12T08:00:08.303379Z

nice! and no worries, this stuff happened to me too more than once

πŸ˜… 1
leifericf 2025-09-12T08:01:06.722179Z

I did a reboot now and it continued to work, so that's good. Looks like it was a fluke.

leifericf 2025-09-17T11:12:40.860979Z

@borkdude: The exact same issue (symptoms) has occurred again, and this time deleting my .m2 and .gitlibs directories, reinstalling Babashka via Scoop and Calva via VS Code, didn't resolve the issue. I don't know if it's caused by Maven, Gitlibs, Babashka installer, Calva, or something else on my Windows system. I'm still trying to pinpoint the root cause of the issue on my system, and I'll let you know if I manage to figure it out.

borkdude 2025-09-17T11:23:28.073029Z

Also delete .babashka

borkdude 2025-09-17T11:23:45.951099Z

If you can reproduce this please file a GitHub issue

πŸ‘ 1
borkdude 2025-09-17T11:34:52.231579Z

Are you always invoking the script from the same dir?

leifericf 2025-09-17T11:35:42.885459Z

I found a "workaround" of sorts, by changing my bb.edn from this:

{:paths ["src"]
 :deps {org.babashka/json {:mvn/version "0.1.6"}}}
To just this:
{:paths ["src"]}
And then I changed my requires from this:
(ns bamboo-utils
  (:require [babashka.fs :as fs]
            [babashka.http-client :as http]
            [babashka.json :as json]
            [clojure.string :as str]))
To this:
(ns bamboo-utils
  (:require [babashka.fs :as fs]
            [babashka.http-client :as http]
            [cheshire.core :as json] ;; <- Change is here
            [clojure.string :as str]))
So I guess I'm using a different JSON library (`cheshire.core/parse-string` instead of org.babashka/read-str), but it's working now. But now I have no idea how I got it working with org.babashka/json earlier in the first place πŸ˜…

leifericf 2025-09-17T11:38:27.836989Z

> Are you always invoking the script from the same dir? I'm honestly not sure. I'm just evaluating expressions inside VS Code via Calva after opening the same root project directory and starting a REPL.

borkdude 2025-09-17T11:38:33.687769Z

It should work with bb json. The workaround you have is because now you don’t have deps. Can you answer my previous question?

πŸ‘ 2
leifericf 2025-09-17T11:40:33.375159Z

My workflow is like this: 1. Start VS Code. 2. Open root folder of my project via "File -> Open Folder..." in VS Code. β—¦ This folder is opened by default when I restart VS Code after having opened the folder once. 3. Use Calva to start a Babashka REPL.

πŸ‘ 1
leifericf 2025-09-17T11:50:17.483289Z

Also, side note: As a primarily Mac and Linux user, I suck at Windows stuff πŸ˜… So there's a good chance I'm doing (or not doing) something dumb.

borkdude 2025-09-17T12:29:39.840899Z

do you work on Windows on Wednesdays? ;) last week I was in the gym when this came up and now again, so I think there's a schedule there ;)

leifericf 2025-09-17T12:31:27.479999Z

> Do you work on Windows on Wednesdays? Yes, unfortunately πŸ˜… I'm back in the computer games industry. > last week I was in the gym when this came up and now again, so I think there's a schedule there πŸ˜‰ Hahaha! Solid hypothesis. It happens the exact moment you get on the step master.

borkdude 2025-09-17T15:47:35.872959Z

I know something to debug perhaps:

(prn (babashka.classpath/get-classpath))
Do this before you require babashka.json and show it here.

leifericf 2025-09-18T12:44:12.239949Z

What the hell, now it's working flawlessly again (and I haven't done any changes, just rebooted my machine).

leifericf 2025-09-18T12:44:37.019029Z

Your debug step reports this path:

; "C:\\Code\\bamboo-utils\\src;C:\\Users\\leifercf\\.m2\\repository\\org\\babashka\\json\\0.1.6\\json-0.1.6.jar;C:\\Users\\leifercf\\.m2\\repository\\org\\clojure\\data.json\\2.5.0\\data.json-2.5.0.jar"

borkdude 2025-09-18T12:50:47.416259Z

including the leading semicolon?

borkdude 2025-09-18T12:51:39.260469Z

if the error happens again, then print this thing again, and also check if C:\\Users\\leifercf\\.m2\\repository\\org\\babashka\\json\\0.1.6\\json-0.1.6.jar is present on your filesystem still

πŸ‘Œ 1
leifericf 2025-09-18T13:00:01.900599Z

> including the leading semicolon? Ah! No, I believe that semicolon is just something Calva adds to its output window.

leifericf 2025-09-18T13:01:11.453579Z

> if the error happens again, then print this thing again Affirmative! Will do.

borkdude 2025-09-10T20:51:31.817439Z

More Windows shelling out weirdness for anyone interested. It doesn't seem bb or Java specific here though, but something specific to Git bash echo.exe https://github.com/babashka/process/discussions/179

1