Skip to content
Latchkey

sbt "Server access Error" in CI

sbt (via Coursier/Ivy) could not reach a repository while downloading dependencies. "Server access Error" is a transient network/repository failure - a timeout, reset, or 5xx - not a problem with your build definition.

What this error means

During sbt update/compile, resolution fails with "Server access Error: ... url=https://repo1.maven.org/...". Re-running the job usually succeeds, which is the signature of a transient network issue.

sbt output
[error] Server access Error: Connection reset url=https://repo1.maven.org/maven2/
com/example/lib_2.13/1.0.0/lib_2.13-1.0.0.pom
[error] (update) sbt.librarymanagement.ResolveException: Error downloading com.example:lib_2.13:1.0.0

Common causes

Transient repository or network failure

A reset connection, timeout, or 5xx from Maven Central or a mirror interrupts the download. These clear on their own and are unrelated to your build.

Flaky proxy or congested runner network

A proxy hiccup or saturated runner network can drop connections to the artifact repository mid-fetch.

How to fix it

Retry the resolution

Because it is transient, retrying the update usually clears it.

Terminal
for i in 1 2 3; do sbt update && break || sleep 15; done

Cache the Coursier/Ivy caches

Caching resolved artifacts between runs means most are local, so a flaky network matters far less.

.github/workflows/ci.yml
- uses: actions/cache@v4
  with:
    path: |
      ~/.cache/coursier
      ~/.ivy2/cache
    key: sbt-${{ hashFiles('**/build.sbt', 'project/**') }}

Point at a closer or internal mirror

  1. Configure a repository mirror in ~/.sbt/repositories or via Coursier.
  2. Host an internal proxy (Artifactory/Nexus) for high-volume pipelines.
  3. Pin a lockfile (sbt-dependency-lock) so downloads are stable and cacheable.

How to prevent it

  • Cache ~/.cache/coursier and ~/.ivy2/cache keyed on your build files.
  • Wrap sbt update in a small retry loop for transient flake.
  • Use an internal artifact mirror to reduce public-repo dependence.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →