anomalyco/sst · error
failed to parse properties: %w
Error message
failed to parse properties: %w
What it means
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.
Source
Thrown at pkg/runtime/python/build.go:631
// uv export is fast (~300ms, no network/installs) so we run it per function
// rather than caching. The .deps disk cache handles the expensive uv pip install.
if err := runUvExport(ctx, exportCmd); err != nil {
return err
}
return nil
}
// inputProperties represents the input properties structure
type inputProperties struct {
Architecture string `json:"architecture"`
}
// parseInputProperties parses the input properties JSON
func parseInputProperties(input *runtime.BuildInput) (*inputProperties, error) {
var props inputProperties
if err := json.Unmarshal(input.Properties, &props); err != nil {
return nil, fmt.Errorf("failed to parse properties: %w", err)
}
return &props, nil
}
func installDependenciesForLambda(ctx context.Context, input *runtime.BuildInput, projectInfo *projectInfo, architecture string) error {
if err := copySourceFilesSimple(input, projectInfo); err != nil {
return fmt.Errorf("failed to copy source files: %w", err)
}
// Container builds: Dockerfile handles deps; zip builds: install here
if input.IsContainer {
if err := copyWorkspacePackagesForContainer(input, projectInfo); err != nil {
return fmt.Errorf("failed to copy workspace packages for container: %w", err)
}
} else {
if err := copySyncedDependencies(ctx, input, projectInfo, architecture); err != nil {
return fmt.Errorf("failed to copy synced dependencies: %w", err)View on GitHub (pinned to a0bd20f762)
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
Example fix
// before (caller leaves Properties empty)
runtime.BuildInput{Properties: nil}
// after
props, _ := json.Marshal(inputProperties{Architecture: "x86_64"})
runtime.BuildInput{Properties: props} Defensive patterns
Strategy: type-guard
Validate before calling
if len(input.Properties) == 0 {
return errors.New("Properties is empty; marshal an inputProperties object")
}
if !json.Valid(input.Properties) {
return errors.New("Properties is not valid JSON")
} Type guard
func validInputProperties(raw json.RawMessage) (*inputProperties, bool) {
var p inputProperties
if err := json.Unmarshal(raw, &p); err != nil {
return nil, false
}
return &p, true
} Try / catch
props, err := parseInputProperties(input)
if err != nil {
log.Printf("Properties blob: %s", string(input.Properties)) // diagnose shape
return fmt.Errorf("upgrade cli+platform to matching versions: %w", err)
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- Failed to parse JSON response: ${text}
- default Python Dockerfile not found at %s: %w
- failed to move extracted package: %w
- failed to create output directory: %w
- failed to copy %s to %s: %w
AI-assisted analysis of anomalyco/sst@a0bd20f762 (2026-08-30).
Data as JSON: /api/errors/937304f59ad4d9aa.
Report an issue: GitHub.