{"record":{"id":"cd458faaf3ead0a3","repo":"stride3d/stride","slug":"assets-names-cannot-have-empty-spaces-before-or-after-the","errorCode":null,"errorMessage":"Assets names cannot have empty spaces before or after the name. Please rename [{0}] and compile again.","messagePattern":"Assets names cannot have empty spaces before or after the name\\. Please rename \\[(.+?)\\] and compile again\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/core/Stride.Core.Serialization/Serialization/Contents/ContentIndexMap.cs","lineNumber":125,"sourceCode":"        {\n            line = line.Trim();\n            if (line.Length == 0 || line.StartsWith('#'))\n                continue;\n\n            var match = regexEntry.Match(line);\n            if (!match.Success)\n            {\n                throw new InvalidOperationException(\"Unable to read asset index entry [{0}]. Expecting: [path objectId]\".ToFormat(line));\n            }\n\n            var url = match.Groups[1].Value;\n            var objectIdStr = match.Groups[2].Value;\n\n            // Test if the name has leading or ending spaces\n            var matchSpace = regexEntrySpace.Match(line);\n            if (matchSpace.Success && !matchSpace.Groups[1].Value.Equals(url))\n            {\n                throw new InvalidOperationException(\"Assets names cannot have empty spaces before or after the name. Please rename [{0}] and compile again.\".ToFormat(matchSpace.Groups[1].Value));\n            }\n\n            if (!ObjectId.TryParse(objectIdStr, out var objectId))\n            {\n                throw new InvalidOperationException(\"Unable to decode objectid [{0}] when reading asset index\".ToFormat(objectIdStr));\n            }\n\n            var entry = new KeyValuePair<string, ObjectId>(url, objectId);\n            entries.Add(entry);\n        }\n        return entries;\n    }\n\n    protected override void WriteEntry(Stream localStream, KeyValuePair<string, ObjectId> value)\n    {\n        ArgumentNullException.ThrowIfNull(localStream);\n\n        var line = $\"{value.Key} {value.Value}\\n\";","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/core/Stride.Core.Serialization/Serialization/Contents/ContentIndexMap.cs#L107-L143","documentation":"Data validation in ContentIndexMap.ReadEntries: a line in the asset index map file matched the entry pattern, but the regexSpace test found leading/trailing whitespace around the asset url. Asset names must not have surrounding spaces, so the corrupted entry aborts loading of the index map.","triggerScenarios":"Thrown at sources/core/Stride.Core.Serialization/Serialization/Contents/ContentIndexMap.cs:125 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Open the index map file and remove leading/trailing spaces from the offending asset url","Regenerate/recompile the index map so entries are written without whitespace","Sanitize urls at asset-creation time to reject names containing surrounding spaces"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}