toeverything/AFFiNE · error · Error
AFFiNE Cloud server not found
Error message
AFFiNE Cloud server not found
What it means
In the desktop auth-request event handler, thrown when an authentication request names a server (by base URL) that is not present in the servers registry and the AFFiNE Cloud default also cannot be resolved, so sign-in cannot proceed for that server.
Source
Thrown at packages/frontend/core/src/modules/desktop-api/service/desktop-api.ts:134
private setupAuthRequestEvent() {
this.events.ui.onAuthenticationRequest(({ method, payload, server }) => {
(async () => {
if (!(await this.api.handler.ui.isActiveTab())) {
return;
}
// Dynamically get these services to avoid circular dependencies
const serversService = this.framework.get(ServersService);
const defaultServerService = this.framework.get(DefaultServerService);
let targetServer;
if (server) {
targetServer = await serversService.addOrGetServerByBaseUrl(server);
} else {
targetServer = defaultServerService.server;
}
if (!targetServer) {
throw new Error('AFFiNE Cloud server not found');
}
const authService = targetServer.scope.get(AuthService);
switch (method) {
case 'magic-link': {
const { email, token } = payload;
await authService.signInMagicLink(email, token);
break;
}
case 'oauth': {
const { code, state, provider } = payload;
await authService.signInOauth(code, state, provider);
break;
}
case 'open-app-signin': {
const code = (payload as { code?: unknown }).code;
if (typeof code !== 'string' || !code) {
throw new Error('Invalid open-app sign-in payload');View on GitHub (pinned to b4c8548c09)
Solutions
- Add the AFFiNE Cloud server to the server list first.
- Check the server configuration and sign in again.
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown in the desktop authentication request handler when neither a server for the requested base URL nor the default server can be resolved (addOrGetServerByBaseUrl and defaultServerService.server both yield nothing) before signing in via magic-link, oauth, or open-app-signin.
Common situations: Sign-in from the desktop app fails because no AFFiNE Cloud server is configured or reachable for the auth redirect. Check the server URL settings and network connectivity, then retry the sign-in.
AI-assisted analysis of toeverything/AFFiNE@b4c8548c09 (2026-08-18).
Data as JSON: /api/errors/156b80ef5fa981de.
Report an issue: GitHub.