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

Cluster creation request failed exception_handler_wrapper can only concatenate str (not "NoneType") to str #1370

Open
Lorislombardi opened this issue Jul 12, 2022 · 2 comments
Labels

Comments

@Lorislombardi
Copy link

Describe the bug

Creating a tkgm cluster fails before even starting to clone VMs. Creation does not launch and fails with the error below

`22-07-13 00:50:40 | mqtt_consumer:50 - process_behavior_message | Request Id: 2abaa25a-1232-40c5-a4c9-3c85c4aeb856 | DEBUG :: Received behavior invocation: urn:vcloud:behavior-interface:createCluster:cse:k8s:1.0.0 on entityId:urn:vcloud:entity:cse:nativeCluster:c8ac621e-5d61-4a47-a0e5-de2f85bc4d11 with requestId: 9c52fba2-3c8c-4472-94f8-e59b9cba89e9
22-07-13 00:50:40 | behavior_handler:45 - exception_handler_wrapper | Request Id: 2abaa25a-1232-40c5-a4c9-3c85c4aeb856 | ERROR :: can only concatenate str (not "NoneType") to str
Traceback (most recent call last):
  File "/opt/cse/python/lib/python3.7/site-packages/container_service_extension/server/behavior_handler.py", line 43, in exception_handler_wrapper
    result = func(*args, **kwargs)
  File "/opt/cse/python/lib/python3.7/site-packages/container_service_extension/server/behavior_handler.py", line 60, in create_cluster
    cloudapi_client: CloudApiClient = behavior_ctx.op_ctx.cloudapi_client
  File "/opt/cse/python/lib/python3.7/site-packages/container_service_extension/security/context/operation_context.py", line 46, in cloudapi_client
    return self.user.cloud_api_client
  File "/opt/cse/python/lib/python3.7/site-packages/container_service_extension/security/context/operation_context.py", line 59, in user
    return self.get_user_context(api_version)
  File "/opt/cse/python/lib/python3.7/site-packages/container_service_extension/security/context/operation_context.py", line 80, in get_user_context
    self._update_user_context_map(api_version=api_version)
  File "/opt/cse/python/lib/python3.7/site-packages/container_service_extension/security/context/operation_context.py", line 91, in _update_user_context_map
    api_version=api_version
  File "/opt/cse/python/lib/python3.7/site-packages/container_service_extension/common/utils/pyvcloud_utils.py", line 75, in connect_vcd_user_via_token
    is_jwt_token=True
  File "/opt/cse/python/lib/python3.7/site-packages/pyvcloud/vcd/client.py", line 1105, in rehydrate_from_token
    'Bearer ' + self._vcloud_access_token
TypeError: can only concatenate str (not "NoneType") to str
22-07-13 00:50:40 | behavior_dispatcher:81 - process_behavior_request | Request Id: 2abaa25a-1232-40c5-a4c9-3c85c4aeb856 | ERROR :: Error while executing handler: {'majorErrorCode': 400, 'minorErrorCode': <MinorErrorCode.DEFAULT_ERROR_CODE: -1>, 'message': 'can only concatenate str (not "NoneType") to str'}
Traceback (most recent call last):
  File "/opt/cse/python/lib/python3.7/site-packages/container_service_extension/server/behavior_handler.py", line 43, in exception_handler_wrapper
    result = func(*args, **kwargs)
  File "/opt/cse/python/lib/python3.7/site-packages/container_service_extension/server/behavior_handler.py", line 60, in create_cluster
    cloudapi_client: CloudApiClient = behavior_ctx.op_ctx.cloudapi_client
  File "/opt/cse/python/lib/python3.7/site-packages/container_service_extension/security/context/operation_context.py", line 46, in cloudapi_client
    return self.user.cloud_api_client
  File "/opt/cse/python/lib/python3.7/site-packages/container_service_extension/security/context/operation_context.py", line 59, in user
    return self.get_user_context(api_version)
  File "/opt/cse/python/lib/python3.7/site-packages/container_service_extension/security/context/operation_context.py", line 80, in get_user_context
    self._update_user_context_map(api_version=api_version)
  File "/opt/cse/python/lib/python3.7/site-packages/container_service_extension/security/context/operation_context.py", line 91, in _update_user_context_map
    api_version=api_version
  File "/opt/cse/python/lib/python3.7/site-packages/container_service_extension/common/utils/pyvcloud_utils.py", line 75, in connect_vcd_user_via_token
    is_jwt_token=True
  File "/opt/cse/python/lib/python3.7/site-packages/pyvcloud/vcd/client.py", line 1105, in rehydrate_from_token
    'Bearer ' + self._vcloud_access_token
TypeError: can only concatenate str (not "NoneType") to str

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/cse/python/lib/python3.7/site-packages/container_service_extension/server/behavior_dispatcher.py", line 73, in process_behavior_request
    return MAP_BEHAVIOR_ID_TO_HANDLER_METHOD[behavior_id](behavior_ctx)
  File "/opt/cse/python/lib/python3.7/site-packages/container_service_extension/server/behavior_handler.py", line 46, in exception_handler_wrapper
    raise cse_exception.BadRequestError(error_message=str(error))
container_service_extension.exception.exceptions.BadRequestError: can only concatenate str (not "NoneType") to str
22-07-13 00:50:40 | mqtt_publisher:116 - send_response | Request Id: 2abaa25a-1232-40c5-a4c9-3c85c4aeb856 | DEBUG :: publish return (rc, msg_id): (0, 8)
22-07-13 00:50:40 | mqtt_consumer:60 - process_behavior_message | Request Id: 2abaa25a-1232-40c5-a4c9-3c85c4aeb856 | DEBUG :: MQTT response: {'type': 'BEHAVIOR_RESPONSE', 'headers': {'taskId': '06e5e609-02f0-4435-afff-731284d0e5c9', 'entityId': 'urn:vcloud:entity:cse:nativeCluster:c8ac621e-5d61-4a47-a0e5-de2f85bc4d11', 'contentType': 'application/vnd.vmware.vcloud.task+json'}, 'payload': '{"status": "error", "error": {"majorErrorCode": 400, "minorErrorCode": -1, "message": "can only concatenate str (not \\"NoneType\\") to str"}}'}

`

Reproduction steps

1. Create a cluster from vcd wizzard
2. 
3.
...

Expected behavior

Tkgm cluster created

Additional context

CSE Server :
CSE server 3.1.1 with plugin UI 3.1.0
Also try wirh CSE server 3.1.3 with plugin UI 3.3.0

VMware Cloud Director version:
10.3.1.18738571

Tkgm OVA
ubuntu-2004-kube-v1.19.12+vmware.1-tkg.1-15841320193950299489.ova
ubuntu-2004-kube-v1.20.8+vmware.1-tkg.1-17589475007677388652.ova
ubuntu-2004-kube-v1.21.2+vmware.1-tkg.1-7832907791984498322.ova
ubuntu-2004-kube-v1.22.5+vmware.1-tkg.2-f838b27ca494fee7083c0340e11ce243.ova

@sahithi
Copy link
Collaborator

sahithi commented Jul 25, 2022

This seems to be an error from pyvcloud.
@ltimothy7 Are you aware of this? Is this fixed in CSE 3.1.4?

@Lorislombardi
Copy link
Author

I confirm this issue seems to be fixed with the VCD on version 10.3.3.20027910 and CSE on 3.1.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants