ArangoDB "not authorized to execute this request" (401) in CI
ArangoDB returns HTTP 401 with "not authorized to execute this request" when a request lacks valid credentials. In CI this usually means the driver did not send the root password set by ARANGO_ROOT_PASSWORD, or sent the wrong one.
What this error means
A request fails with "not authorized to execute this request" and HTTP status 401, even though the server is reachable on 8529.
{"error":true,"errorMessage":"not authorized to execute this request",
"code":401,"errorNum":11}Common causes
The driver did not send the root password
The container set ARANGO_ROOT_PASSWORD, but the driver connected with no password or an empty one.
Mismatched credentials between container and client
The password the container was initialized with differs from what the driver uses.
How to fix it
Set the root password and pass it to the driver
- Define
ARANGO_ROOT_PASSWORDon the service container. - Pass the same password in the driver connection.
- Keep both in one CI secret.
services:
arangodb:
image: arangodb:3.12
env:
ARANGO_ROOT_PASSWORD: password
ports: ['8529:8529']Authenticate the driver with matching credentials
Provide the root user and password the container expects.
const db = new Database({
url: "http://127.0.0.1:8529",
auth: { username: "root", password: "password" },
});How to prevent it
- Set
ARANGO_ROOT_PASSWORDand reuse it in the driver. - Store the root password in a CI secret.
- Do not rely on a blank root password.