Closed trevorwilliams2020 closed 2 months ago
Thanks for this report.
The error seems to be in go-vcloud-director/govcd/api_token.go where a string substitution assumes that /api
occurs only once, which apparently is not the case here.
I can't offer a workaround at the moment, but we will fix this issue as soon as possible.
Hello,
Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.
Terraform Version
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Debug Output
Please provide a link to GitHub Gist(s) containing complete debug output. You can enable debug by using the commands below:
On Windows the command instead of
export
isset
.Replicate the issue after setting the environment variables listed above and it should create two new files in the working directory:
tf.log
andgo-vcloud-director.log
. Thetf.log
is a general Terraform debug log (more information about it is in https://www.terraform.io/docs/internals/debugging.html) while thego-vcloud-director.log
is a specific log file forterraform-provider-vcd
containing debug information about performed API calls. Please attach both of them to your Gist.Panic Output
If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the
crash.log
.Expected Behavior
Should be able to use an api_token and authenticate successfully
Actual Behavior
url seems to get modified and returns an incorrect url. Having multiple instances of the word api could be causing issues? incorrect url returned which errors out and breaks the process.
Returned value when using api_token as the auth_type shown below.
https:/-vca-abXXX.something.foo.com.ie/api/oauth/tenant/abXXX-XX-XX/token
refer to the supplied url which begins with https://api-vca
I was able to change the provider to use auth_type = "token" and then use token = "a bearer token generated from the script supplied" which successfully authenticated using the same url. It's something about the process which the api_token handles and crafts the final URL.
bear_token process is ok
When using an api_token with the correct options causes the error as shown in the logs.
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform check
User Access rights
Information about user used. Role and/or more exact rights if it is customized. can create a bearer token and successfully authenticate using that token
Important Factoids
Is there anything atypical about your accounts that we should know?
References
Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example: