{"record":{"id":"560e53378dfdbcdc","repo":"hcengineering/platform","slug":"unsupported-storage-kind-kind","errorCode":null,"errorMessage":"Unsupported storage kind:${kind}","messagePattern":"Unsupported storage kind:(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"foundations/server/packages/server-storage/src/starter.ts","lineNumber":108,"sourceCode":"    const c = config as S3Config\n    if (c.endpoint == null || c.accessKey == null || c.secretKey == null) {\n      throw new Error('One of endpoint/accessKey/secretKey values are not specified')\n    }\n    adapter = new S3Service(c)\n  } else if (kind === DATALAKE_CONFIG_KIND) {\n    const c = config as DatalakeConfig\n    if (c.endpoint == null) {\n      throw new Error('Endpoint value is not specified')\n    }\n    adapter = new DatalakeService(c)\n  } else if (kind === HULYLAKE_CONFIG_KIND) {\n    const c = config as HulylakeConfig\n    if (c.endpoint == null) {\n      throw new Error('Endpoint value is not specified')\n    }\n    adapter = new HulylakeService(c)\n  } else {\n    throw new Error('Unsupported storage kind:' + kind)\n  }\n\n  if (config.readonly === 'true') {\n    adapter = new ReadonlyStorageAdapter(adapter)\n  }\n\n  return adapter\n}\n\nexport function buildStorageFromConfig (config: StorageConfiguration): FallbackStorageAdapter {\n  return buildStorage(config, createStorageFromConfig)\n}\n","sourceCodeStart":90,"sourceCodeEnd":121,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/foundations/server/packages/server-storage/src/starter.ts#L90-L121","documentation":"createStorageFromConfig dispatches on config.kind and only supports the builtin (S3), DATALAKE_CONFIG_KIND and HULYLAKE_CONFIG_KIND branches. Any other kind value falls into the else clause, which throws 'Unsupported storage kind:<kind>'.","triggerScenarios":"Calling createStorageFromConfig with a config whose kind is not one of the supported constants — typo in kind string, kind field absent (kind === undefined), or a kind added by a newer plugin not supported by this server build.","commonSituations":"Typo like 'datalke' in config; missing kind field entirely; version mismatch where workspace config uses a storage kind the deployed server doesn't know.","solutions":["Set config.kind to a supported value (S3/builtin, datalake, or hulylake kind constant)","Log/print the actual kind value to spot typos or undefined","Upgrade the server if the config uses a newer storage kind","Validate kind against the supported list before calling"],"exampleFix":"// before\ncreateStorageFromConfig({ kind: 'datalke', endpoint: 'https://x' })\n// after\nconst SUPPORTED = ['s3', 'datalake', 'hulylake']\nif (!SUPPORTED.includes(config.kind)) throw new Error(`bad kind: ${config.kind}`)\ncreateStorageFromConfig({ kind: 'datalake', endpoint: 'https://x' })","handlingStrategy":"validation","validationCode":"const SUPPORTED_KINDS = ['s3', 'datalake', 'hulylake'] // match DATALAKE_CONFIG_KIND / HULYLAKE_CONFIG_KIND\nfunction assertSupportedKind(cfg) {\n  if (!SUPPORTED_KINDS.includes(cfg.kind)) {\n    throw new Error(`Unsupported storage kind '${cfg.kind}'; expected one of ${SUPPORTED_KINDS.join(', ')}`)\n  }\n}","typeGuard":"function isSupportedStorageConfig(c) {\n  return typeof c === 'object' && c !== null &&\n    ['s3', 'datalake', 'hulylake'].includes(c.kind)\n}","tryCatchPattern":"try {\n  adapter = createStorageFromConfig(cfg)\n} catch (e) {\n  if (e.message.startsWith('Unsupported storage kind:')) {\n    console.error(`Config kind '${cfg.kind}' not supported by this build; check typos or upgrade the server`)\n  }\n  throw e\n}","preventionTips":["Centralize kind constants and derive config parsing from them instead of free-form strings","Validate kind against the supported list at config load time","When adding a new storage kind, update both the config producers and the starter dispatch together"],"tags":["storage","configuration","dispatch"],"backgroundTag":"unsupported-config-value","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}