Skip to content

[Bug]: AttributeError in AutoAPI v3 Diagnostics #2962

@MichaelDecent

Description

@MichaelDecent

Describe the Bug

The AutoAPI v3 diagnostics endpoint (/system/methodz) is throwing an AttributeError because it's trying to access a returns attribute on OpSpec objects that doesn't exist in the v3 implementation.

Steps to Reproduce

Step 1: Start the AutoAPI v3 Application

cd /Users/michaeldecent/Swarmauri/swarmauri-sdk
uv run --directory pkgs/standards/auto_kms auto-kms

Step 2: Wait for Server to Start

You should see output like:

INFO:     Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
INFO:     Application startup complete.

Step 3: Access the Diagnostics Endpoint

Open your browser or use curl to access:

curl http://127.0.0.1:8000/system/methodz

OR visit in browser:

http://127.0.0.1:8000/system/methodz

Expected Result: Error

You'll get a 500 Internal Server Error with this stack trace:

AttributeError: 'OpSpec' object has no attribute 'returns'
  File "autoapi/v3/system/diagnostics.py", line 151, in _methodz
    "returns": sp.returns,
               ^^^^^^^^^^

Software Version

<0.4.0

Python Version

Python 3.8

Environment Details

uv environment

Relevant Logs or Error Output

ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/Users/michaeldecent/Swarmauri/swarmauri-sdk/pkgs/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/httptools_impl.py", line 409, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/michaeldecent/Swarmauri/swarmauri-sdk/pkgs/.venv/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/michaeldecent/Swarmauri/swarmauri-sdk/pkgs/.venv/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/Users/michaeldecent/Swarmauri/swarmauri-sdk/pkgs/.venv/lib/python3.12/site-packages/starlette/applications.py", line 112, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/Users/michaeldecent/Swarmauri/swarmauri-sdk/pkgs/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 187, in __call__
    raise exc
  File "/Users/michaeldecent/Swarmauri/swarmauri-sdk/pkgs/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 165, in __call__
    await self.app(scope, receive, _send)
  File "/Users/michaeldecent/Swarmauri/swarmauri-sdk/pkgs/.venv/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/Users/michaeldecent/Swarmauri/swarmauri-sdk/pkgs/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    raise exc
  File "/Users/michaeldecent/Swarmauri/swarmauri-sdk/pkgs/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File "/Users/michaeldecent/Swarmauri/swarmauri-sdk/pkgs/.venv/lib/python3.12/site-packages/starlette/routing.py", line 714, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/Users/michaeldecent/Swarmauri/swarmauri-sdk/pkgs/.venv/lib/python3.12/site-packages/starlette/routing.py", line 734, in app
    await route.handle(scope, receive, send)
  File "/Users/michaeldecent/Swarmauri/swarmauri-sdk/pkgs/.venv/lib/python3.12/site-packages/starlette/routing.py", line 288, in handle
    await self.app(scope, receive, send)
  File "/Users/michaeldecent/Swarmauri/swarmauri-sdk/pkgs/.venv/lib/python3.12/site-packages/starlette/routing.py", line 76, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/Users/michaeldecent/Swarmauri/swarmauri-sdk/pkgs/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    raise exc
  File "/Users/michaeldecent/Swarmauri/swarmauri-sdk/pkgs/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File "/Users/michaeldecent/Swarmauri/swarmauri-sdk/pkgs/.venv/lib/python3.12/site-packages/starlette/routing.py", line 73, in app
    response = await f(request)
               ^^^^^^^^^^^^^^^^
  File "/Users/michaeldecent/Swarmauri/swarmauri-sdk/pkgs/.venv/lib/python3.12/site-packages/fastapi/routing.py", line 301, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/michaeldecent/Swarmauri/swarmauri-sdk/pkgs/.venv/lib/python3.12/site-packages/fastapi/routing.py", line 212, in run_endpoint_function
    return await dependant.call(**values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/michaeldecent/Swarmauri/swarmauri-sdk/pkgs/standards/autoapi/autoapi/v3/system/diagnostics.py", line 151, in _methodz
    "returns": sp.returns,
               ^^^^^^^^^^
AttributeError: 'OpSpec' object has no attribute 'returns'

Additional Context (Optional)

No response

Confirmation

  • I have searched the existing issues for this bug.
  • I have provided all necessary information to reproduce the bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions