cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Databricks Job API: The job must have exactly one owner

ameet9257
Contributor

Hi Team,

I'm trying to set the Job Permission using the Databricks Job API but getting the below error.

{
"error_code": "INVALID_PARAMETER_VALUE",
"message": "The job must have exactly one owner."
}
 
I first tried to get the job permission using the below API.
 
Below is the response I received. 
 
ameet9257_0-1731984876346.png

I used these details along with new permission to apply for the Job.

PUT https://adb-XXXXXXXXXX.10.azuredatabricks.net/api/2.0/permissions/jobs/18660

Body:

ameet9257_1-1731985277351.png

Response:

ameet9257_2-1731985298976.png
 
Let me know if anyone has faced the same issue.  

 

 
#databricks #jobs #api
Amit Prajapati
3 REPLIES 3

ameet9257
Contributor

Hi Team,

Right after this post, I tried to monitor the network log by inspecting an element from the UI Browser and found that the UI API is taking different parameters. 

 

{"access_control_list":[{"user_name":"xxxxxxx@xxxxxx.com","permission_level":"IS_OWNER"},{"group_name":"data-scientists-dev","permission_level":"CAN_MANAGE"}]}
 
Then I used the same body param and was able to set the permission. 
 
 
 
ameet9257_0-1731986725626.png
If you guys have any other inputs please do share. 
 
 
Amit Prajapati

Andolina
New Contributor III

Thank you for the solution Amit. I have been trying to update the permissions for my workflows since 1 day. I came across your post, changed the structure of the payload and it worked fine. So basically when you do a get request to fetch the ACLs, you get :

'access_control_list': [{'user_name': 'xyz@abc.org', 'display_name': 'Xyz, Fgv', 'all_permissions': [{'permission_level': 'IS_OWNER', 'inherited': False}]}]

But while updating, you need to discard the 'all_permissions' list and add everything inside in the dict. I wonder why it works this way when while  fetching the ACLs we get it with the 'all_permissions'.

Also I have seen if there are any inherited ACL, we do not have to mention that in the payload. It take the permission for that group (eg. admin) automatically.

Regards,

Andolina

mnreddy
New Contributor II

Hi , I have tried the same approach but it ddint work for me. Iam using api/2.0 with PUT Request

mnreddy_0-1736402218475.png

 

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now