RuntimeWarning: Coroutine Was Never Awaited

RuntimeWarning: coroutine 'fetch_data' was never awaited

Quick Answer

You called an async function without 'await', so it returned a coroutine object instead of executing. Add 'await' before the call.

Why This Happens

Calling an async function without 'await' does not execute it. It creates a coroutine object that is immediately discarded. The function body never runs.

The Problem

async def save(data):
    print(f'Saving {data}')

async def main():
    save('test')  # Missing await!

asyncio.run(main())

The Fix

async def save(data):
    print(f'Saving {data}')

async def main():
    await save('test')

asyncio.run(main())

Step-by-Step Fix

  1. 1

    Add await

    Put 'await' before every async function call.

  2. 2

    Check all async calls

    Search for calls to async functions missing await.

  3. 3

    Use asyncio.create_task()

    For concurrent execution: asyncio.create_task(coro()).

Bugsly catches this automatically

Bugsly's AI analyzes this error pattern in real-time, explains what went wrong in plain English, and suggests the exact fix — before your users even report it.

Try Bugsly free