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

A job without an owner fails the import pipeline #168

Open
petrcv-db opened this issue Apr 27, 2022 · 1 comment
Open

A job without an owner fails the import pipeline #168

petrcv-db opened this issue Apr 27, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@petrcv-db
Copy link

Apparently, in a legacy workspace it's possible to have a job with no owner:

{
    "object_id": "/jobs/803387",
    "object_type": "job",
    "access_control_list": [
        {
            "group_name": "admins",
            "all_permissions": [
                {
                    "permission_level": "CAN_MANAGE",
                    "inherited": true,
                    "inherited_from_object": [
                        "/jobs/"
                    ]
                }
            ]
        }
    ],
    "http_status_code": 200,
    "job_name": "my job 7"
}

Trying to import the job acl fails with the error:

2022-04-27,08:29:53;DEBUG;https://xxx-play-ground.cloud.databricks.com:443 "PATCH /api/2.0/preview/permissions/jobs/890131015122789 HTTP/1.1" 500 None
Traceback (most recent call last):
  File "migration_pipeline.py", line 328, in <module>
    main()
  File "migration_pipeline.py", line 324, in main
    pipeline.run()
  File "/home/ubuntu/migrate/pipeline/pipeline.py", line 64, in run
    future.result()
  File "/usr/lib/python3.8/concurrent/futures/_base.py", line 444, in result
    return self.__get_result()
  File "/usr/lib/python3.8/concurrent/futures/_base.py", line 389, in __get_result
    raise self._exception
  File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/ubuntu/migrate/pipeline/pipeline.py", line 73, in _run_task
    task.run()
  File "/home/ubuntu/migrate/tasks/tasks.py", line 274, in run
    jobs_c.import_job_configs()
  File "/home/ubuntu/migrate/dbclient/JobsClient.py", line 202, in import_job_configs
    acl_resp = self.patch(api, acl_create_args)
  File "/home/ubuntu/migrate/dbclient/dbclient.py", line 265, in patch
    return self.http_req('patch', endpoint, json_params, version, print_json)
  File "/home/ubuntu/migrate/dbclient/dbclient.py", line 243, in http_req
    raise Exception("Error: {0} request failed with code {1}\n{2}".format(http_type,
Exception: Error: patch request failed with code 500
{"error_code":"INTERNAL_ERROR","message":"The job must have exactly one owner."}

I guess if we have a job like this, it should use the current user (admin) as a job owner.

@mrchristine mrchristine added the bug Something isn't working label Jul 7, 2022
@mrchristine
Copy link
Contributor

@gregwood-db could you take a look at this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants