Closed krishna-pp closed 2 years ago
👋 Thanks for taking the time to make your bug report detailed.
Code related to fetching terraform private registry URLs changed recently in https://github.com/dependabot/dependabot-core/pull/5366, it may be worth perusing that as a starter to understand how Dependabot tries to fetch from private terraform registries.
I poked through our Terraform registry client , but I'm not super familiar with Terraform , so it was difficult for me to follow.
Unfortunately this isn't something we'll have the cycles to debug on our side anytime soon, especially since there's a small chance it may end up being something specific to artifactory...
Can you try running the dry-run script to see if you can reproduce locally?
Because if so, it should be fairly straightforward to track down where it's creating the malformed URL (just throw in some puts
statements 😄 ). And from there I suspect the fix would be pretty straightforward based on what I see in the registry client code.
Let me know if you need any further pointers on debugging or putting together a PR.
Thanks, @jeffwidman, for the tips. I was able to reproduce the issue locally. It turns out that the service discovery URL from our private registry is missing a slash at the end.
It is documented in the terraform registry API document here: https://www.terraform.io/registry/api-docs.
The service identifier for this protocol is modules.v1, and the declared URL should always end with a slash
such that the paths shown in the following sections can be appended to it.
I'll take it up with our registry provider. Thanks again for your help. I'm closing the issue.
Glad you figured it out. 🎉
Thanks for circling back and letting us know. 👍
Is there an existing issue for this?
Package ecosystem
terraform
Package manager version
N/A
Language version
No response
Manifest location and content before the Dependabot update
dependabot.yml content
Updated dependency
aws-legacy-account-variables
from v0.3.9 to v0.3.10What you expected to see, versus what you actually saw
Expected Dependabot to open a PR with the updates to the terraform module
aws-legacy-account-variables
.Instead, it throws a RuntimeError saying it can't fetch the URL: https://ourcustominstance.jfrog.io:443/artifactory/api/terraform/v1/terraform-modules-local__namespace/aws-legacy-account-variables/aws/versions.
However, the correct URL to look for is: https://ourcustominstance.jfrog.io:443/artifactory/api/terraform/v1/modules/terraform-modules-local__namespace/aws-legacy-account-variables/aws/versions
(it is missing /modules/ after v1/). I've also posted the contents of .well-known/terraform.json, where terraform registry is hosted).
Native package manager behavior
No response
Images of the diff or a link to the PR, issue, or logs
Please see below the dependabot logs. I'm also attaching the content of https://ourcustominstance.jfrog.io/.well-known/terraform.json down below.
Content of https://ourcustominstance.jfrog.io/.well-known/terraform.json below:
Smallest manifest that reproduces the issue
No response