Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Creating CronWorkflow raises exception - field active must not be None #33

Open
nfs950512 opened this issue Apr 9, 2021 · 5 comments
Open

Comments

@nfs950512
Copy link

nfs950512 commented Apr 9, 2021

When creating a CronWorkflow instance which is not meant to be executed right away using create_cron_workflow(), exception will be raised when trying to construct the response into V1alpha1CronWorkflow and V1alpha1CronWorkflowStatus schema.

File "/usr/local/lib/python3.6/site-packages/argo/workflows/client/api/cron_workflow_service_api.py", line 62, in create_cron_workflow
    return self.create_cron_workflow_with_http_info(namespace, body, **kwargs)  # noqa: E501
  File "/usr/local/lib/python3.6/site-packages/argo/workflows/client/api/cron_workflow_service_api.py", line 162, in create_cron_workflow_with_http_info
    collection_formats=collection_formats)
  File "/usr/local/lib/python3.6/site-packages/argo/workflows/client/api_client.py", line 369, in call_api
    _preload_content, _request_timeout, _host)
  File "/usr/local/lib/python3.6/site-packages/argo/workflows/client/api_client.py", line 208, in __call_api
    return_data = self.deserialize(response_data, response_type)
  File "/usr/local/lib/python3.6/site-packages/argo/workflows/client/api_client.py", line 280, in deserialize
    return self.__deserialize(data, response_type)
  File "/usr/local/lib/python3.6/site-packages/argo/workflows/client/api_client.py", line 319, in __deserialize
    return self.__deserialize_model(data, klass)
  File "/usr/local/lib/python3.6/site-packages/argo/workflows/client/api_client.py", line 658, in __deserialize_model
    kwargs[attr] = self.__deserialize(value, attr_type)
  File "/usr/local/lib/python3.6/site-packages/argo/workflows/client/api_client.py", line 319, in __deserialize
    return self.__deserialize_model(data, klass)
  File "/usr/local/lib/python3.6/site-packages/argo/workflows/client/api_client.py", line 660, in __deserialize_model
    instance = klass(**kwargs)
  File "/usr/local/lib/python3.6/site-packages/argo/workflows/client/models/v1alpha1_cron_workflow_status.py", line 59, in __init__
    self.active = active
  File "/usr/local/lib/python3.6/site-packages/argo/workflows/client/models/v1alpha1_cron_workflow_status.py", line 84, in active
    raise ValueError("Invalid value for `active`, must not be `None`")  # noqa: E501
ValueError: Invalid value for `active`, must not be `None

As there are no running workflows for this CronWorkflow, fields active, last_scheduled_time and conditions are meant to be empty.
https://github.com/argoproj-labs/argo-client-python/blob/master/argo/workflows/client/models/v1alpha1_cron_workflow_status.py#L74-L85

    @active.setter
    def active(self, active):
        """Sets the active of this V1alpha1CronWorkflowStatus.
        Active is a list of active workflows stemming from this CronWorkflow  # noqa: E501
        :param active: The active of this V1alpha1CronWorkflowStatus.  # noqa: E501
        :type: list[V1ObjectReference]
        """
        if self.local_vars_configuration.client_side_validation and active is None:  # noqa: E501
            raise ValueError("Invalid value for `active`, must not be `None`")  # noqa: E501

        self._active = active

Is there a purpose to raise these exceptions, or is it possible to depress the exceptions with the API calls?

@nfs950512 nfs950512 changed the title Creating Creating CronWorkflow raises exception - field active must not be None Apr 9, 2021
@nfs950512
Copy link
Author

This issue is identical to argoproj/argo-workflows#4510

@nfs950512
Copy link
Author

https://github.com/argoproj-labs/argo-client-python/blob/master/argo/workflows/client/configuration.py#L186-L187

Wanted to confirm if this is a typo

        # Disable client side validation
        self.client_side_validation = True

@zgs225
Copy link

zgs225 commented Apr 22, 2021

Hi, I occurs this error too. Are you solved?

@nfs950512
Copy link
Author

nfs950512 commented Apr 22, 2021

I temporarily solved it by disabling client side validation shown above.

@duduz
Copy link

duduz commented Jun 10, 2021

I've encountered this issue as well, too bad we can't pass client_side_validation as a parameter to the configuration.

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

No branches or pull requests

3 participants