Push to Git is working inconsistently

Describe the problem/error/question

When I use the Push to Git option, it’s inconsistent if it will work correctly. Sometimes, it will work the first time, sometimes I get Source control is not properly set up, please disconnect and reconnect. or source_control_not_connected errors. If I click “Push to Git” enough, I will eventually get it to go through properly.

When it does go through correctly, it pushes to my repo without any problems. I have tried resetting the connection several times, but I always have this inconsistency. Are there any fixes for this issue? I followed the set up instructions here: Set up source control | n8n Docs .

What is the error message (if any)?

Source control is not properly set up, please disconnect and reconnect. and source_control_not_connected

Please share your workflow

I’ve tried this with several workflows and had the same result. The current workflow I’m using to test uploading is:

{
  "nodes": [
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "id": "XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX",
      "name": "When clicking ‘Execute workflow’"
    },
    {
      "parameters": {
        "resource": "repository",
        "operation": "get",
        "owner": {
          "__rl": true,
          "value": "https://github.com/MyName",
          "mode": "url"
        },
        "repository": {
          "__rl": true,
          "value": "https://github.com/MyName/Repo-n8n",
          "mode": "url"
        }
      },
      "type": "n8n-nodes-base.github",
      "typeVersion": 1.1,
      "position": [
        208,
        0
      ],
      "id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX",
      "name": "Get a repository",
      "webhookId": "XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX",
      "credentials": {
        "githubApi": {
          "id": "XXXXXXXXXXXXX",
          "name": "GitHub account"
        }
      }
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        416,
        0
      ],
      "id": "XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX",
      "name": "No Operation, do nothing"
    }
  ],
  "connections": {
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Get a repository",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get a repository": {
      "main": [
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
  }
}Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.119.1
  • Database (default: SQLite): PostgreSQL
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: I think it’s Container-Optimized OS for GKE

This inconsistent Git push behavior is usually caused by connection timeout or authentication token issues. Here are some steps to troubleshoot:

• **Check your Git credentials**: Go to Settings > Source Control and disconnect/reconnect your Git repository with fresh authentication tokens

• **Verify network stability**: The intermittent nature suggests possible network timeouts - try pushing during different times or check if your n8n instance has stable connectivity to GitHub

• **Clear browser cache**: Sometimes cached authentication data can cause conflicts - clear your browser cache and cookies for your n8n instance

• **Check Git repository permissions**: Ensure your authentication token has proper write permissions to the repository

If the issue persists, try setting up the Git connection from scratch with a new personal access token, as this often resolves authentication-related inconsistencies.