Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renovate fails merging during the update of the onboarding PR #22352

Closed
Shegox opened this issue May 22, 2023 · 3 comments · Fixed by #22353
Closed

Renovate fails merging during the update of the onboarding PR #22352

Shegox opened this issue May 22, 2023 · 3 comments · Fixed by #22353

Comments

@Shegox
Copy link
Contributor

Shegox commented May 22, 2023

How are you running Renovate?

Mend Renovate hosted app on github.com

If you're self-hosting Renovate, tell us what version of Renovate you run.

35.98.0

If you're self-hosting Renovate, select which platform you are using.

None

Was this something which used to work for you, and then stopped?

It used to work, and then stopped

Describe the bug

Renovate fails to merge the changes of the base branch into the working branch before extracting the updates for the onboarding PR because of a missing Git Author. Causing Renovate to abort the complete run with an error.

To reproduce it do following:

  1. Create repository with some dependency
  2. Enable Renovate on it and wait for onboarding PR (don't merge the PR)
  3. Update the base branche
  4. Wait for Renovate to fail during the update of the onboarding PR

Reproduction repository: https://github.com/Shegox/renovate-onboarding-merge

I could reproduce the same with a local setup using the Renovate Dockerimage in Version 35.98.0.


It seems this is happening because Renovate tries to merge the base branch into it's "working branch" and does so without having a Git Author configured (await writeGitAuthor() is missing). Causing Git to fail during the merge.
Specifically this code, which invokes the merge, causes the problem:

if (!GlobalConfig.get('dryRun')) {
// TODO #7154
if (!isConflicted) {
logger.debug('Merge onboarding branch in default branch');
await mergeBranch(onboardingBranch!, true);
}
}

Seems to be introduced through #20893 in 35.94.0.

A potential fix is to first call await writeGitAuthor() before trying the merge.

Relevant debug logs

Logs

From: https://app.renovatebot.com/dashboard#github/Shegox/renovate-onboarding-merge/1078809586

INFO: Repository started
{
  "renovateVersion": "35.98.0"
}
...
DEBUG: config file not found
DEBUG: Found no closed onboarding PR
DEBUG: Repo is not onboarded
DEBUG: getBranchPr(renovate/configure)
DEBUG: findPr(renovate/configure, undefined, open)
DEBUG: Found PR #1
DEBUG: Onboarding PR already exists
DEBUG: Merge onboarding branch in default branch
DEBUG: Git function thrown
{
  "err": {
    "task": {
      "commands": [
        "merge",
        "renovate/configure"
      ],
      "format": "utf-8",
      "parser": "[function]"
    },
    "message": "Committer identity unknown\n\n*** Please tell me who you are.\n\nRun\n\n  git config --global user.email \"you@example.com\"\n  git config --global user.name \"Your Name\"\n\nto set your account's default identity.\nOmit --global to set the identity only in this repository.\n\nfatal: empty ident name (for <ubuntu@ip-172-31-1-164.us-west-2.compute.internal>) not allowed\n",
    "stack": "Error: Committer identity unknown\n\n*** Please tell me who you are.\n\nRun\n\n  git config --global user.email \"you@example.com\"\n  git config --global user.name \"Your Name\"\n\nto set your account's default identity.\nOmit --global to set the identity only in this repository.\n\nfatal: empty ident name (for <ubuntu@ip-172-31-1-164.us-west-2.compute.internal>) not allowed\n\n    at Object.action (/home/ubuntu/renovateapp/node_modules/simple-git/dist/cjs/index.js:1274:25)\n    at PluginStore.exec (/home/ubuntu/renovateapp/node_modules/simple-git/dist/cjs/index.js:1309:29)\n    at /home/ubuntu/renovateapp/node_modules/simple-git/dist/cjs/index.js:1676:43\n    at new Promise (<anonymous>)\n    at GitExecutorChain.handleTaskData (/home/ubuntu/renovateapp/node_modules/simple-git/dist/cjs/index.js:1674:16)\n    at GitExecutorChain.<anonymous> (/home/ubuntu/renovateapp/node_modules/simple-git/dist/cjs/index.js:1658:44)\n    at Generator.next (<anonymous>)\n    at fulfilled (/home/ubuntu/renovateapp/node_modules/simple-git/dist/cjs/index.js:55:24)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"
  }
}
DEBUG: mergeBranch error
{
  "baseBranch": "main",
  "baseSha": "06147a6afeecd46a89b361e90dcbd079678964d9",
  "branchName": "renovate/configure",
  "branchSha": "59460e53c7da1696df6aa24fb1e9c66f54392c81",
  "status": {
    "not_added": [],
    "conflicted": [],
    "created": [],
    "deleted": [],
    "modified": [],
    "renamed": [],
    "files": [],
    "staged": [],
    "ahead": 0,
    "behind": 0,
    "current": "main",
    "tracking": "origin/main",
    "detached": false,
    "isClean": "[function]"
  },
  "err": {
    "task": {
      "commands": [
        "merge",
        "renovate/configure"
      ],
      "format": "utf-8",
      "parser": "[function]"
    },
    "message": "Committer identity unknown\n\n*** Please tell me who you are.\n\nRun\n\n  git config --global user.email \"you@example.com\"\n  git config --global user.name \"Your Name\"\n\nto set your account's default identity.\nOmit --global to set the identity only in this repository.\n\nfatal: empty ident name (for <ubuntu@ip-172-31-1-164.us-west-2.compute.internal>) not allowed\n",
    "stack": "Error: Committer identity unknown\n\n*** Please tell me who you are.\n\nRun\n\n  git config --global user.email \"you@example.com\"\n  git config --global user.name \"Your Name\"\n\nto set your account's default identity.\nOmit --global to set the identity only in this repository.\n\nfatal: empty ident name (for <ubuntu@ip-172-31-1-164.us-west-2.compute.internal>) not allowed\n\n    at Object.action (/home/ubuntu/renovateapp/node_modules/simple-git/dist/cjs/index.js:1274:25)\n    at PluginStore.exec (/home/ubuntu/renovateapp/node_modules/simple-git/dist/cjs/index.js:1309:29)\n    at /home/ubuntu/renovateapp/node_modules/simple-git/dist/cjs/index.js:1676:43\n    at new Promise (<anonymous>)\n    at GitExecutorChain.handleTaskData (/home/ubuntu/renovateapp/node_modules/simple-git/dist/cjs/index.js:1674:16)\n    at GitExecutorChain.<anonymous> (/home/ubuntu/renovateapp/node_modules/simple-git/dist/cjs/index.js:1658:44)\n    at Generator.next (<anonymous>)\n    at fulfilled (/home/ubuntu/renovateapp/node_modules/simple-git/dist/cjs/index.js:55:24)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"
  }
}
ERROR: Repository has unknown error
{
  "err": {
    "task": {
      "commands": [
        "merge",
        "renovate/configure"
      ],
      "format": "utf-8",
      "parser": "[function]"
    },
    "message": "Committer identity unknown\n\n*** Please tell me who you are.\n\nRun\n\n  git config --global user.email \"you@example.com\"\n  git config --global user.name \"Your Name\"\n\nto set your account's default identity.\nOmit --global to set the identity only in this repository.\n\nfatal: empty ident name (for <ubuntu@ip-172-31-1-164.us-west-2.compute.internal>) not allowed\n",
    "stack": "Error: Committer identity unknown\n\n*** Please tell me who you are.\n\nRun\n\n  git config --global user.email \"you@example.com\"\n  git config --global user.name \"Your Name\"\n\nto set your account's default identity.\nOmit --global to set the identity only in this repository.\n\nfatal: empty ident name (for <ubuntu@ip-172-31-1-164.us-west-2.compute.internal>) not allowed\n\n    at Object.action (/home/ubuntu/renovateapp/node_modules/simple-git/dist/cjs/index.js:1274:25)\n    at PluginStore.exec (/home/ubuntu/renovateapp/node_modules/simple-git/dist/cjs/index.js:1309:29)\n    at /home/ubuntu/renovateapp/node_modules/simple-git/dist/cjs/index.js:1676:43\n    at new Promise (<anonymous>)\n    at GitExecutorChain.handleTaskData (/home/ubuntu/renovateapp/node_modules/simple-git/dist/cjs/index.js:1674:16)\n    at GitExecutorChain.<anonymous> (/home/ubuntu/renovateapp/node_modules/simple-git/dist/cjs/index.js:1658:44)\n    at Generator.next (<anonymous>)\n    at fulfilled (/home/ubuntu/renovateapp/node_modules/simple-git/dist/cjs/index.js:55:24)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"
  }
}
DEBUG: Unknown res: unknown-error
DEBUG: Repository result: unknown-error, status: unknown, enabled: undefined, onboarded: undefined

Have you created a minimal reproduction repository?

I have linked to a minimal reproduction in the description above

@Shegox Shegox added needs-discussion Issue requires a GitHub Discussion first priority-5-triage status:requirements Full requirements are not yet known, so implementation should not be started type:bug Bug fix of existing functionality labels May 22, 2023
@github-actions github-actions bot removed type:bug Bug fix of existing functionality status:requirements Full requirements are not yet known, so implementation should not be started priority-5-triage labels May 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 22, 2023
@rarkins rarkins reopened this May 22, 2023
@renovatebot renovatebot deleted a comment from github-actions bot May 22, 2023
@rarkins rarkins removed the needs-discussion Issue requires a GitHub Discussion first label May 22, 2023
@rarkins
Copy link
Collaborator

rarkins commented May 22, 2023

I didn't manage to reproduce this, but that's probably because I have a git author set globally locally. I think a single writeGitAuthor() after syncGit() inside mergeBranch() should fix this?

@rarkins
Copy link
Collaborator

rarkins commented May 22, 2023

#22353

@renovatebot renovatebot unlocked this conversation May 22, 2023
@renovate-release
Copy link
Collaborator

🎉 This issue has been resolved in version 35.98.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants