theonedev/onedev · error · HttpResponseAwareException

No group id

Error message

No group id

What it means

OneDev's Maven pack handler derives the Maven groupId from the leading path segments of a repository request path. If the request path yields no group segments (the segment list is empty after peeling off the artifactId), getGroupId throws HttpResponseAwareException mapped to HTTP 400 Bad Request with message 'No group id'.

Source

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

						  @Nullable String version) {
		if (artifactId == null)
			artifactId = NONE;
		if (version == null)
			version = NONE;
		return packService.findByNameAndVersion(project, TYPE, getName(groupId, artifactId), version);
	}

	private Pair<String, String> getGroupIdAndArtifactId(List<String> pathSegments) {
		if (pathSegments.isEmpty())
			throw new HttpResponseAwareException(SC_BAD_REQUEST, "No artifact id");
		var artifactId = pathSegments.get(pathSegments.size()-1);
		pathSegments = pathSegments.subList(0, pathSegments.size()-1);
		return new Pair<>(getGroupId(pathSegments), artifactId);
	}

	private String getGroupId(List<String> pathSegments) {
		if (pathSegments.isEmpty())
			throw new HttpResponseAwareException(SC_BAD_REQUEST, "No group id");
		return StringUtils.join(pathSegments, ".");
	}

	@Override
	public List<String> normalize(List<String> pathSegments) {
		return pathSegments;
	}
	
}

View on GitHub (pinned to d44925c47c)

Solutions

  1. Fix the client repository/deploy URL to include the full Maven coordinate path: /<groupId dots as slashes>/<artifactId>/<version>/<file>
  2. Check for double slashes or an empty path prefix in the configured URL
  3. Verify the request is being routed to the Maven pack handler for the right project rather than the project root path
  4. Log the full request path and confirm pathSegments construction before calling getGroupId

Example fix

// before (client config)
url = "http://onedev.example.com/~projects/myproj/maven"  // no coordinate path
// after
url = "http://onedev.example.com/~projects/myproj/maven/com/example/artifact/1.0/artifact-1.0.jar"
Defensive patterns

Strategy: validation

Validate before calling

const segments = new URL(repoUrl).pathname.split('/').filter(Boolean);
if (segments.length < 2) throw new Error('Maven pack URL must include group path, e.g. /com/example/artifact/...');

Try / catch

try { await deployArtifact(url) } catch (e) { if (e.response?.status === 400 && /No group id/i.test(e.message ?? '')) { console.error('Repository URL missing group path segments'); } else throw e }

Prevention

When it happens

Trigger: A GET/PUT request reaches the Maven pack endpoint with a path that resolves to only an artifactId with no preceding group segments, e.g. requesting the bare root path or a path where every segment is consumed by other parsing so the subList passed to getGroupId is empty.

Common situations: Misconfigured Maven client repository URLs missing the group path portion (e.g. using base URL without the com/example coordinates path); accidental double slashes collapsing path segments; malformed deploy URLs constructed by tooling or scripts that strip segments.

Understand the failure class

Background: "Invalid URL" errors: why new URL(), URI.parse, and reqwest::Url reject your string — missing scheme, whitespace, and bad path format — this error's family across 39 libraries.

Related errors


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