datadrivers/terraform-provider-nexus

Error: Empty Summary on plan

baughj opened this issue ยท 9 comments

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a ๐Ÿ‘ reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

1.1.3, terraform enterprise

Nexus Provider Version

1.21.0

Nexus Version

3.41.0

Affected Resource(s)/Data Source(s)

nexus_security_role

Terraform Configuration Files

resource "nexus_security_role" "nx_engineering_user" {
  roleid = "nx-engineering-user"
  description = "Standard access to repositories"
  name = "Nexus Engineering User"
  privileges = [
    "nx-repository-view-maven2-xyz-snapshots-*",
    "nx-repository-view-maven2-xyz-releases-browse",
    "nx-repository-view-maven2-xyz-releases-read",
    "nx-userschangepw"
  ]
}

resource "nexus_security_role" "nx_senior_engineering_user" {
  roleid = "nx-sr-engineering-user"
  description = "Full access to xyz repositories"
  name = "Nexus Senior Engineering User"
  roles = [nexus_security_role.nx_engineering_user.roleid]
  privileges = [
    "nx-repository-view-maven2-xyz-releases-*"
  ]
}

Debug Output/Panic Output

Applies fine one time, on future plans / applies, errors out immediately with:

โ•ท
โ”‚ Error: Empty Summary: This is always a bug in the provider and should be reported to the provider developers.
โ”‚ 
โ”‚   with nexus_security_role.nx_engineering_user,
โ”‚   on nexus-roles.tf line 1, in resource "nexus_security_role" "nx_engineering_user":
โ”‚    1: resource "nexus_security_role" "nx_engineering_user" {
โ”‚ 
โ•ต

Expected Behaviour

No changes, so nothing should happen. Plan should simply complete / apply cleanly.

Actual Behaviour

Cannot plan or reapply terraform due to above error message.

Steps to Reproduce

Create a role using nexus_security_role and terraform apply; then re-plan using terraform plan.

References

No response

Hi @baughj,

i cannot reproduce your error.
this is my configuration:

resource "nexus_security_role" "nx_engineering_user" {
  roleid = "nx-engineering-user"
  description = "Standard access to repositories"
  name = "Nexus Engineering User"
  privileges = [
    "nx-repository-view-maven2-maven-snapshots-*",
    "nx-repository-view-maven2-maven-releases-browse",
    "nx-repository-view-maven2-maven-releases-read",
    "nx-userschangepw"
  ]
}

resource "nexus_security_role" "nx_senior_engineering_user" {
  roleid = "nx-sr-engineering-user"
  description = "Full access to xyz repositories"
  name = "Nexus Senior Engineering User"
  roles = [nexus_security_role.nx_engineering_user.roleid]
  privileges = [
    "nx-repository-view-maven2-maven-releases-*"
  ]
}

and this is my output
image

Can you add a debug output?

@baughj i was getting this "empty summary" error as well, but it was because i had changed the password on the nexus account i was using, but didn't update the provider setting. Once it was correct it started working again.

This issue has been automatically marked as stale because it has had no activity in the last 90 days. It will be closed in 7 days if no further activity occurs. Leaving a comment starting with /fresh will mark this issue as not stale.

I too am getting that error, but in our case it seems to be related to the use of forward slashes in either roleid or name; both of which are acceptable in Nexus.

resource "nexus_security_role" "cps-se" {
  roleid = "CPS/SE"
  name   = "CPS/SE"
  privileges = [
    "CPS_docker_release",
    "CPS_docker_snapshot",
    "docker_login",
    "docker_pull",
    "nx-repository-view-*-*-browse",
    "nx-repository-view-*-*-read",
    "nx-search-read",
  ]

  depends_on = [
    nexus_privilege.cps_docker_snapshot,
    nexus_privilege.cps_docker_release
  ]
}

When running this, it allegedly fails during the apply phase, but the role gets created and the state is updated with the new role, however this prevents any further plans / applies from running until such time as it is removed from the state.

I am unsure as to whether this is related to OP's issue, so if you need me to raise a new issue for this occurrence in particular, please let me know and I'll be happy to. It is the exact same error message.

anmoel commented

/refresh

/fresh Everybody can reproduce the bug if he adds another valid resource to the valid plan and tries to "plan" or "apply" it with terraform. Everything as described but

terraform version is 1.5.3
nexus provider version 1.21.2
nexus from the docker image sonatype/nexus3:3.58.1

Looks like it happens when the wrong password is provided as provider credentials.
In this particular case, after the creation of a new user and first login Nexus asks to update the password.
But the password is changed for the admin user.

Looks like it happens when the wrong password is provided as provider credentials. In this particular case, after the creation of a new user and first login Nexus asks to update the password. But the password is changed for the admin user.

Nope. The password remains the same.

I cannot reproduce any of the mentioned scenarios, and it seems these could even be separate issues. I will close this issue for now, please create a new issue if you run into a similar problem.