{"record":{"id":"529050e5719bee10","repo":"ory/hydra","slug":"failed-to-evaluate-jsonnet","errorCode":null,"errorMessage":"failed to evaluate jsonnet","messagePattern":"failed to evaluate jsonnet","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"oryx/jsonnetsecure/cmd.go","lineNumber":60,"sourceCode":"\t\t\t\treturn errors.Wrap(err, \"failed to apply empty landlock sandbox\")\n\t\t\t}\n\n\t\t\t// This could fail because current limits are lower than what we tried to set,\n\t\t\t// so we still continue in this case.\n\t\t\tSetVirtualMemoryLimit(virtualMemoryLimitBytes)\n\n\t\t\tif null {\n\t\t\t\treturn scan(cmd.OutOrStdout(), cmd.InOrStdin())\n\t\t\t}\n\n\t\t\tinput, err := io.ReadAll(cmd.InOrStdin())\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrap(err, \"failed to read from stdin\")\n\t\t\t}\n\n\t\t\tjson, err := eval(input)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrap(err, \"failed to evaluate jsonnet\")\n\t\t\t}\n\n\t\t\tif _, err := io.WriteString(cmd.OutOrStdout(), json); err != nil {\n\t\t\t\treturn errors.Wrap(err, \"failed to write json output\")\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t}\n\tcmd.Flags().BoolVarP(&null, \"null\", \"0\", false,\n\t\t`Read multiple snippets and parameters from stdin separated by null bytes.\nOutput will be in the same order as inputs, separated by null bytes.\nEvaluation errors will also be reported to stdout, separated by null bytes.\nNon-recoverable errors are written to stderr and the program will terminate with a non-zero exit code.`)\n\n\treturn cmd\n}\n\nfunc scan(w io.Writer, r io.Reader) error {","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/ory/hydra/blob/4174065ffb052799890f7480f5360a877a67ffc1/oryx/jsonnetsecure/cmd.go#L42-L78","documentation":"Returned by the jsonnet CLI's RunE when evaluating the stdin snippet with the Jsonnet VM fails. This is a user-content error: the snippet has a syntax error, unknown variable, or exceeds limits; the wrapped error carries the Jsonnet diagnostics with line/column info.","triggerScenarios":"Thrown at oryx/jsonnetsecure/cmd.go:60 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the wrapped Jsonnet error for the exact snippet location and fix the snippet","Validate/compile user-supplied jsonnet before sending it to the worker","If caused by resource limits, reduce snippet complexity or raise the memory limit"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4174065ffb052799890f7480f5360a877a67ffc1","analyzedAt":"2026-09-03T14:52:41.581Z","contentChangedAt":"2026-09-03T14:52:41.581Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}