vmware-archive/pyvcloud

Listing network services results in "Error: Unable to execute query."

dbarkelew opened this issue · 1 comments

When I try to list any network services I get the following error.

~# vcd vapp network services nat list numuhukumakiakiaialunamor vAppNet-single
Usage: vcd vapp network services nat list [OPTIONS] <vapp-name> <network-name>
Try 'vcd vapp network services nat list -h' for help.

Error: Unable to execute query.

The vcd.log reports the following warning.

20-12-03 17:20:01 | client:2010 - _find_query_uri | WARNING :: Unable to locate query href for 'adminVApp' typed query.

The vcd_cli_error.log has the following backtrace.

Traceback (most recent call last):
  File "/home/ubuntu/.local/lib/python3.6/site-packages/vcd_cli/vapp_network_nat.py", line 219, in get_list_of_nat_rule
    vapp_nat = get_vapp_network_nat(ctx, vapp_name, network_name)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/vcd_cli/vapp_network_nat.py", line 94, in get_vapp_network_nat
    vapp_nat = VappNat(client, vapp_name, network_name)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/pyvcloud/vcd/vapp_services.py", line 48, in __init__
    self._build_self_href()
  File "/home/ubuntu/.local/lib/python3.6/site-packages/pyvcloud/vcd/vapp_services.py", line 63, in _build_self_href
    self.parent = self._get_parent_by_name()
  File "/home/ubuntu/.local/lib/python3.6/site-packages/pyvcloud/vcd/vapp_services.py", line 101, in _get_parent_by_name
    records = list(query.execute())
  File "/home/ubuntu/.local/lib/python3.6/site-packages/pyvcloud/vcd/client.py", line 1883, in execute
    raise OperationNotSupportedException('Unable to execute query.')
pyvcloud.vcd.exceptions.OperationNotSupportedException: Unable to execute query.

Trying to list the firewall rules results in what looks like the same error.

~# vcd vapp network services firewall list numuhukumakiakiaialunamor vAppNet-single
Usage: vcd vapp network services firewall list [OPTIONS] <vapp-name> <network-
                                               name>
Try 'vcd vapp network services firewall list -h' for help.

Error: Unable to execute query.

vcd.log

20-12-03 17:23:37 | client:2010 - _find_query_uri | WARNING :: Unable to locate query href for 'adminVApp' typed query.

vcd_cli_error.log

Traceback (most recent call last):
  File "/home/ubuntu/.local/lib/python3.6/site-packages/vcd_cli/vapp_network_firewall.py", line 196, in list_firewall_rule
    vapp_firewall = get_vapp_network_firewall(ctx, vapp_name, network_name)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/vcd_cli/vapp_network_firewall.py", line 73, in get_vapp_network_firewall
    vapp_dhcp = VappFirewall(client, vapp_name, network_name)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/pyvcloud/vcd/vapp_services.py", line 48, in __init__
    self._build_self_href()
  File "/home/ubuntu/.local/lib/python3.6/site-packages/pyvcloud/vcd/vapp_services.py", line 63, in _build_self_href
    self.parent = self._get_parent_by_name()
  File "/home/ubuntu/.local/lib/python3.6/site-packages/pyvcloud/vcd/vapp_services.py", line 101, in _get_parent_by_name
    records = list(query.execute())
  File "/home/ubuntu/.local/lib/python3.6/site-packages/pyvcloud/vcd/client.py", line 1883, in execute
    raise OperationNotSupportedException('Unable to execute query.')
pyvcloud.vcd.exceptions.OperationNotSupportedException: Unable to execute query.

Listing vApps, VMs and other operations are working fine. I have tried this against two different vCloud Director deployments and found the same behavior. The issue seems limited to all commands that are in "vcd vapp network services *"

Caught the same while calling get_vapp(name) in threads.