Kong/insomnia · error

Remote history conflict. Please pull latest changes and try…

Error message

Remote history conflict. Please pull latest changes and try again

What it means

Guard in VCS.push: the remote backend project already contains history that the local branch does not include (e.g. someone else pushed first), so pushing would diverge remote history. Resolution is to pull/fetch latest remote changes before pushing again.

Solutions

  1. Pull (fetch + merge) the remote branch, resolve conflicts, then push again
  2. Verify you are pushing the intended branch
  3. Avoid force-modifying remote history out-of-band
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at packages/insomnia-vcs/src/vcs.ts:763 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Kong/insomnia@d9bb2b0142 (2026-08-26). Data as JSON: /api/errors/cc5bb529fc56ee81. Report an issue: GitHub.

Appendix: source

Thrown at packages/insomnia-vcs/src/vcs.ts:763

      throw new Error('teamId should be defined');
    }

    const teamKeys = await this._queryTeamMemberKeys(teamId);
    return this._queryCreateProject(rootDocumentId, name, teamId, teamProjectId, teamKeys.memberKeys);
  }

  // TODO: may be we can create another push function for initial push, so that we can reduce some api calls
  async push({ teamId, teamProjectId }: { teamId: string; teamProjectId: string }) {
    await this._getOrCreateRemoteBackendProject({ teamId, teamProjectId });
    const branch = await this._getCurrentBranch();
    // Check branch history to make sure there are no conflicts
    let lastMatchingIndex = 0;
    const remoteBranch: Branch | null = await this._queryBranch(branch.name);
    const remoteBranchSnapshots = remoteBranch ? remoteBranch.snapshots : [];

    for (; lastMatchingIndex < remoteBranchSnapshots.length; lastMatchingIndex++) {
      if (remoteBranchSnapshots[lastMatchingIndex] !== branch.snapshots[lastMatchingIndex]) {
        throw new Error('Remote history conflict. Please pull latest changes and try again');
      }
    }

    // Get the remaining snapshots to push
    const snapshotIdsToPush = branch.snapshots.slice(lastMatchingIndex);

    if (snapshotIdsToPush.length === 0) {
      throw new Error('Already up to date');
    }

    // Gather a list of snapshot state entries to push
    const allBlobIds = new Set<string>();
    const snapshots: Snapshot[] = [];

    for (const id of snapshotIdsToPush) {
      const snapshot = await this._assertSnapshot(id);
      snapshots.push(snapshot);

View on GitHub (pinned to d9bb2b0142)