-
Notifications
You must be signed in to change notification settings - Fork 11
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
Error: expected "access_token" to not be an empty string when project provider is removed #112
Comments
@hsiddiqui84 Please provide an example of your HCL. This error suggests you still have a resource/data source that reference the |
I was getting the following error:
so I removed the project provider:
But I still had it declared as part of the required_providers block:
I went ahead and removed the above as well after which I got the original error reported in this issue:
I had to manually remove the projects from the state file to be able to successfully apply subsequent changes:
|
@hsiddiqui84 Your comment suggests that the project is removed out-of-band, i.e. not using I try to reproduce this by first creating a project: alexh@alexh-mac terraform-provider-project % terraform apply
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# project.myproject will be created
+ resource "project" "myproject" {
+ block_deployments_on_limit = false
+ description = "My Project"
+ display_name = "My Project"
+ email_notification = true
+ id = (known after apply)
+ key = "myproj"
+ max_storage_in_gibibytes = 10
+ use_project_group_resource = true
+ use_project_repository_resource = true
+ use_project_role_resource = true
+ use_project_user_resource = true
+ admin_privileges {
+ index_resources = true
+ manage_members = true
+ manage_resources = true
}
}
Plan: 1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
project.myproject: Creating...
project.myproject: Creation complete after 0s [id=myproj]
Apply complete! Resources: 1 added, 0 changed, 0 destroyed. Then without changing the configuration, I delete the project in Artifactory web UI. Then run alexh@alexh-mac terraform-provider-project % terraform plan
project.myproject: Refreshing state... [id=myproj]
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# project.myproject will be created
+ resource "project" "myproject" {
+ block_deployments_on_limit = false
+ description = "My Project"
+ display_name = "My Project"
+ email_notification = true
+ id = (known after apply)
+ key = "myproj"
+ max_storage_in_gibibytes = 10
+ use_project_group_resource = true
+ use_project_repository_resource = true
+ use_project_role_resource = true
+ use_project_user_resource = true
+ admin_privileges {
+ index_resources = true
+ manage_members = true
+ manage_resources = true
}
}
Plan: 1 to add, 0 to change, 0 to destroy.
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Note: You didn't use the -out option to save this plan, so Terraform can't guarantee to take exactly these actions if you run "terraform apply" now. Without applying the change, I remove alexh@alexh-mac terraform-provider-project % terraform plan
project.myproject: Refreshing state... [id=myproj]
No changes. Your infrastructure matches the configuration.
Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed. Again TF & the provider is behaving correctly with no error. I then remove the After running |
@hsiddiqui84 In your comment, you have the project provider version 1.4.0 project = {
source = "registry.terraform.io/jfrog/project"
version = "1.4.0"
} I suspect that is how you are getting that 404 error from the provider/API. Please upgrade to 1.5.2 and let me know if this issue still exists. |
Your understanding is correct. The functionality to add / modify projects on the edge nodes is no longer available so the projects were manually removed by the PE team. The existing remote repos needed to be detached from the existing projects before deleting them. We no longer use te project provider for edge nodes so we are good for now. |
Describe the bug
Artifactory Cloud version: 7.78.1
Terraform version: 1.3.6
Project provider version: 1.5.2
Upon removing the project provider, terraform plan fails with the following error:
Requirements for and issue
curl
it at$host/artifactory/api/system/version
Expected behavior
The project provider can be removed without any errors.
This is similar to the issue for the artifactory provider: jfrog/terraform-provider-artifactory#425
The text was updated successfully, but these errors were encountered: