{"record":{"id":"937304f59ad4d9aa","repo":"anomalyco/sst","slug":"failed-to-parse-properties-w","errorCode":null,"errorMessage":"failed to parse properties: %w","messagePattern":"failed to parse properties: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/runtime/python/build.go","lineNumber":631,"sourceCode":"\t// uv export is fast (~300ms, no network/installs) so we run it per function\n\t// rather than caching. The .deps disk cache handles the expensive uv pip install.\n\tif err := runUvExport(ctx, exportCmd); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\n// inputProperties represents the input properties structure\ntype inputProperties struct {\n\tArchitecture string `json:\"architecture\"`\n}\n\n// parseInputProperties parses the input properties JSON\nfunc parseInputProperties(input *runtime.BuildInput) (*inputProperties, error) {\n\tvar props inputProperties\n\tif err := json.Unmarshal(input.Properties, &props); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to parse properties: %w\", err)\n\t}\n\n\treturn &props, nil\n}\n\nfunc installDependenciesForLambda(ctx context.Context, input *runtime.BuildInput, projectInfo *projectInfo, architecture string) error {\n\tif err := copySourceFilesSimple(input, projectInfo); err != nil {\n\t\treturn fmt.Errorf(\"failed to copy source files: %w\", err)\n\t}\n\n\t// Container builds: Dockerfile handles deps; zip builds: install here\n\tif input.IsContainer {\n\t\tif err := copyWorkspacePackagesForContainer(input, projectInfo); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to copy workspace packages for container: %w\", err)\n\t\t}\n\t} else {\n\t\tif err := copySyncedDependencies(ctx, input, projectInfo, architecture); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to copy synced dependencies: %w\", err)","sourceCodeStart":613,"sourceCodeEnd":649,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/pkg/runtime/python/build.go#L613-L649","documentation":"parseInputProperties unmarshals the runtime's Properties JSON blob into inputProperties (e.g. architecture, runtime settings). This error means that JSON is invalid or not shaped as expected, so the build can't read its configuration.","triggerScenarios":"json.Unmarshal(input.Properties, &props) fails: Properties is empty/nil when the caller expected an object, is truncated, or contains a JSON type mismatch (e.g. a string where an object/array is expected) — typically produced by an older or incompatible CLI/platform pairing.","commonSituations":"Running a stale sst CLI against a newly built platform (or vice versa) so the properties contract changed; hand-edited or corrupted build state; calling the runtime build path programmatically with Properties left unset.","solutions":["Rebuild and redeploy with matching CLI and platform versions (git pull, bun run build:platform / build:cli)","Inspect input.Properties at the failure point (log it) to see the malformed JSON and fix the producer","Ensure any programmatic caller marshals a valid inputProperties object into Properties before invoking the build","Clean stale build artifacts (.sst) so a regenerated, valid properties blob is used"],"exampleFix":"// before (caller leaves Properties empty)\nruntime.BuildInput{Properties: nil}\n// after\nprops, _ := json.Marshal(inputProperties{Architecture: \"x86_64\"})\nruntime.BuildInput{Properties: props}","handlingStrategy":"type-guard","validationCode":"if len(input.Properties) == 0 {\n\treturn errors.New(\"Properties is empty; marshal an inputProperties object\")\n}\nif !json.Valid(input.Properties) {\n\treturn errors.New(\"Properties is not valid JSON\")\n}","typeGuard":"func validInputProperties(raw json.RawMessage) (*inputProperties, bool) {\n\tvar p inputProperties\n\tif err := json.Unmarshal(raw, &p); err != nil {\n\t\treturn nil, false\n\t}\n\treturn &p, true\n}","tryCatchPattern":"props, err := parseInputProperties(input)\nif err != nil {\n\tlog.Printf(\"Properties blob: %s\", string(input.Properties)) // diagnose shape\n\treturn fmt.Errorf(\"upgrade cli+platform to matching versions: %w\", err)\n}","preventionTips":["Keep CLI and platform builds in lockstep (rebuild both after pulling)","Never hand-edit cached .sst build state","Always set Properties via json.Marshal of inputProperties when calling programmatically","Clear .sst after version upgrades so stale blobs aren't reused"],"tags":["json","serialization","python","build"],"backgroundTag":"json-unmarshal-failed","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}