renovatebot / renovate

Home of the Renovate CLI: Cross-platform Dependency Automation by Mend.io
https://mend.io/renovate
GNU Affero General Public License v3.0
17.15k stars 2.23k forks source link

Using relative path in .gitsubmodule leads to random errors #10655

Closed damoon closed 11 months ago

damoon commented 3 years ago

How are you running Renovate?

If using the hosted app, please skip to the next section. Otherwise, if self-hosted, please complete the following:

Please select which platform you are using:

Renovate version: v25.51.5

Describe the bug

I use a relative path in .gitsubmodules. I needs this so that ci pipelines can clone via http and i can pull and push via ssh.

Sometimes renovate just ignores all submodules updates and does not show an error. Sometimes renovate shows this warning but creates a MR with the update for an other module. Sometimes renovate shows an error and does not create a MR.

Relevant debug logs

 WARN: Error mapping git submodules during extraction (repository=utopia-planitia/test-infra/integration-cluster)
       "err": {
         "task": {
           "commands": ["ls-remote", "--symref", "https:///ci/nexus.git", "HEAD"],
           "format": "utf-8"
         },
         "message": "fatal: unable to access 'https:///ci/nexus.git/': Could not resolve host: ci\n",
         "stack": "Error: fatal: unable to access 'https:///ci/nexus.git/': Could not resolve host: ci\n\n    at Object.action (/usr/src/app/node_modules/simple-git/src/lib/plugins/error-detection.plugin.ts:38:28)\n    at PluginStore.exec (/usr/src/app/node_modules/simple-git/src/lib/plugins/plugin-store.ts:24:29)\n    at /usr/src/app/node_modules/simple-git/src/lib/runners/git-executor-chain.ts:114:40\n    at new Promise (<anonymous>)\n    at GitExecutorChain.handleTaskData (/usr/src/app/node_modules/simple-git/src/lib/runners/git-executor-chain.ts:111:14)\n    at GitExecutorChain.<anonymous> (/usr/src/app/node_modules/simple-git/src/lib/runners/git-executor-chain.ts:88:40)\n    at Generator.next (<anonymous>)\n    at fulfilled (/usr/src/app/node_modules/simple-git/src/lib/runners/git-executor-chain.js:5:58)\n    at processTicksAndRejections (internal/process/task_queues.js:95:5)"
       }

Have you created a minimal reproduction repository?

https://gitlab.com/utopia-planitia/test-infra/integration-cluster/-/blob/main/.gitmodules

HonkingGoose commented 3 years ago

Hi @damoon, thank you for opening a issue. Can you please copy/paste our issue template and fill it in?

damoon commented 3 years ago

done :D

HonkingGoose commented 3 years ago

Oh you can remove this part, as we don't need it. Those things only work when the issue is opened first.

---
name: Bug report
about: You've found a bug with Renovate
labels: 'type:bug, status:requirements, priority-5-triage'
---
rarkins commented 3 years ago

@JamieMagee can you look at this? Seems like we're not doing enough input validation.

JamieMagee commented 3 years ago

Sure. I think we should be dealing with this case here:

https://github.com/renovatebot/renovate/blob/cb752dbee95575954469d071fdcddde71d6d806b/lib/manager/git-submodules/extract.ts#L25-L31

It looks like in https:///ci/nexus.git is an alias. @damoon Do you run Renovate on gitlab CI? If so, could you share a link to a run?

damoon commented 3 years ago

here are the full debug logs https://gitlab.com/utopia-planitia/test-infra/renovate-bot/-/jobs/1388050858

damoon commented 3 years ago

in this setup i use main instead of master as the default branch. after explicitly defining main as the remote branch (instead of relying on HEAD) this bug does not happen to me anymore. https://gitlab.com/utopia-planitia/test-infra/integration-cluster/-/commit/db8a76888600ff69da2af10eec3278f849b4e7db

maybe a more descriptive error message mentioning this behavior would be nice.

rarkins commented 3 years ago

I'm not sure exactly what is the problem/limitation though

damoon commented 3 years ago

i use main as the primary branch name. once i started to mentions this in the .gitmodules file the error did not show again.

i assume somewhere master is used to search for updates.

github-actions[bot] commented 1 year ago

Hi there,

Get your issue fixed faster by creating a minimal reproduction. This means a repository dedicated to reproducing this issue with the minimal dependencies and config possible.

Before we start working on your issue we need to know exactly what's causing the current behavior. A minimal reproduction helps us with this.

To get started, please read our guide on creating a minimal reproduction.

We may close the issue if you, or someone else, haven't created a minimal reproduction within two weeks. If you need more time, or are stuck, please ask for help or more time in a comment.

Good luck,

The Renovate team