Skip to content

[BUG] Running serverless-init without configuration spams logs #48036

Description

@Daniel-I-Am

Agent version

serverless-init:1.9.6-alpine

Bug Report

When using the 'serverless-init' without configuration, it used to silently deactivate itself. This would allow the same container to be used in production (using the serverless-init) and also on development (either without tracing or with a dedicated agent available and DD_AGENT_HOST set).

This is now causing many errors in the logs.

Reproduction Steps

Here's a sample Dockerfile which just sleeps forever instrumented by Datadog. Build it and run it.

$ cat Dockerfile
FROM    alpine:3.23

ENV     DD_SITE=datadoghq.eu

COPY --from=datadog/serverless-init:1.9.6-alpine /datadog-init /datadog/datadog-init

ENTRYPOINT ["/datadog/datadog-init"]

CMD ["sleep inf"]
$ docker build .
[+] Building 0.5s (8/8) FINISHED                                                                        docker:default
 => [internal] load build definition from Dockerfile                                                              0.0s
 => => transferring dockerfile: 240B                                                                              0.0s
 => [internal] load metadata for docker.io/datadog/serverless-init:1.9.6-alpine                                   0.4s
 => [internal] load metadata for docker.io/library/alpine:3.23                                                    0.0s
 => [internal] load .dockerignore                                                                                 0.0s
 => => transferring context: 2B                                                                                   0.0s
 => FROM docker.io/datadog/serverless-init:1.9.6-alpine@sha256:367a6d6b6a9b85144f712ed3c49e857c5ed248f9b144f3714  0.0s
 => [stage-0 1/2] FROM docker.io/library/alpine:3.23                                                              0.0s
 => CACHED [stage-0 2/2] COPY --from=datadog/serverless-init:1.9.6-alpine /datadog-init /datadog/datadog-init     0.0s
 => exporting to image                                                                                            0.0s
 => => exporting layers                                                                                           0.0s
 => => writing image sha256:127d7637f0a2aa6970901494dfc81b6e825dc25a9ba64e99c977547578581bbd                      0.0s
$ docker run --rm -it sha256:127d7637f0a2aa6970901494dfc81b6e825dc25a9ba64e99c977547578581bbd
2026-03-19 10:23:33 UTC | SERVERLESS_INIT | ERROR | Unable to load trace agent config: you must specify an API Key, either via a configuration file or the DD_API_KEY env var
2026-03-19 10:23:36 UTC | SERVERLESS_INIT | ERROR | API Key invalid (403 response), dropping transaction for https://7-76-1-app.agent.datadoghq.eu./api/v1/series
2026-03-19 10:23:39 UTC | SERVERLESS_INIT | ERROR | API Key invalid (403 response), dropping transaction for https://7-76-1-app.agent.datadoghq.eu./api/v1/series
2026-03-19 10:23:42 UTC | SERVERLESS_INIT | ERROR | API Key invalid (403 response), dropping transaction for https://7-76-1-app.agent.datadoghq.eu./api/v1/series
2026-03-19 10:23:42 UTC | SERVERLESS_INIT | ERROR | API Key invalid (403 response), dropping transaction for https://7-76-1-app.agent.datadoghq.eu./api/beta/sketches
2026-03-19 10:23:43 UTC | SERVERLESS_INIT | ERROR | Workloadmeta collectors are not ready after 18 retries: workloadmeta not initialized, starting check scheduler controller anyway.
2026-03-19 10:23:45 UTC | SERVERLESS_INIT | ERROR | API Key invalid (403 response), dropping transaction for https://7-76-1-app.agent.datadoghq.eu./api/v1/series
2026-03-19 10:23:48 UTC | SERVERLESS_INIT | ERROR | API Key invalid (403 response), dropping transaction for https://7-76-1-app.agent.datadoghq.eu./api/v1/series
2026-03-19 10:23:51 UTC | SERVERLESS_INIT | ERROR | API Key invalid (403 response), dropping transaction for https://7-76-1-app.agent.datadoghq.eu./api/v1/series
2026-03-19 10:23:54 UTC | SERVERLESS_INIT | ERROR | API Key invalid (403 response), dropping transaction for https://7-76-1-app.agent.datadoghq.eu./api/v1/series
2026-03-19 10:23:57 UTC | SERVERLESS_INIT | ERROR | API Key invalid (403 response), dropping transaction for https://7-76-1-app.agent.datadoghq.eu./api/v1/series
2026-03-19 10:24:00 UTC | SERVERLESS_INIT | ERROR | API Key invalid (403 response), dropping transaction for https://7-76-1-app.agent.datadoghq.eu./api/v1/series
2026-03-19 10:24:03 UTC | SERVERLESS_INIT | ERROR | API Key invalid (403 response), dropping transaction for https://7-76-1-app.agent.datadoghq.eu./api/v1/series
2026-03-19 10:24:06 UTC | SERVERLESS_INIT | ERROR | API Key invalid (403 response), dropping transaction for https://7-76-1-app.agent.datadoghq.eu./api/v1/series
2026-03-19 10:24:09 UTC | SERVERLESS_INIT | ERROR | API Key invalid (403 response), dropping transaction for https://7-76-1-app.agent.datadoghq.eu./api/v1/series
2026-03-19 10:24:13 UTC | SERVERLESS_INIT | ERROR | API Key invalid (403 response), dropping transaction for https://7-76-1-app.agent.datadoghq.eu./api/v1/series
2026-03-19 10:24:15 UTC | SERVERLESS_INIT | ERROR | API Key invalid (403 response), dropping transaction for https://7-76-1-app.agent.datadoghq.eu./api/v1/series
2026-03-19 10:24:18 UTC | SERVERLESS_INIT | ERROR | API Key invalid (403 response), dropping transaction for https://7-76-1-app.agent.datadoghq.eu./api/v1/series
2026-03-19 10:24:21 UTC | SERVERLESS_INIT | ERROR | API Key invalid (403 response), dropping transaction for https://7-76-1-app.agent.datadoghq.eu./api/v1/series
2026-03-19 10:24:24 UTC | SERVERLESS_INIT | ERROR | API Key invalid (403 response), dropping transaction for https://7-76-1-app.agent.datadoghq.eu./api/v1/series
2026-03-19 10:24:27 UTC | SERVERLESS_INIT | ERROR | API Key invalid (403 response), dropping transaction for https://7-76-1-app.agent.datadoghq.eu./api/v1/series
2026-03-19 10:24:30 UTC | SERVERLESS_INIT | ERROR | API Key invalid (403 response), dropping transaction for https://7-76-1-app.agent.datadoghq.eu./api/v1/series
2026-03-19 10:24:33 UTC | SERVERLESS_INIT | ERROR | API Key invalid (403 response), dropping transaction for https://7-76-1-app.agent.datadoghq.eu./api/v1/series

Going back to version 1.8.2 or earlier, does not lead to the same results.

Agent configuration

none relevant

Operating System

Linux x86_64

Other environment details

Docker

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions