Skip to content

[Bug]: **http_api** 'NoneType' object has no attribute 'get' #5286

Closed
@stardyun

Description

@stardyun

Is there an existing issue for the same bug?

  • I have checked the existing issues.

RAGFlow workspace code commit ID

b35e811

RAGFlow image version

v0.16.0

Other environment information

Actual behavior

response:

{
    "code": 100,
    "data": null,
    "message": "AttributeError(\"'NoneType' object has no attribute 'get'\")"
}

Expected behavior

No response

Steps to reproduce

request api

curl 'http://{host}/api/v1/agents/e6de2f12f00311efae700242ac1b0006/sessions' \
--header 'Authorization: Bearer xxxx' \
--header 'Content-Type: multipart/form-data' \
--form 'key=@"/Users/xxx/Downloads/demo1.pdf"'

Additional information

api doc: https://ragflow.io/docs/dev/http_api_reference#create-session-with-agent

docker logs

2025-02-24 10:51:15,533 ERROR    17 'NoneType' object has no attribute 'get'
Traceback (most recent call last):
  File "/ragflow/.venv/lib/python3.10/site-packages/flask/app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
  File "/ragflow/.venv/lib/python3.10/site-packages/flask/app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
  File "/ragflow/api/utils/api_utils.py", line 303, in decorated_function
    return func(*args, **kwargs)
  File "/ragflow/api/apps/sdk/session.py", line 87, in create_agent_session
    if not req.get(ele["key"]):
AttributeError: 'NoneType' object has no attribute 'get'

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions