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.
[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.0Common 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.
for i in 1 2 3; do sbt update && break || sleep 15; doneCache the Coursier/Ivy caches
Caching resolved artifacts between runs means most are local, so a flaky network matters far less.
- uses: actions/cache@v4
with:
path: |
~/.cache/coursier
~/.ivy2/cache
key: sbt-${{ hashFiles('**/build.sbt', 'project/**') }}Point at a closer or internal mirror
- Configure a repository mirror in
~/.sbt/repositoriesor via Coursier. - Host an internal proxy (Artifactory/Nexus) for high-volume pipelines.
- Pin a lockfile (sbt-dependency-lock) so downloads are stable and cacheable.
How to prevent it
- Cache
~/.cache/coursierand~/.ivy2/cachekeyed on your build files. - Wrap
sbt updatein a small retry loop for transient flake. - Use an internal artifact mirror to reduce public-repo dependence.