Update BlobStore: BlobStore: update failed for id singleton: error: invalidPatch | Missing or invalid '@type' property in object | Properties: accessKey

Your question

When migrating using this document: stalwart/UPGRADING/v0_16.md at main · stalwartlabs/stalwart · GitHub,
I exported the configuration with migrate_v016.py and then tried importing it using stalwart-cli apply --file export.json, which resulted in an error:

{“@type”: “update”, “object”: “BlobStore”, “value”: {“@type”: “S3”, “bucket”: “xxxx”, “accessKey”: “xxx”, “secretKey”: {“@type”: “Value”, “secret”: “xxx”}, “securityToken”: {“@type”: “None”}, “maxRetries”: 3, “timeout”: 15000, “region”: {“@type”: “Custom”, “customEndpoint”: “tos-s3-123.com”, “customRegion”: “cn-hongkong”}}}

✗ update BlobStore: BlobStore: update failed for id singleton: error: invalidPatch | Missing or invalid ‘@type’ property in object | Properties: accessKey
Done: 0 destroyed, 1 updated, 9 created (1 failed)
error: BlobStore: update failed for id singleton: error: invalidPatch | Missing or invalid ‘@type’ property in object | Properties: accessKey

Is there a bug in the migrate_v016.py script?

  • The accessKey type is PublicStringOptional (None/Value/EnvironmentVariable/File). For the Value variant, the field name should be “value” (not “secret”).
  • In the migration script, _build_s3 at line 1574 directly assigns a plain string to body[“accessKey”] = ak, without wrapping it as {“@type”:“Value”,“value”:…}, causing the “Missing @type” error during patching.
  • secretKey uses SecretKeyValue (field “secret”), so {“@type”:“Value”,“secret”:…} works; however, accessKey must use PublicStringValue (field “value”).

I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.

on

The script was outdated, the accessKey property is no longer a string. The script has been fixed.