What Renovate type are you using?
self-hosted Renovate with self-hosted gitlab-ce.
PR done via the ansible-galaxy manager gives PR not acceptable for merging. Branches are shown on Gitlab, releases notes are correctly fetched from Github but they never automerge.
Did you see anything helpful in debug logs?
I saw INFO: PR not acceptable for merging
To Reproduce
Use the ansible-galaxy manager with self-hosted gitlab-ce and self-hosted renovatebot.
Please raise logLevel to debug and look at the logs for more information.
Also please share your config if possible.
Moving this to config help. This sounds like it has nothing at all to do with ansible-galaxy specifically.
Looks like we're not debugging the err we get when GitLab returns 406 to MR merging. I've added this to master just now, so it should get released automatically soon. @micheelengronne you will need to try with the latest version once it's released, run at debug level, and then troubleshoot yourself why GitLab doesn't want to merge the MR. Relevant docs: https://docs.gitlab.com/ee/api/merge_requests.html#accept-mr
Ok, here is the log:
DEBUG: processBranch with 1 upgrades (repository=Group/repo, dependencies=dev-sec_os-hardening, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: Setting baseBranch to master (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: Setting baseBranch to master (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: latest commit (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
"branchName": "master",
"latestCommitDate": "2020-02-21 22:48:27 +0000"
DEBUG: getBranchPr(renovate/dev-sec_os-hardening-5.x) (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: Got res with 1 results (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: getPr(45) (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: getBranchStatus(renovate/dev-sec_os-hardening-5.x) (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: Got res with 4 results (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: branchExists=true (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: Branch pr rebase requested: false (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: Branch has 1 upgrade(s) (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: Checking if PR has been edited (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: Found existing branch PR (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: Checking schedule(at any time, null) (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: No schedule defined (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: Branch already exists (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: getBranchPr(renovate/dev-sec_os-hardening-5.x) (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: Got res with 1 results (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: getPr(45) (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: getBranchStatus(renovate/dev-sec_os-hardening-5.x) (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: Got res with 4 results (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: Branch does not need rebasing (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: Using parentBranch: renovate/dev-sec_os-hardening-5.x (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: manager.getUpdatedPackageFiles() (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: ansible-galaxy.updateDependency(): 5.2.1 (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: No changes necessary (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: No package files need updating (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: Getting updated lock files (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: lock file dirs (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
"dirs": {
"yarnLockDirs": [],
"npmLockDirs": [],
"pnpmShrinkwrapDirs": [],
"lernaDirs": []
}
DEBUG: Writing package.json files (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
"packageFiles": ["molecule/complete/files/package.json"]
DEBUG: Writing molecule/complete/files/yarn.lock (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: Writing any updated package files (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: No updated lock files in branch (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: No files to commit (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: Checking if we can automerge branch (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: mergeStatus=no automerge (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: Ensuring PR (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: There are 0 errors and 0 warnings (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: getBranchPr(renovate/dev-sec_os-hardening-5.x) (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: Got res with 1 results (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: getPr(45) (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: getBranchStatus(renovate/dev-sec_os-hardening-5.x) (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: Got res with 4 results (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: Found existing PR (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: getBranchStatus(renovate/dev-sec_os-hardening-5.x) (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: Got res with 4 results (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: Processing existing PR (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: getBranchStatus(renovate/dev-sec_os-hardening-5.x) (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: Got res with 4 results (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: getBranchStatus() result (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
"branchStatus": "success",
"branchName": "renovate/dev-sec_os-hardening-5.x"
DEBUG: PR body changed (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
"prTitle": "fix(renovate): Update dependency dev-sec_os-hardening to v5.2.1",
"oldPrBody": "This MR contains the following updates:\n\n| Package | Update | Change |\n|---|---|---|\n| [dev-sec_os-hardening](https://github.com/dev-sec/ansible-os-hardening) | patch | `5.2.0` -> `5.2.1` |\n\n---\n\n### Release Notes\n\n<details>\n<summary>dev-sec/ansible-os-hardening</summary>\n\n### [`v5.2.1`](https://github.com/dev-sec/ansible-os-hardening/blob/master/CHANGELOG.md#​521httpsgithubcomdev-secansible-os-hardeningtree521-2019-06-09)\n\n[Compare Source](https://github.com/dev-sec/ansible-os-hardening/compare/5.2.0...5.2.1)\n\n[Full Changelog](https://github.com/dev-sec/ansible-os-hardening/compare/5.2.0...5.2.1)\n\n**Implemented enhancements:**\n\n- Fix deprecation warnings in Ansible 2.8 [#​224](https://github.com/dev-sec/ansible-os-hardening/pull/224) ([Normo](https://github.com/Normo))\n- add docs to find-task in minimize access. fix #​219 [#​220](https://github.com/dev-sec/ansible-os-hardening/pull/220) ([rndmh3ro](https://github.com/rndmh3ro))\n\n**Fixed bugs:**\n\n- `squash\\_actions` deprecation warning [#​218](https://github.com/dev-sec/ansible-os-hardening/issues/218)\n\n</details>\n\n---\n\n### Renovate configuration\n\n:date: **Schedule**: At any time (no schedule defined).\n\n:vertical_traffic_light: **Automerge**: Enabled.\n\n:recycle: **Rebasing**: Whenever MR becomes conflicted, or if you tick the rebase/retry checkbox below.\n\n:no_bell: **Ignore**: Close this MR and you won't be reminded about this update again.\n\n---\n\n - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box\n\n---\n\nThis MR has been generated by [Bot Read Write](https://domain.name/botreadwrite) with Renovate",
"newPrBody": "This MR contains the following updates:\n\n| Package | Update | Change |\n|---|---|---|\n| [dev-sec_os-hardening](https://github.com/dev-sec/ansible-os-hardening) | patch | `5.2.0` -> `5.2.1` |\n\n---\n\n### Release Notes\n\n<details>\n<summary>dev-sec/ansible-os-hardening</summary>\n\n### [`v5.2.1`](https://github.com/dev-sec/ansible-os-hardening/blob/master/CHANGELOG.md#​521httpsgithubcomdev-secansible-os-hardeningtree521-2019-06-09)\n\n[Compare Source](https://github.com/dev-sec/ansible-os-hardening/compare/5.2.0...5.2.1)\n\n[Full Changelog](https://github.com/dev-sec/ansible-os-hardening/compare/5.2.0...5.2.1)\n\n**Implemented enhancements:**\n\n- Fix deprecation warnings in Ansible 2.8 [#​224](https://github.com/dev-sec/ansible-os-hardening/pull/224) ([Normo](https://github.com/Normo))\n- add docs to find-task in minimize access. fix #​219 [#​220](https://github.com/dev-sec/ansible-os-hardening/pull/220) ([rndmh3ro](https://github.com/rndmh3ro))\n\n**Fixed bugs:**\n\n- `squash\\_actions` deprecation warning [#​218](https://github.com/dev-sec/ansible-os-hardening/issues/218)\n\n</details>\n\n---\n\n### Renovate configuration\n\n:date: **Schedule**: At any time (no schedule defined).\n\n:vertical_traffic_light: **Automerge**: Enabled.\n\n:recycle: **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.\n\n:no_bell: **Ignore**: Close this MR and you won't be reminded about this update again.\n\n---\n\n - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box\n\n---\n\nThis MR has been generated by [Bot Read Write](https://domain.name/botreadwrite) with Renovate"
INFO: PR updated (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
"pr": 45,
"prTitle": "fix(renovate): Update dependency dev-sec_os-hardening to v5.2.1"
DEBUG: Checking #45 for automerge (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
"automerge": true,
"automergeType": "pr",
"automergeComment": "automergeComment"
DEBUG: PR is configured for automerge (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: getBranchStatus(renovate/dev-sec_os-hardening-5.x) (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: Got res with 4 results (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: Automerging #45 (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
DEBUG: PR not acceptable for merging (repository=Group/repo, branch=renovate/dev-sec_os-hardening-5.x)
"err": {
"name": "HTTPError",
"hostname": "domain.name",
"method": "PUT",
"path": "/api/v4/projects/Group%2Frepo/merge_requests/45/merge",
"protocol": "https:",
"url": "https://domain.name/api/v4/projects/Group%2Frepo/merge_requests/45/merge",
"gotOptions": {
"path": "/api/v4/projects/Group%2Frepo/merge_requests/45/merge",
"protocol": "https:",
"hostname": "domain.name",
"hash": "",
"search": "",
"pathname": "/api/v4/projects/Group%2Frepo/merge_requests/45/merge",
"href": "https://domain.name/api/v4/projects/Group%2Frepo/merge_requests/45/merge",
"headers": {
"user-agent": "https://github.com/renovatebot/renovate",
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"content-type": "application/json",
"Private-token": "**redacted**",
"content-length": 36
},
"hooks": {
"beforeError": [],
"init": [],
"beforeRequest": [],
"beforeRedirect": [],
"beforeRetry": [],
"afterResponse": []
},
"retry": {"methods": {}, "statusCodes": {}, "errorCodes": {}},
"decompress": true,
"throwHttpErrors": true,
"followRedirect": true,
"stream": false,
"form": false,
"json": true,
"cache": false,
"useElectronNet": false,
"hostType": "gitlab",
"baseUrl": "https://domain.name/api/v4/",
"body": "{\"should_remove_source_branch\":true}",
"method": "PUT",
"gotTimeout": {"request": 60000}
},
"statusCode": 406,
"statusMessage": "Not Acceptable",
"headers": {
"server": "nginx",
"date": "Mon, 24 Feb 2020 13:57:36 GMT",
"content-type": "application/json",
"content-length": "37",
"connection": "close",
"cache-control": "no-cache",
"vary": "Origin",
"x-content-type-options": "nosniff",
"x-frame-options": "SAMEORIGIN",
"x-request-id": "4TpqJOntUda",
"x-runtime": "0.035048"
},
"body": {"message": "Branch cannot be merged"},
"message": "Response code 406 (Not Acceptable)",
"stack": "HTTPError: Response code 406 (Not Acceptable)\n at EventEmitter.<anonymous> (/home/renovate/.config/yarn/global/node_modules/got/source/as-promise.js:74:19)\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (internal/process/task_queues.js:97:5)"
}
Do you have any branch protection enabled?
The master of course, but the Bot can merge on it with renovate.
I try to rebase manually the MR to see if it solves the problem.

I read it too. But it is not the case.
you needto configure rebaseWhen
can you share your protection settings?
What do you mean ?
The Bot that runs renovate is Maintainer of this project if that's what you mean. It is allowed to merge and allowed to push on the master branch.

s
sorry, the mr settings
Ok, fast-forward merge. So, I just set rebaseWhen on behind-base-branch. We'll see.
It works !!!
@micheelengronne With renovatebot v19.148.0 you no longer need the rebaseWhen setting
Ok, I will keep it to ensure consistency and portability.