Repository navigation
Conversation
When the engine names DAGGER_FUNCTION_ERROR_PATH, the dispatcher writes the
function's error there as {"message", "values"}: the full message, origins
kept, and the extensions of the GraphQL error it is or wraps, verbatim. The
engine fails the call with that error and shows it, so the dispatcher prints
no marker and no full stack trace: an API error whose origin the engine
shows prints nothing, and any other error a short stack trace of the
module's own frames, without origins. Without the variable, or when the file
can't be written, the marker stays as the fallback for older engines.
The generated entrypoint raises the exec error as it is when it carries the
report the engine read (functionError), and declares prebuild, the jar every
call runs, so the engine builds it under a "build <module>" span.
The jar's build runs Maven quietly in an exec of its own, so a failed build
shows the compiler's errors under "mvn package", not a shell script's
"exit code: 1".
Signed-off-by: Alex Suraci <alex@dagger.io>
vito
added a commit
to dagger/dagger
that referenced
this pull request
Nov 22, 2026
Pin java-sdk to dagger/java-sdk#47 (344e6cf) and regenerate the Java fixture. Its dispatcher writes a function's error to the engine's DAGGER_FUNCTION_ERROR_PATH, its entrypoint raises the exec error that carries it as it is, and it declares prebuild, so its build runs under the "build viztest-java" span. The clients/sdk-dep client is kept as it was: generation from this checkout re-targets it at a git ref of this branch. Goldens: - fail-native: a short stack trace, the exception and the user's one frame, as Python shows one. - fail-exec-wrapped (today's output, not a target): the cause chain, each part through the user's frame only, and no marker, traceparents or "call module entrypoint" row. - broken-default: the build fails in its own "mvn package" exec, which shows Maven's quiet errors, the compiler's among them, in place of the "[label TBD]" placeholder. The compiler's line is [97,1]. Every sdks-java golden passes. Signed-off-by: Alex Suraci <alex@dagger.io>
The engine reads a function error report whose message is empty as plain text, so a blank message is reported as the error's type, as a missing one is. The e2e error check asserts the function's own text only: an engine that gives the dispatcher an error file reports it without the "call module entrypoint: " prefix older engines add. The dispatcher tests ignore what OpenTelemetry logs on stderr when an earlier test shut its SDK down. Signed-off-by: Alex Suraci <alex@dagger.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on dagger/dagger#15249, the engine side: the function error file (
DAGGER_FUNCTION_ERROR_PATH) and thebuild <module>span around an entrypoint'sprebuild. On engines without them, nothing changes: the dispatcher falls back to the::dagger-function-error::marker, andprebuildis only a member they may build ahead of a call.This is the Java counterpart of dagger/go-sdk#113 and dagger/python-sdk#93. It is pinned by the Java goldens in
dagql/idtui(TestTelemetry/TestGolden/sdks-java-*), which all pass against it.The error file. When the engine sets
DAGGER_FUNCTION_ERROR_PATH,ModuleDispatcher.engineCallwrites the function's error there as{"message": ..., "values": {...}}:messageis the error's full message, with the[traceparent:…]origins it names, so the engine finds the call that failed;valuesare the extensions of the GraphQL error the exception is or wraps (its cause chain), verbatim, such as an ExecError'sexitCode,stdout,stderrandcmd;It then prints no marker and no full stack trace. If the variable is unset or the file can't be written, the old behaviour (full stack trace, then the marker) stays.
Stack traces. With the file:
DaggerQueryException) whose message names an origin prints nothing: the engine shows the failed call with its own logs;The generated entrypoint.
raiseFunctionErrorraises the exec error as it is when it carriesfunctionError, the report the engine read.prebuild(platform: Platform): File!, the jar every call runs, so the engine builds it ahead of the call under abuild <module>span. The call builds the same recipe, so it hits the cache.The build (
entrypoint/build.dang.tmpl). Maven now runs in an exec of its own,mvn package [-Ddagger.proc=full] -DskipTests --quiet --threads 1C --no-transfer-progress, instead of inside onesh -cscript with the staleness comparison. The comparison runs in its own exec after it. So a broken module's build shows as:where it used to show the script's
withExec sh -c 'set -e…'withexit code: 1and none of the compiler's output.--quietkeeps a successful build silent and a failed one to Maven's errors.Tests:
ModuleDispatcherTestcovers the report, the values, the short traces, the fallback and the shortening;DangEntrypointRendererTestcoversprebuildand thefunctionErrorgate.dagger check packager:unit-testspasses. The e2eerrorChecknow asserts the function's own text only, since an engine with the error file drops thecall module entrypoint:prefix; a blank exception message is reported as the exception's type, as the engine takes an empty report message for plain text. The e2e checks couldn't run in my sandbox (they need a published engine image of the CLI's version).