{"record":{"id":"9971d0e4c0756181","repo":"hcengineering/platform","slug":"invalid-space-configuration-in-spacename-mes","errorCode":null,"errorMessage":"Invalid space configuration in ${spaceName}: ${message}","messagePattern":"Invalid space configuration in (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/importer/src/huly/huly.ts","lineNumber":406,"sourceCode":"              await this.processControlledDocumentsRecursively(builder, spacePath, spacePath)\n            }\n            break\n          }\n\n          case core.class.Enum:\n          case core.class.Association:\n          case card.class.MasterTag: {\n            this.logger.log(`Skipping ${spaceName}: will be processed later`)\n            break\n          }\n\n          default: {\n            throw new Error(`Unknown space class ${spaceConfig.class} in ${spaceName}`)\n          }\n        }\n      } catch (error) {\n        const message = error instanceof Error ? error.message : String(error)\n        throw new Error(`Invalid space configuration in ${spaceName}: ${message}`)\n      }\n    }\n\n    const { docs, mixins, updates, files } = await this.cardsProcessor.processDirectory(folderPath)\n\n    const ws = builder.build()\n    ws.unifiedDocs = {\n      docs: Array.from(docs.values()).flat(),\n      mixins: Array.from(mixins.values()).flat(),\n      updates: Array.from(updates.values()).flat(),\n      files: Array.from(files.values())\n    }\n    return ws\n  }\n\n  private async processIssuesRecursively (\n    builder: ImportWorkspaceBuilder,\n    projectIdentifier: string,","sourceCodeStart":388,"sourceCodeEnd":424,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/packages/importer/src/huly/huly.ts#L388-L424","documentation":"This is the wrapping error produced by the catch block around per-space processing in processImportFolder. Any failure while parsing or processing a space's YAML config (including the 'Unknown space class' throw) is re-thrown with `Invalid space configuration in <spaceName>: <original message>` so the failing space is identified. The nested message after the colon is the root cause.","triggerScenarios":"workspaceData triggers processImportFolder on a folder where reading/parsing a top-level .yaml space file fails — malformed YAML, a schema mismatch when cast to HulySpaceSettings, or an unknown space class thrown inside the try block.","commonSituations":"A space YAML edited by hand with broken indentation or tabs; a missing required field in the space config; an unsupported class value; YAML that parses but does not match the expected HulySpaceSettings shape.","solutions":["Read the nested message after the colon to identify the root cause","Fix the underlying problem in <spaceName>.yaml (unknown class, bad YAML, missing fields)","Validate the YAML syntax with a YAML linter/parser before re-running the import","Compare the file against a working Huly export's space YAML for the correct schema"],"exampleFix":"// message you see\nInvalid space configuration in MyProject: Unknown space class tracker.class.Projet in MyProject\n// fix the root cause in MyProject.yaml\nclass: tracker.class.Project","handlingStrategy":"try-catch","validationCode":"for (const f of spaceYamlFiles(folder)) {\n  try { yaml.load(fs.readFileSync(f, 'utf8')) } catch (e) { throw new Error(`${f} is not valid YAML: ${e}`) }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await importer.workspaceData(folder)\n} catch (e) {\n  const m = e instanceof Error ? e.message : String(e)\n  const match = m.match(/Invalid space configuration in (.+?): (.+)/)\n  if (match) console.error(`Space \"${match[1]}\" failed: ${match[2]}`)\n  else throw e\n}","preventionTips":["Parse the wrapped message after the colon to find the root cause file","Validate YAML syntax and schema of every space config before import","Fix the nested root cause, not the wrapper itself","Test imports on a copy of the folder first"],"tags":["importer","yaml-config","wrapped-error"],"backgroundTag":"invalid-configuration-file","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}