terraform-provider-openstack: authentication worked in 1.3.0 but fails in 1.4.0
Terraform Version
$ terraform -v
Terraform v0.11.7
Affected Resource(s)
All openstack_ resources and data sources.
Debug Output
Relevant output is:
2018/05/02 14:44:02 [ERROR] root: eval: *terraform.EvalConfigProvider, err: You must provide exactly one of DomainID or DomainName in a Scope with ProjectName
2018/05/02 14:44:02 [ERROR] root: eval: *terraform.EvalSequence, err: You must provide exactly one of DomainID or DomainName in a Scope with ProjectName
2018/05/02 14:44:02 [ERROR] root: eval: *terraform.EvalOpFilter, err: You must provide exactly one of DomainID or DomainName in a Scope with ProjectName
2018/05/02 14:44:02 [ERROR] root: eval: *terraform.EvalSequence, err: You must provide exactly one of DomainID or DomainName in a Scope with ProjectName
2018/05/02 14:44:02 [TRACE] [walkRefresh] Exiting eval tree: provider.openstack
Expected Behavior
v1.4.0 should work with existing configurations that worked with v.1.3.0.
Actual Behavior
WIth v.1.40, auth failed with the error message:
Error: Error refreshing state: 1 error(s) occurred:
* provider.openstack: You must provide exactly one of DomainID or DomainName in a Scope with ProjectName
Important Factoids
This issue can be solved (in our environment) by setting an additional environment variable: OS_PROJECT_DOMAIN_NAME=Default
Note that with v1.3.0, the OS_ vars we had set (and were working) were:
OS_AUTH_URLOS_USERNAMEOS_PASSWORDOS_PROJECT_NAMEOS_USER_DOMAIN_NAME
With v.1.4.0, it appears we need to set:
OS_AUTH_URLOS_USERNAMEOS_PASSWORDOS_PROJECT_NAMEOS_USER_DOMAIN_NAMEOS_PROJECT_DOMAIN_NAME
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (10 by maintainers)
@posox I see the problem.
I’m quite sure if you do:
It’ll start working again.
This is a bug in the new upstream authentication code. I’ll get this fixed.
We’re going to have a short release cycle for version 1.5, so this will be released within the next 7-10 days.
First and foremost, I apologize for the inconvenience this is causing you folks.
The changes made were:
user_domain_name,user_domain_id,project_domain_name, andproject_domain_idwere added. Adding arguments is not a breaking change.domain_nameanddomain_idto the newly created, corrected arguments.Our analysis was that the only way this change would cause disruption to users is if an incorrect environment variable was being used previously. That environment variable would then be read by a new authentication field and a scoping error would occur. This sounds exactly what is happening here.
This change resolved several bugs being reported for users who were unable to log in using the credentials provided to them by their cloud providers. In fact, this bug was preventing entire public OpenStack clouds from cleanly working with Terraform.
This change was tested across five different clouds by two developers with different forms of authentication and no issues were seen. Of course we realize that there will be edge cases because of this change and we will definitely provide help and troubleshooting for these cases.
My understanding, from what has been provided, is that you folks are hitting an issue where an environment variable is now being set in the new argument and you need to change your auth settings. To that, I absolutely do sympathize. I understand that your workflows have become reliant upon that configuration and this is disruptive.
From reading the provided information, you were previously setting
OS_USER_DOMAIN_NAME. While this worked before, it should actually never have worked. The reason it was working before is thatOS_USER_DOMAIN_NAMEwas being squashed, along with otherOS_*_DOMAIN_*variables into the defaultOS_DOMAIN_IDandOS_DOMAIN_NAMEsettings. This should have never been done in the provider.The error message you’re getting is correct: you need to provide a domain name or ID (either by setting
OS_PROJECT_DOMAIN_NAMEorOS_DOMAIN_NAME) when authenticating with a project.OS_USER_DOMAIN_*scopes a user to a domain, not a project to a domain.After setting
OS_PROJECT_DOMAIN_NAMEorOS_DOMAIN_NAME, my guess is that you can unsetOS_USER_DOMAIN_NAMEentirely and still authenticate.Again, I do understand that this has caused disruption. Please let me know if this analysis is incorrect or if you’d like to continue discussing this.
edit: to clarify this situation in more detail: If you were to revert to 1.3 and only use
OS_PROJECT_DOMAIN_NAME(or evenOS_DOMAIN_NAME), you would still authenticate correctly. When moving to 1.4 and retain these settings, you would see no impact. It’s really only by coincidence thatOS_USER_DOMAIN_NAMEhad a correct value which allowed the project/domain scoping to work in 1.3 and prior. I’m basing this on the information provided and I might be wrong. Please let me know if I’m wrong here as if there truly is a bug, I’d like to identify and fix it.