theonedev/onedev · error · HttpResponseAwareException

Unknown GAV

Error message

Unknown GAV

What it means

Thrown by MavenPackHandler.serveBlob when serving a Maven artifact over the pack repository endpoint: the requested groupId/artifactId/version (GAV) could not be resolved to an existing pack for the project. OneDev stores Maven artifacts as packs keyed by TYPE 'maven' and name groupId:artifactId; if no pack (or matching version) is found, the handler responds with HTTP 404 and this message.

Source

Thrown at server-plugin/server-plugin-pack-maven/src/main/java/io/onedev/server/plugin/pack/maven/MavenPackHandler.java:329

								response.setContentType(MediaType.APPLICATION_XML);
							else if (fileName.endsWith(EXT_JAR))
								response.setContentType(CONTENT_TYPE_JAR);
							packBlobService.downloadBlob(packBlobInfo.getLeft(), sha256BlobHash, 
									response.getOutputStream());
							response.setStatus(SC_OK);
						}
					} catch (IOException e) {
						throw new RuntimeException(e);
					}
				} else {
					throw new HttpResponseAwareException(SC_NOT_FOUND, "Unknown file");
				}
			} else {
				response.setStatus(SC_OK);
				response.setDateHeader(LAST_MODIFIED, packInfo.getRight().getTime());
			}
		} else {
			throw new HttpResponseAwareException(SC_NOT_FOUND, "Unknown GAV");
		}
	}
	
	private void uploadBlob(HttpServletRequest request, HttpServletResponse response,
							Long projectId, Long buildId, String groupId, @Nullable String artifactId, 
							@Nullable String version, String fileName) {
		sessionService.run(() -> {
			checkProject(projectId, true);
		});
		try (var is = request.getInputStream()) {
			var lockName = "update-pack:" + projectId + ":" + TYPE + ":" + groupId;
			if (artifactId != null && version != null)
				lockName += ":" + artifactId + ":" + version;
			var blobName = getBlobName(fileName);
			if (!blobName.equals(fileName)) { // checksum verification
				var baos = new ByteArrayOutputStream();
				var copied = copyWithMaxSize(is, baos, MAX_CHECKSUM_LEN);
				if (copied == -1)

View on GitHub (pinned to d44925c47c)

Solutions

  1. Verify the groupId:artifactId:version in your build file matches an artifact actually published to that OneDev project (Project > Packages).
  2. Check the repository URL points at the correct project that has pack management enabled and contains the artifact.
  3. Publish/upload the missing artifact (mvn deploy against the OneDev repository) before depending on it.
  4. If a snapshot version disappeared, redeploy it or switch to a released version.

Example fix

// before (pom.xml)
<dependency>
  <groupId>com.acme</groupId>
  <artifactId>lib</artifactId>
  <version>1.2.0</version>
</dependency>
// after — use a version that exists in the project's package list
<version>1.1.0</version>
Defensive patterns

Strategy: validation

Validate before calling

// Before depending on the artifact, confirm the GAV exists in the target project
async function assertGavExists(baseUrl, projectId, group, artifact, version, token) {
  const res = await fetch(`${baseUrl}/~api/packs?projectId=${projectId}&type=maven&q=${group}:${artifact}:${version}`, { headers: { Authorization: `Bearer ${token}` } });
  if (!res.ok) throw new Error(`lookup failed: HTTP ${res.status}`);
  const packs = await res.json();
  if (!packs || packs.length === 0) throw new Error(`GAV ${group}:${artifact}:${version} not published to project ${projectId}`);
}

Prevention

When it happens

Trigger: A Maven/Gradle client requests an artifact path whose last path segments parse to a groupId/artifactId (via getGroupIdAndArtifactId) and a version, but findPack(project, groupId, artifactId, version) returns null — e.g. the artifact was never uploaded to this project, the version does not exist, or the wrong project id is used in the repository URL.

Common situations: Typo in coordinates in pom.xml/gradle dependencies; depending on an artifact published to a different OneDev project; snapshot cleanup removed the version; misspelled repository URL pointing at the wrong project; client caches referencing a deleted pack.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06). Data as JSON: /api/errors/f91e431eacc2dd8f. Report an issue: GitHub.