Skip to content
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

Malformed http GET request for catalogs #831

Closed
nussera opened this issue Apr 21, 2022 · 1 comment
Closed

Malformed http GET request for catalogs #831

nussera opened this issue Apr 21, 2022 · 1 comment
Assignees

Comments

@nussera
Copy link

nussera commented Apr 21, 2022

Hello,

This only happens when applying a new vApp. Existing vApps are not effected.
During the initial modificiation check, a request in the form of
GET /api/query?&filter=orgName==tma;name==CentOS vdc04&type=catalog&filterEncoded=true
is sent. This is invalid as the blank between "CentOS" and "vdc04" is not URL encoded.
The correct request would be
GET /api/query?&filter=orgName==tma;name==CentOS%20vdc04&type=catalog&filterEncoded=true with the blank being URL encoded as '%20'

Terraform Version

Terraform v1.1.9 on linux_amd64

Initializing provider plugins...
- Finding vmware/vcd versions matching ">= 3.5.0"...
- Using previously-installed vmware/vcd v3.6.0

Affected Resource(s)

Please list the resources as a list, for example:

  • datasource vcd_catalog

Terraform Configuration Files

data "vcd_catalog" "centos_cataloge" {
  org  = var.org_name
  name = "CentOS vdc04"
}

Debug Output

IMHO there isn't much useful debug output. The error speaks for itself.

Applying modifications
╷
│ Error: unable to retrieve catalog record - error decoding query results: XML syntax error on line 1: element <br> closed by </body>
│ 
│   with module.datasources.data.vcd_catalog.centos_cataloge,
│   on ../../modules/datasources/main.tf line 10, in data "vcd_catalog" "centos_cataloge":
│   10: data "vcd_catalog" "centos_cataloge" {
│ 
╵
ERRO[0005] 1 error occurred:
        * exit status 1

Panic Output

None

Expected Behavior

terraform apply works.

Actual Behavior

The request GET /api/query?&filter=orgName==tma;name==CentOS vdc04&type=catalog&filterEncoded=true gets rejected.

Steps to Reproduce

  1. Define a new vApp and let it use a data source with a blank ' ' in its name.
  2. terraform apply

User Access rights

N/A

Important Factoids

N/A

References

N/A

@vbauzys
Copy link
Contributor

vbauzys commented Jun 15, 2022

Fix will be released in 3.7.0 version.

@vbauzys vbauzys closed this as completed Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants