admin管理员组

文章数量:1405121

I have a firebase function that attempts to enqueue a task with some data. Every time I call it I get the following two errors from the cloud run logs:

requests.exceptions.HTTPError: 400 Client Error: Bad Request for url:

firebase_admin.exceptions.InvalidArgumentError: Request contains an invalid argument.

Here is my code:

@scheduler_fn.on_schedule(schedule="every day 00:00", timeout_sec=540, secrets=[APIFY_API_KEY])
def update_brooklyn_listings(event: scheduler_fn.ScheduledEvent) -> None:
    asyncio.run(update_brooklyn_listings_async())

async def update_brooklyn_listings_async():
    result = await SOME_ASYNC_TASK
    data = json.loads(result.get_bytes(format="json"))
    body = {"data": data}
    task_queue = functions.task_queue("functionname")
    task_queue.enqueue(body)

Based on the enqueue documentation no options parameter is needed, and the data passed in can be of type Any. Any idea what I could be missing here?

本文标签: pythonIncorrect argument error when trying to enqueue a task within a firebase functionStack Overflow