{"record":{"id":"68a41389ef7f995b","repo":"BoundaryML/baml","slug":"failed-to-get-start-time-w","errorCode":null,"errorMessage":"failed to get start time: %w","messagePattern":"failed to get start time: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/language_client_go/pkg/rawobjects_timing.go","lineNumber":30,"sourceCode":"\t*raw_objects.RawObject\n}\n\nfunc newTiming(ptr int64, rt unsafe.Pointer) Timing {\n\treturn &timing{raw_objects.FromPointer(ptr, rt)}\n}\n\nfunc (t *timing) ObjectType() cffi.BamlObjectType {\n\treturn cffi.BamlObjectType_OBJECT_TIMING\n}\n\nfunc (t *timing) pointer() int64 {\n\treturn t.RawObject.Pointer()\n}\n\nfunc (t *timing) StartTimeUTCMs() (int64, error) {\n\tresult, err := raw_objects.CallMethod(t, \"start_time_utc_ms\", nil)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to get start time: %w\", err)\n\t}\n\n\tstartTime, ok := result.(int64)\n\tif !ok {\n\t\treturn 0, fmt.Errorf(\"unexpected type for start time: %T\", result)\n\t}\n\n\treturn startTime, nil\n}\n\nfunc (t *timing) DurationMs() (*int64, error) {\n\tresult, err := raw_objects.CallMethod(t, \"duration_ms\", nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get duration: %w\", err)\n\t}\n\n\tif result == nil {\n\t\treturn nil, nil","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/language_client_go/pkg/rawobjects_timing.go#L12-L48","documentation":"timing.StartTimeUTCMs() calls the FFI method \"start_time_utc_ms\" on the underlying timing object. Errors from raw_objects.CallMethod are wrapped as \"failed to get start time: %w\". This signals the native BAML runtime failed to produce the start timestamp, typically because the underlying object handle is invalid or a runtime mismatch occurred.","triggerScenarios":"Calling StartTimeUTCMs() (via function log / LLM call timing accessors, e.g. in collectors or test harnesses) when the underlying \"start_time_utc_ms\" FFI call returns an error, such as an invalid or freed raw object pointer.","commonSituations":"Accessing timing info on a function log after the runtime was released; mismatched Go binding / native runtime versions; timing object not populated because the call failed before timing was recorded.","solutions":["Unwrap the wrapped error to find the native-side cause (invalid handle, method not found, etc.).","Ensure you access Timing only while the FunctionLog/LLMCall and its runtime are still valid.","Match the baml Go module version to your BAML native runtime version.","If timing is genuinely absent, treat a failed start-time read as missing metadata and skip it rather than failing the pipeline."],"exampleFix":"// before\nstartMs, err := timing.StartTimeUTCMs()\nif err != nil {\n    panic(err)\n}\n\n// after: tolerate missing timing metadata\nstartMs, err := timing.StartTimeUTCMs()\nif err != nil {\n    log.Printf(\"timing unavailable: %v\", err)\n    startMs = 0\n}","handlingStrategy":"try-catch","validationCode":"if timing == nil {\n    return errors.New(\"timing object is nil\")\n}","typeGuard":null,"tryCatchPattern":"startMs, err := timing.StartTimeUTCMs()\nif err != nil {\n    log.Printf(\"start time unavailable: %v\", err)\n    startMs = 0 // degrade instead of failing telemetry\n}","preventionTips":["Read timing metadata while the FunctionLog/LLMCall runtime is still alive.","Treat timing fields as optional telemetry; never let them crash pipelines.","Match baml Go binding and native runtime versions."],"tags":["go","ffi","timing"],"backgroundTag":"unexpected-response-shape","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}