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

proxy for binaries hosted in github #24

Open
eossf opened this issue Jun 6, 2023 · 2 comments
Open

proxy for binaries hosted in github #24

eossf opened this issue Jun 6, 2023 · 2 comments

Comments

@eossf
Copy link

eossf commented Jun 6, 2023

Hello,

I installed in my Nexus3 your plugin, I proxied the official registry https://registry.terraform.io/
It works fine for all providers where source = "hashicorp/*"

For other providers, for instance source = "illumio/illumio-core", it does not work.
my .terraformrc:
provider_installation {
network_mirror {
url = "https://registry.mysite.com/repository/terraform-proxy/v1/providers/"
}
}

terraform init gives:
│ Error while installing illumio/illumio-core v1.1.2: unsuccessful request to
https://registry.mysite.com/repository/terraform-proxy/v1/providers/registry.terraform.io/illumio/illumio-core/terraform-provider-illumio-core_1.1.2_linux_amd64.zip: 404 Not Found

The binaries are in fact located in github here https://github.com/illumio/terraform-provider-illumio-core/releases
This is the basic behaviour of terraform, binaries could be elsewhere than terraform.io.
Note: the binaries for "hashicorp/*" are not located in github, example: https://github.com/hashicorp/terraform-provider-azurerm/releases/tag/v3.59.0

How to deal with this situation ? Thanks

@davejab
Copy link
Owner

davejab commented Jun 8, 2023

@eossf
the plugin is capable of pulling binaries from external locations, output below of a test i ran:

Initializing provider plugins...
- Finding illumio/illumio-core versions matching "1.1.2"...
2023-06-08T22:40:00.266+0100 [DEBUG] Querying available versions of provider registry.terraform.io/illumio/illumio-core at network mirror https://localhost:8443/repository/terraform/v1/providers/
2023-06-08T22:40:00.266+0100 [DEBUG] GET https://localhost:8443/repository/terraform/v1/providers/registry.terraform.io/illumio/illumio-core/index.json
2023-06-08T22:40:00.266+0100 [TRACE] HTTP client GET request to https://localhost:8443/repository/terraform/v1/providers/registry.terraform.io/illumio/illumio-core/index.json
2023-06-08T22:40:00.500+0100 [TRACE] providercache.fillMetaCache: scanning directory .terraform/providers
2023-06-08T22:40:00.501+0100 [TRACE] getproviders.SearchLocalDirectory: found registry.terraform.io/hashicorp/terraform v1.0.2 for linux_amd64 at .terraform/providers/registry.terraform.io/hashicorp/terraform/1.0.2/linux_amd64
2023-06-08T22:40:00.501+0100 [TRACE] providercache.fillMetaCache: including .terraform/providers/registry.terraform.io/hashicorp/terraform/1.0.2/linux_amd64 as a candidate package for registry.terraform.io/hashicorp/terraform 1.0.2
2023-06-08T22:40:00.501+0100 [DEBUG] Finding package URL for registry.terraform.io/illumio/illumio-core v1.1.2 on linux_amd64 via network mirror https://localhost:8443/repository/terraform/v1/providers/
2023-06-08T22:40:00.501+0100 [DEBUG] GET https://localhost:8443/repository/terraform/v1/providers/registry.terraform.io/illumio/illumio-core/1.1.2.json
2023-06-08T22:40:00.501+0100 [TRACE] HTTP client GET request to https://localhost:8443/repository/terraform/v1/providers/registry.terraform.io/illumio/illumio-core/1.1.2.json
- Installing illumio/illumio-core v1.1.2...
2023-06-08T22:40:01.190+0100 [TRACE] providercache.Dir.InstallPackage: installing registry.terraform.io/illumio/illumio-core v1.1.2 from https://localhost:8443/repository/terraform/v1/providers/registry.terraform.io/illumio/illumio-core/terraform-provider-illumio-core_1.1.2_linux_amd64.zip
2023-06-08T22:40:01.190+0100 [TRACE] HTTP client GET request to https://localhost:8443/repository/terraform/v1/providers/registry.terraform.io/illumio/illumio-core/terraform-provider-illumio-core_1.1.2_linux_amd64.zip
2023-06-08T22:40:02.449+0100 [TRACE] providercache.fillMetaCache: scanning directory .terraform/providers
2023-06-08T22:40:02.449+0100 [TRACE] getproviders.SearchLocalDirectory: found registry.terraform.io/hashicorp/terraform v1.0.2 for linux_amd64 at .terraform/providers/registry.terraform.io/hashicorp/terraform/1.0.2/linux_amd64
2023-06-08T22:40:02.449+0100 [TRACE] getproviders.SearchLocalDirectory: found registry.terraform.io/illumio/illumio-core v1.1.2 for linux_amd64 at .terraform/providers/registry.terraform.io/illumio/illumio-core/1.1.2/linux_amd64
2023-06-08T22:40:02.449+0100 [TRACE] providercache.fillMetaCache: including .terraform/providers/registry.terraform.io/hashicorp/terraform/1.0.2/linux_amd64 as a candidate package for registry.terraform.io/hashicorp/terraform 1.0.2
2023-06-08T22:40:02.449+0100 [TRACE] providercache.fillMetaCache: including .terraform/providers/registry.terraform.io/illumio/illumio-core/1.1.2/linux_amd64 as a candidate package for registry.terraform.io/illumio/illumio-core 1.1.2
- Installed illumio/illumio-core v1.1.2 (unauthenticated)

Are you behind a proxy? Can you access Github from the Nexus server? Are you able to provide nexus logs?

@eossf
Copy link
Author

eossf commented Jun 9, 2023

hello I have check log, and it seems to be an URL blocked proxy , should not happen but

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants