Skip to content
Latchkey

datadog-ci sourcemaps upload "400 Bad Request" in CI

datadog-ci sourcemaps upload sent the maps but Datadog returned 400, meaning the request was malformed: usually a missing --service, --release-version, or --minified-path-prefix, or a prefix that is not a valid URL/path.

What this error means

datadog-ci sourcemaps upload fails with "Error: Request failed with status code 400" and a message about an invalid or missing parameter.

datadog-ci
[ERROR] Failed upload sourcemaps: 400 Bad Request
  minified-path-prefix must be a valid URL or an absolute path

Common causes

A required flag is missing

sourcemaps upload needs --service, --release-version, and --minified-path-prefix; omitting one yields a 400 from the intake.

minified-path-prefix is not a valid prefix

The prefix must be a URL (the public path your JS is served from) or an absolute path; a relative or malformed value is rejected.

How to fix it

Pass all required parameters

  1. Set the service name, the release version, and the path prefix where the minified files are served.
  2. Make the prefix a full URL or an absolute path.
  3. Re-run the upload.
Terminal
datadog-ci sourcemaps upload ./dist \
  --service web \
  --release-version "$VERSION" \
  --minified-path-prefix https://app.example.com/static/

Match the prefix to the served path

The prefix must equal the public URL path browsers load the bundles from, so Datadog can map minified frames back to sources.

How to prevent it

  • Always supply service, release-version, and minified-path-prefix.
  • Use the real public URL of the served bundles as the prefix.
  • Keep the release-version consistent between build and RUM config.

Related guides

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