Tried to run `datahub ingest list-runs` and got t...
# troubleshoot
g
Tried to run
datahub ingest list-runs
and got the following error. Any ideas on how to solve this? Thanks
plus1 1
a
Hi @gentle-lifeguard-88494, have you modified any JSON in the project or could there be faulty JSON in any of your sources?
g
@astonishing-answer-96712 I'll check, but I don't think I've modified any of the JSON in the project
a
Thanks- let me know here, what version are you on?
g
@astonishing-answer-96712 I'm on v0.9.6.1
@astonishing-answer-96712 Looks like it's related to how I have permissions set
image.png
@astonishing-answer-96712 Ok, I got it. Looks like since it's accessing the gms endpoint, I need to pass in my authentication. Here is how I modified it to work:
Copy code
def list_runs(page_offset: int, page_size: int, include_soft_deletes: bool) -> None:
    """List recent ingestion runs to datahub"""

    session, gms_host = get_session_and_host()

    url = f"{gms_host}/runs?action=list"

    payload_obj = {
        "pageOffset": page_offset,
        "pageSize": page_size,
        "includeSoft": include_soft_deletes,
    }

    payload = json.dumps(payload_obj)

    datahub_key = os.getenv("DATAHUB_TOKEN")

    headers = {
    'Authorization': f'Bearer {datahub_key}',
    'Content-Type': 'application/json'
    }

    response = <http://session.post|session.post>(url, data=payload, headers=headers)
I assume I'm not passing in my API key correctly in my recipe? Or it looks like this isn't even configured to handle my datahub key. What do you think? Thanks!
Here is my recipe for reference: