TestProject Forum

Docker Auto Agent Registration

Hi,

we want to automatically register the Agent instance with my TestProject Account in docker (with host system macOS).

Following your https://hub.docker.com/r/testproject/agent it should be able running this command:

$ docker run --name testproject-agent \
    -e TP_API_KEY="REPLACE_WITH_YOUR_KEY" \
    -e TP_AGENT_ALIAS="My First Agent" \
    testproject/agent:latest

Unfortunately, we receive following response after running this command:

Using Agent Alias: Patrick's Docker Agent
Failed obtaining agent configuration!
Error code: 401
Request ID: ICV20Sww
Error message: N/A

A manual registration seems to work (but we want to use a docker-compose file without manual interaction).

Kind regards,
Patrick

Hello @patrick.teufel,

Please remove the TP_AGENT_ALIAS, if an Agent with this alias is already exists you won’t be able to add a new one.
You can also try to generate a new API key from https://app.testproject.io/#/integrations/api.

1 Like

Hello @guy.saban,

Thanks for your quick response!

The API key was the problem. We didn’t read your documentation carefully and used the SDK-Developer-Token instead of the API key.

Problem solved!