diegosouzapw/OmniRoute · error · Error

Provider connection no longer exists

Error message

Provider connection no longer exists

What it means

Post-harvest consistency check in harvestSession: credentials were successfully read from the browser, but re-fetching the provider connection by id returned nothing. Means the connection was deleted while the user was logging in inside the VNC browser — there is nowhere to persist the harvested credentials, so the harvest result is discarded with this error.

Solutions

  1. Recreate the provider connection and redo browser login
  2. Guard the UI against deleting connections with active browser-login sessions
  3. Treat as a user-facing 'connection removed' error, not a harvest failure
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/lib/vncSession/service.ts:293 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/cc19e4788a04e261. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/vncSession/service.ts:293

    const harvest = await harvestFromContainer(
      session.cdpPort,
      provider,
      VNC_CONFIG.harvestTimeoutMs
    );
    session.lastHarvestAt = Date.now();
    if (!harvest.hasCredential) {
      return {
        harvested: false,
        sessionId,
        connectionId,
        providerId: session.providerId,
        updatedFields: [],
        validation: null,
      };
    }

    const connection = await getProviderConnectionById(connectionId);
    if (!connection) throw new Error("Provider connection no longer exists");
    if (connection.provider !== session.providerId) {
      throw new Error("Provider connection changed while browser login was active");
    }

    const { providerSpecificData, apiKey } = harvestToCredentials(harvest, provider);
    const existingData =
      connection.providerSpecificData &&
      typeof connection.providerSpecificData === "object" &&
      !Array.isArray(connection.providerSpecificData)
        ? connection.providerSpecificData
        : {};
    const mergedData = { ...existingData, ...providerSpecificData };

    await updateProviderConnection(connectionId, {
      providerSpecificData: mergedData,
      ...(apiKey ? { apiKey } : {}),
    });

View on GitHub (pinned to a179ffed5b)