{"record":{"id":"ff9c6d2c9b7be0c1","repo":"stride3d/stride","slug":"unable-to-decode-url-reference-0-expecting-format-guid","errorCode":null,"errorMessage":"Unable to decode url reference [{0}]. Expecting format GUID:LOCATION","messagePattern":"Unable to decode url reference \\[(.+?)\\]\\. Expecting format GUID:LOCATION","errorType":"exception","errorClass":"YamlException","httpStatus":null,"severity":"error","filePath":"sources/assets/Stride.Core.Assets/Serializers/UrlReferenceSerializer.cs","lineNumber":26,"sourceCode":"\nnamespace Stride.Core.Assets.Serializers;\n\n/// <summary>\n/// A Yaml serializer for <see cref=\"UrlReference\"/>\n/// </summary>\n[YamlSerializerFactory(YamlAssetProfile.Name)]\ninternal class UrlReferenceSerializer : AssetScalarSerializerBase\n{\n    public override bool CanVisit(Type type)\n    {\n        return UrlReferenceBase.IsUrlReferenceType(type);\n    }\n\n    public override object ConvertFrom(ref ObjectContext context, Scalar fromScalar)\n    {\n        if (!AssetReference.TryParse(fromScalar.Value, out var guid, out var location))\n        {\n            throw new YamlException(fromScalar.Start, fromScalar.End, \"Unable to decode url reference [{0}]. Expecting format GUID:LOCATION\".ToFormat(fromScalar.Value));\n        }\n\n        return UrlReferenceBase.New(context.Descriptor.Type, guid, ReferenceSerializationHelper.RestoreLocation(ref context, location.FullPath));\n    }\n\n    public override string ConvertTo(ref ObjectContext objectContext)\n    {\n        if (objectContext.Instance is UrlReferenceBase urlReference)\n        {\n            return ReferenceSerializationHelper.FormatReference(ref objectContext, urlReference.Id, urlReference.Url);\n        }\n\n        throw new YamlException($\"Unable to extract url reference from object [{objectContext.Instance}]\");\n    }\n}\n","sourceCodeStart":8,"sourceCodeEnd":42,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/assets/Stride.Core.Assets/Serializers/UrlReferenceSerializer.cs#L8-L42","documentation":"UrlReferenceSerializer.ConvertFrom deserializes UrlReference objects from YAML scalars of the form 'GUID:LOCATION' via AssetReference.TryParse. If the scalar does not contain a valid GUID followed by a colon and a location, deserialization aborts with this YamlException.","triggerScenarios":"Deserializing a YAML asset where a UrlReference-typed field contains a scalar missing the GUID part, missing the ':' separator, containing an invalid GUID, or an empty/whitespace value.","commonSituations":"Hand-editing asset YAML references; scripts writing URLs instead of GUID:LOCATION references; bad merges dropping the GUID portion; referencing an asset that was never saved (no GUID assigned).","solutions":["Rewrite the scalar as GUID:LOCATION using the referenced asset's identifier (e.g. '6c9a4b1e-...:myFolder/myTexture.png')","Get the correct GUID from the asset's meta/YAML in the same project","If only a plain URL is intended, use the appropriate non-reference field type instead of UrlReference","Re-link the reference in the Stride editor and re-save the asset"],"exampleFix":"// before\nUrl: myTexture.png\n// after\nUrl: 8f2a5c3e-1b4d-4a9c-b7e0-3d6f8a2c5e91:myTexture.png","handlingStrategy":"validation","validationCode":"if (AssetReference.TryParse(text, out var guid, out var location)) { proceed(guid, location); } else { report(text); }","typeGuard":"bool IsValidUrlReference(string? s) => s != null && AssetReference.TryParse(s, out _, out _);","tryCatchPattern":"try { LoadAsset(yaml); } catch (YamlException ex) when (ex.Message.Contains(\"Unable to decode url reference\")) { log.Error($\"Bad URL reference: {ex.Message}\"); throw; }","preventionTips":["Always write references as GUID:LOCATION pairs","Link references through the Stride editor instead of hand-editing","Validate reference format in CI with AssetReference.TryParse"],"tags":["yaml","deserialization","url-reference","guid"],"backgroundTag":"invalid-url-format","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}