Skip to content
Latchkey

tools.deps "Error reading edn" in deps.edn in CI

The Clojure CLI parses deps.edn as EDN before doing anything else. A syntax error there (an unbalanced brace, an unquoted value, or a duplicate key) fails parsing and no classpath is built.

What this error means

clj or clojure aborts at startup with "Error reading edn" or "EOF while reading" and a location inside deps.edn.

clj
Error reading edn from deps.edn: EOF while reading, starting at line 3
Execution error at clojure.tools.deps ... Error reading edn.

Common causes

Malformed EDN in deps.edn

An unbalanced {} or [], a trailing key with no value, or a missing string quote makes the EDN reader fail.

A duplicate or invalid key in the deps map

Two identical keys in the same map, or a value that is not valid EDN, is rejected by the reader.

How to fix it

Repair the EDN structure

  1. Read the location the parser reports (line and "starting at").
  2. Balance the braces/brackets and fix the offending key or value.
  3. Validate by running clojure -Spath, which parses deps.edn without running code.
deps.edn
{:deps {org.clojure/clojure {:mvn/version "1.11.1"}}
 :aliases {:test {:extra-paths ["test"]}}}

Validate deps.edn in CI

Fail fast on a malformed file by parsing the classpath before tests.

Terminal
clojure -Spath > /dev/null

How to prevent it

  • Edit deps.edn with paren/brace matching enabled.
  • Run clojure -Spath locally before pushing deps.edn changes.
  • Avoid duplicate keys within the same EDN map.

Frequently asked questions

What causes ""Error reading edn""?
An unbalanced {} or [], a trailing key with no value, or a missing string quote makes the EDN reader fail.
How do I fix "Error reading edn"?
Repair the EDN structure

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card