Skip to content

Initialize creating conflict for Datadog #2575

@Zachary-Royals

Description

@Zachary-Royals

Product

BAML

Describe the bug

Here's the bug:

anic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x50 pc=0xf992ec]

goroutine 1 [running]:
github.com/DataDog/dd-trace-go/v2/instrumentation.(*Instrumentation).OperationName(0x20a71e0?, 0x4000112860?, 0x0)
/app/vendor/github.com/DataDog/dd-trace-go/v2/instrumentation/instrumentation.go:79 +0x1c
github.com/DataDog/dd-trace-go/contrib/net/http/v2/internal/orchestrion.init.func5(0x4000438b40?)
/app/vendor/github.com/DataDog/dd-trace-go/contrib/net/http/v2/internal/orchestrion/roundtrip.go:47 +0x2c
github.com/DataDog/dd-trace-go/contrib/net/http/v2/internal/wrap.ObserveRoundTrip(0x430eca0, 0x4000438b40)
/app/vendor/github.com/DataDog/dd-trace-go/contrib/net/http/v2/internal/wrap/roundtrip.go:40 +0x6c
github.com/DataDog/dd-trace-go/contrib/net/http/v2/internal/orchestrion.ObserveRoundTrip(0x0?)
/app/vendor/github.com/DataDog/dd-trace-go/contrib/net/http/v2/internal/orchestrion/roundtrip.go:21 +0x28
net/http.(*Transport).RoundTrip(0x4318d80, 0x2b57be0?)
:7 +0x44
net/http.send(0x4000438b40, {0x2b57be0, 0x4318d80}, {0x7604b8?, 0x8?, 0x0?})
/usr/local/go/src/net/http/client.go:259 +0x498
net/http.(*Client).send(0x4e12680, 0x4000438b40, {0x4000586cc8?, 0x5994dc?, 0x0?})
/usr/local/go/src/net/http/client.go:180 +0x94
net/http.(*Client).do(0x4e12680, 0x4000438b40)
/usr/local/go/src/net/http/client.go:728 +0x764
net/http.(*Client).Do(...)
/usr/local/go/src/net/http/client.go:587
net/http.(*Client).Get(0x4e12680, {0x40001803f0?, 0xffff8fbe0f30?})
/usr/local/go/src/net/http/client.go:484 +0x74
net/http.Get(...)
/usr/local/go/src/net/http/client.go:453
github.com/boundaryml/baml/engine/language_client_go/baml_go.downloadChecksum({0x40001803f0, 0x6d}, {0x40003dc270, 0x29})
/app/vendor/github.com/boundaryml/baml/engine/language_client_go/baml_go/lib.go:488 +0x5c
github.com/boundaryml/baml/engine/language_client_go/baml_go.downloadBamlLibrary({0x40003a9ba0, 0x1e}, {0x40003dc270, 0x29})
/app/vendor/github.com/boundaryml/baml/engine/language_client_go/baml_go/lib.go:403 +0x2f4
github.com/boundaryml/baml/engine/language_client_go/baml_go.findOrDownloadLibrary()
/app/vendor/github.com/boundaryml/baml/engine/language_client_go/baml_go/lib.go:257 +0x614
github.com/boundaryml/baml/engine/language_client_go/baml_go.initializeBaml()
/app/vendor/github.com/boundaryml/baml/engine/language_client_go/baml_go/lib.go:89 +0x30
github.com/boundaryml/baml/engine/language_client_go/baml_go.init.0.func1()
/app/vendor/github.com/boundaryml/baml/engine/language_client_go/baml_go/lib.go:72 +0x1c
sync.(*Once).doSlow(0x2800e25?, 0x46?)
/usr/local/go/src/sync/once.go:78 +0xf0
sync.(*Once).Do(...)
/usr/local/go/src/sync/once.go:69 error=network error fetching checksum https://github.com/boundaryml/baml/releases/download/0.207.0/libbaml_cffi-aarch64-unknown-linux-gnu.so.sha256: Get "https://github.com/boundaryml/baml/

Reproduction Steps

Build with similar logic:

FROM golang:1.24 AS build

WORKDIR /app

# Install build dependencies (Ubuntu uses apt-get, not apk)
RUN apt-get update && apt-get install -y \
    gcc \
    git \
    make \
    && rm -rf /var/lib/apt/lists/*


# Copy go mod and sum files
COPY go.mod go.sum ./
RUN go mod download

# Install Orchestrion for APM auto-instrumentation
# This enables zero-code-change Datadog APM integration
RUN go install github.com/DataDog/orchestrion@v1.4.0

# Copy the source code
COPY . .

# Pin Orchestrion dependencies and build the application
# Using the unified build target that automatically handles Datadog integration
RUN orchestrion pin && make clean && make enable_datadog=true build-unified

# Start a new stage from Ubuntu
FROM ubuntu:22.04 AS run


# Install CA certificates for HTTPS requests (needed for BAML library download)
RUN apt-get update && apt-get install -y \
    ca-certificates \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Copy the binary from build stage
COPY --from=build /app/api-service ./api-service

# Make sure the binary is executable
RUN chmod +x ./api-service

# Expose the port the app runs on
EXPOSE 8080

# Command to run the executable
CMD ["/app/api-service"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugconfirmed by the BAML team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions