Skip to content

Commit dbd74f6

Browse files
Add details on error upon starting GraalVM native image built with Spring Native (#32562)
* Add details on error upon starting GraalVM native image built with Spring Native * Fix Paketo Spring Native build crash Adds a troubleshooting section for an `exec.d/toggle` error in Spring Native builds. Documents the `BP_NATIVE_IMAGE=true` workaround. --------- Co-authored-by: Brett Blue <[email protected]>
1 parent 631551b commit dbd74f6

File tree

1 file changed

+35
-0
lines changed
  • content/en/tracing/trace_collection/compatibility

1 file changed

+35
-0
lines changed

content/en/tracing/trace_collection/compatibility/java.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,41 @@ paketo-buildpacks_datadog/helper/exec.d/toggle': exit status 1
421421

422422
The solution to this issue is to upgrade to version 4.6.0 or later.
423423

424+
##### Spring Native build crashes with exec.d/toggle error
425+
426+
You may encounter a similar error as the one above, even on buildpack versions newer than 4.6.0, when building a Spring Boot native image:
427+
428+
```text
429+
disabling Datadog at launch time is unsupported for Node
430+
ERROR: failed to launch: exec.d: failed to execute exec.d file at path '/layers
431+
paketo-buildpacks_datadog/helper/exec.d/toggle': exit status 1
432+
```
433+
434+
This typically happens because the Datadog buildpack runs before the native image buildpack, so it doesn't know a native image build is intended. It incorrectly adds a toggle script meant for JVM builds, which is incompatible with the final native executable.
435+
436+
The solution is to explicitly set the `BP_NATIVE_IMAGE` environment variable to `true` in the `spring-boot-maven-plugin` configuration. This ensures all buildpacks are aware it's a native image build from the start.
437+
438+
```yaml
439+
<build>
440+
<plugins>
441+
<plugin>
442+
<groupId>org.springframework.boot</groupId>
443+
<artifactId>spring-boot-maven-plugin</artifactId>
444+
<configuration>
445+
<image>
446+
...
447+
<env>
448+
...
449+
<BP_NATIVE_IMAGE>true</BP_NATIVE_IMAGE>
450+
...
451+
</env>
452+
</image>
453+
</configuration>
454+
</plugin>
455+
</plugins>
456+
</build>
457+
```
458+
424459
##### Problem activating Datadog tracer
425460

426461
You might encounter initialization errors if your tracer configuration relies on Unix Domain Sockets (UDS), which are not supported in native images:

0 commit comments

Comments
 (0)