-
Notifications
You must be signed in to change notification settings - Fork 20
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
When updating a protection job, it just says "'{"errorCode":"KInternalError","message":"Request failed with error code: KInvalidRequest"}" . No other explanation #81
Comments
@anusajith Will check and let you know |
@anusajith What is the cluster version and SDK version you're using? |
sdk version - 1.10.1 |
here I am trying to add more than 100 views to the cohesity view type protection job. Is there a limit to that number through api? One other thing noted was: Through UI: https://<cohesity_endpoint>/v2/data-protect/protection-groups/ Is the client version (v1 or v2) is a reason of this error? |
@anusajith I m using a 7.0 cluster. I was able to create and update job using viewId(not source id) with SDK. The issue doesn't seem to be with SDK, can you please try with different cluster version? |
@naveena-maplelabs , Did you try updating a Protection job with more than 100 + views in it as shown.? |
@naveena-maplelabs , can you please provide an update, as this is stopping our automation for cohesity provision. |
@anusajith I was able to reproduce the issue when the total number of views greater than 100. Have reported to the concerned team, Can you try View_job creation using V2 APIs? |
@naveena-maplelabs Thank you for that. |
You can install the V2 SDK using following command. Links: Sample Code:
|
@naveena-maplelabs , Having issues with V2 client too: cohesity/cohesity_sdk#1. Not sure , whether it will be answered or not. |
Any update on this? |
@anusajith Will check and get back to you. |
Issue resolved with V2 SDk 1.2.0 version. |
So will there be any fix going in V1 client? |
@anusajith That need a V1 API fix, our SDK has nothing to do with it. Even with API we can't create job with more than 100+ views. |
Thank you @naveena-maplelabs for all your responses. |
🐛 Bug Report
Hey Team,
I am trying to update a protection job (Cohesity view type) by adding one newly created view to it.
To Reproduce
These are the snippets I am using:
def get_protection_job_by_name(self, group_name: str):
protection_job_list = self._client.protection_jobs.get_protection_jobs()
for job in protection_job_list:
if job.name == group_name:
return job
return None
existing_job =get_protection_job_by_name("cohesity views")
getting view id of the new view created eg: 11111111
As a work around: When fetching a Protection Job , source Ids are not same as the View Ids. So When we are trying to update a protection job with 100+ views in it, we have to explicitly convert those source ids to respective View Ids and then run the update method.(view_source_ids)
new_source_ids= view_source_ids.append(11111111)
job_body = ProtectionJobRequestBody(
name=job_info["job_name"],
source_ids=new_source_ids,
policy_id=existing_job.policy_id,
view_box_id=existing_job.view_box_id,
environment="kView",
timezone="Australia/Sydney",
)
job_body.id = existing_job.id
6. cohesity_client.protection_jobs.update_protection_job(job_body, existing_job.id)
Expected behavior
update protection job should be successful.
Actual Behavior
It is failing with following error:
'{"errorCode":"KInternalError","message":"Request failed with error code: KInvalidRequest"}\n'
No other explanations . It is working through UI without any issues.
How can I validate the ProtectionJobRequestBody I am sending is proper? or where am I going wrong?
Regards,
Anu
The text was updated successfully, but these errors were encountered: