{"record":{"id":"f9731dd38f5a08a9","repo":"toeverything/AFFiNE","slug":"failed-to-load-server-config","errorCode":null,"errorMessage":"Failed to load server config","messagePattern":"Failed to load server config","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/frontend/core/src/modules/cloud/entities/server.ts","lineNumber":51,"sourceCode":"  });\n\n  readonly serverConfigStore = this.scope.framework.get(ServerConfigStore);\n  readonly fetch = this.scope.framework.get(FetchService).fetch;\n  readonly gql = this.scope.framework.get(GraphQLService).gql;\n  get account$() {\n    return this.scope.framework.get(AuthService).session.account$;\n  }\n  readonly serverMetadata = this.props.serverMetadata;\n\n  constructor(private readonly serverListStore: ServerListStore) {\n    super();\n  }\n\n  readonly config$ = LiveData.from<ServerConfig>(\n    this.serverListStore.watchServerConfig(this.serverMetadata.id).pipe(\n      map(config => {\n        if (!config) {\n          throw new Error('Failed to load server config');\n        }\n        return config;\n      })\n    ),\n    null as any\n  );\n\n  readonly isConfigRevalidating$ = new LiveData(false);\n\n  readonly features$ = this.config$.map(config => {\n    return Array.from(new Set(config.features)).reduce((acc, cur) => {\n      acc[cur.toLowerCase() as LowercaseServerFeature] = true;\n      return acc;\n    }, {} as ServerFeatureRecord);\n  });\n\n  readonly credentialsRequirement$ = this.config$.map(config => {\n    return config ? config.credentialsRequirement : null;","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/packages/frontend/core/src/modules/cloud/entities/server.ts#L33-L69","documentation":"Emitted through the Server entity's config$ LiveData stream when watchServerConfig has no stored config for the server metadata id — the server's configuration could not be loaded from local storage, so server-dependent features lack their config.","triggerScenarios":"Thrown in the Server entity's config$ LiveData when watchServerConfig yields no config for the server id, so server configuration is unavailable.","commonSituations":"Seen when a configured self-hosted server cannot be reached or its config fetch fails. Verify the server URL and connectivity, or re-add the server.","solutions":["Check the server base URL and network connectivity, then retry.","Verify the server is running a compatible AFFiNE backend."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b4c8548c09da21b2898443559a5b846f0ccf5dd8","analyzedAt":"2026-08-18T21:16:52.546Z","contentChangedAt":"2026-08-18T21:16:52.546Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}