BloopAI/vibe-kanban · error

Failed to push changes

Error message

Failed to push changes

What it means

The generic failure branch of the push action: workspacesApi.push() returned success=false with an error that is NOT force_push_required, so the action throws a generic 'Failed to push changes' message. The specific backend cause is not surfaced in the message, only in the result envelope.

Source

Thrown at packages/web-core/src/shared/actions/index.ts:1090

    id: 'git-push',
    label: 'Push',
    icon: ArrowUpIcon,
    shortcut: 'X U',
    requiresTarget: ActionTargetType.GIT,
    isVisible: (ctx) =>
      ctx.hasWorkspace &&
      ctx.hasGitRepos &&
      ctx.hasOpenPR &&
      ctx.hasUnpushedCommits,
    execute: async (ctx, workspaceId, repoId) => {
      const result = await workspacesApi.push(workspaceId, { repo_id: repoId });
      if (!result.success) {
        if (result.error?.type === 'force_push_required') {
          throw new Error(
            'Force push required. The remote branch has diverged.'
          );
        }
        throw new Error('Failed to push changes');
      }
      invalidateWorkspaceQueries(ctx.queryClient, workspaceId);
    },
  },

  // === Repo-specific Actions (for command bar when selecting a repo) ===
  RepoCopyPath: {
    id: 'repo-copy-path',
    label: 'Copy Repo Path',
    icon: CopyIcon,
    requiresTarget: ActionTargetType.GIT,
    isVisible: (ctx) => ctx.hasWorkspace && ctx.hasGitRepos,
    execute: async (_ctx, _workspaceId, repoId) => {
      try {
        const repo = await repoApi.getById(repoId);
        if (repo?.path) {
          await navigator.clipboard.writeText(repo.path);
        }

View on GitHub (pinned to 4deb7eca8f)

Solutions

  1. Log/inspect the full result.error object to find the underlying cause (the thrown message is generic).
  2. Verify git credentials/permissions for the remote are valid and sufficient to push.
  3. Confirm the workspace and repo still exist remotely; refresh workspace state.
  4. Retry if a transient network error; check remote server/hook logs otherwise.

Example fix

// before
throw new Error('Failed to push changes');
// after
console.error('push failed:', result.error);
throw new Error(result.error?.message ?? 'Failed to push changes');
Defensive patterns

Strategy: try-catch

Validate before calling

// before pushing: check remote access
const remoteOk = await checkRemoteCredentials(repoId);
if (!remoteOk) await promptReauthenticate();

Type guard

function hasPushError(r: { success: boolean; error?: { type?: string; message?: string } }): boolean {
  return r.success === false && r.error != null;
}

Try / catch

try {
  await pushAction.execute(ctx, workspaceId, repoId);
} catch (e) {
  if (e instanceof Error && e.message === 'Failed to push changes') {
    showError('Push failed — check credentials, remote hooks, and that the repo still exists.');
  } else throw e;
}

Prevention

When it happens

Trigger: execute() -> workspacesApi.push(workspaceId, { repo_id }) resolves { success: false } with any error other than type 'force_push_required' — auth failure, rejected non-fast-forward variants, hook rejections, network errors wrapped by the API, or repo not found.

Common situations: Expired/insufficient credentials for the remote; repository or workspace deleted remotely; pre-receive hooks rejecting the push; API/proxy connectivity problems.

Related errors


AI-assisted analysis of BloopAI/vibe-kanban@4deb7eca8f (2026-08-29). Data as JSON: /api/errors/06255d84f4e37ff9. Report an issue: GitHub.