Closed mattmooree closed 1 year ago
@mattmooree, we've seen this error twice in our CI after we started the migration from SDK v2 to Plugin Framework. It never happened on local and we still trying to reproduce it. Do you see it consistently?
@danielmkn you're testing local on Mac? The CI runs on Linux. @mattmooree what os are you running on? What chip architecture? X86? Arm?
Go is supposed to make such cross platform issues a relic of the past, but might not live up to the ideal
Yup, I'm on Mac M1, and CI is Ubuntu 20. But even on Ubuntu, I don't see the issue on 7.10.0 today. All runs are green.
I can consistently reproduce the issue when changing my provider version to 7.10.0.
I confirmed that going back to 7.7.0 does not produce the same issue - everything runs smoothly.
Unfortunately I am running on terraform cloud - so I don't really have any insight into the OS architecture.
You bump the version in the provider configuration and run terraform init -upgrade
?
Yeap - done that.
- Installing jfrog/artifactory v7.10.0...
- Installed jfrog/artifactory v7.10.0 (signed by a HashiCorp partner
terraform init
on
artifactory = {
source = "registry.terraform.io/jfrog/artifactory"
version = "7.7.0"
}
terraform apply
on my configuration with 120+ resources.terraform init -upgrade
Terraform has been successfully initialized!Interesting...
For clarity - the upgrade works fine.
Terraform Cloud has been successfully initialized!
It's the subsequent plan that fails.
I ran plan
and apply
right after the upgrade, successful.
Can you share what kind of resources you have?
Although there are many resources in the workspace - the only artifactory resource is a data resource of type "artifactory_file".
data "artifactory_file" "artifact" {
...
}
It's not a resource, but data source.
The file data source was added successfully as well. I've tried the same path - apply, upgrade, plan, apply. What version of Terraform do you use?
data "artifactory_file" "my-file" {
repository = "local-data-source"
path = "artifact.zip"
output_path = "tmp/artifact.zip"
}
I am also experiencing this issue with version 7.10.0. I'm running in the cloud (linux_amd64) with terraform version 1.4.6
I try to reproduce this issue on HCP. Setup everything (account, org, workspace, project)and then execute a run (using 7.10.1 provider) that creates 101 users on one of our test Artifactory SaaS instance. No issue at all. 😞 ?
FYI this is the HCL I used for the test:
# Required for Terraform 0.13 and up (https://www.terraform.io/upgrade-guides/0-13.html)
terraform {
cloud {
organization = "jfrog-partnership-engineering"
workspaces {
name = "alexh"
}
}
required_providers {
artifactory = {
source = "jfrog/artifactory"
version = "7.10.1"
}
}
}
provider "artifactory" {
// supply ARTIFACTORY_ACCESS_TOKEN / JFROG_ACCESS_TOKEN / ARTIFACTORY_API_KEY and ARTIFACTORY_URL / JFROG_URL as env vars
}
resource "artifactory_user" "new_user" {
name = "new_user"
email = "new_user@somewhere.com"
groups = ["readers"]
}
locals {
user_names = ["new_user1", "new_user2", "new_user3", "new_user4", "new_user5", "new_user6", "new_user7", "new_user8", "new_user9", "new_user10", "new_user11", "new_user12", "new_user13", "new_user14", "new_user15", "new_user16", "new_user17", "new_user18", "new_user19", "new_user20", "new_user21", "new_user22", "new_user23", "new_user24", "new_user25", "new_user26", "new_user27", "new_user28", "new_user29", "new_user30", "new_user31", "new_user32", "new_user33", "new_user34", "new_user35", "new_user36", "new_user37", "new_user38", "new_user39", "new_user40", "new_user41", "new_user42", "new_user43", "new_user44", "new_user45", "new_user46", "new_user47", "new_user48", "new_user49", "new_user50", "new_user51", "new_user52", "new_user53", "new_user54", "new_user55", "new_user56", "new_user57", "new_user58", "new_user59", "new_user60", "new_user61", "new_user62", "new_user63", "new_user64", "new_user65", "new_user66", "new_user67", "new_user68", "new_user69", "new_user70", "new_user71", "new_user72", "new_user73", "new_user74", "new_user75", "new_user76", "new_user77", "new_user78", "new_user79", "new_user80", "new_user81", "new_user82", "new_user83", "new_user84", "new_user85", "new_user86", "new_user87", "new_user88", "new_user89", "new_user90", "new_user91", "new_user92", "new_user93", "new_user94", "new_user95", "new_user96", "new_user97", "new_user98", "new_user99", "new_user100"]
}
resource "artifactory_user" "user_names" {
for_each = toset(local.user_names)
email = "new_user@somewhere.com"
name = each.value
groups = ["readers"]
}
Ok, we found an issue. In this case, Terraform Cloud doesn't have JFROG_URL
and/or JFROG_ACCESS_TOKEN
env variables set. This is why the client gets ""
as a URL/Access token and panics.
First, please set the env variable correctly, second, we handling a missing configuration in a different way now, so it will complain right away if there is no URL/Access token supplied.
In the new version, when a situation like this occurs, the provider will throw the following error:
Planning failed. Terraform encountered an error while generating this plan.
╷
│ Error: Missing URL Configuration
│
│ with provider["registry.terraform.io/jfrog/artifactory"],
│ on sample.tf line 11, in provider "artifactory":
│ 11: provider "artifactory" {
The change will be released in v7.11.0
Note: the issue is related to the migration form SDK v2 to Plugin Framework.
Released in v7.11.0
When running a terraform plan with provider version 7.10.0 - a SIGSEGV is thrown and the plan fails: