Internal server error when accessing /v1/messages endpoints #12759

Closed
opened 2026-02-21 19:08:54 -05:00 by yindo · 2 comments
Owner

Originally created by @AugNSo on GitHub (Apr 10, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.2.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

curl --location 'http://localhost/v1/messages?user=abc-123&conversation_id=90ca92e3-bde1-4d36-b2ad-ba0745cfb663'
--header 'Authorization: Bearer app-jSbEAGjhXnlJs1LFPTPWzLJa'

I noticed there was an earlier report of similar bug #17438 but closed by @crazywoola as not planned. But as far as I can remember this endpoint exists before 1.0.0 was released and worked properly until I upgrade to 1.2.0 last night.

✔️ Expected Behavior

Attached is a response from another dify deployment [1.0.1, Self Hosted (Docker)]

{
"limit": 20,
"has_more": false,
"data": [
{
"id": "09d638a0-ddf2-44a7-8c46-2f3fd10f66da",
"conversation_id": "c1cdc535-a2e7-40e4-9383-5c87e95f59b2",
"parent_message_id": "00000000-0000-0000-0000-000000000000",
"inputs": {
"model_name": "deepseek"
},
"query": "你擅长编写SQL代码,请结合具体问题编写正确规范的SQL代码,我的问题是:帮我从 students 表中检索出所有年龄大于 20的男生",
"answer": "\n<details style="color:gray;background-color: #f8f8f8;padding: 8px;border-radius: 4px;" open>

Thinking... \n嗯...用户让我帮忙写一个SQL查询,从students表中选出年龄大于20的男生。首先,我需要确认表结构,但用户没给,所以得做一些合理假设。通常students表可能有字段如id、name、age、gender之类的。\n\n接下来,用户的需求是年龄大于20且性别为男。性别字段可能用'male'或'男',或者用1/0之类的数字表示。这里中文环境下可能用'男',但也要考虑可能用英文。需要明确用户的gender列存储方式,但用户没说明,可能需要用常见的值猜测。\n\n然后,正确的SQL语句应该是SELECT * FROM students WHERE age > 20 AND gender = '男'。不过如果gender是用'male'的话,就得改成'male'。或者可能用性别代码,比如1代表男,这时候条件就是gender = 1。但用户的问题里用的是中文“男生”,所以可能更倾向于性别字段存储的是中文字符。\n\n另外,是否需要考虑大小写或者空格?比如'男 '或者'Male'的不同情况?可能需要用户确认,但作为示例,保持简单,使用'男'比较直接。\n\n还要确保年龄是数值类型,这样age>20才能正确比较。如果age是字符串类型的话就会有问题,但一般年龄都是整数,所以没问题。\n\n最后,是否需要选择特定的字段而不是*?用户没说明,所以用*是合理的,但可能建议选择具体字段更好。不过用户的问题只要求检索出记录,所以没问题。\n\n总结下来,正确的SQL应该是SELECT * FROM students WHERE age > 20 AND gender = '男';。不过需要提醒用户如果性别字段的值不同,可能需要调整条件。\n\n\n<details style="color:gray;background-color: #f8f8f8;padding: 8px;border-radius: 4px;" open> Thinking... \n好的,我来帮您编写这个SQL查询。根据您的需求,需要从students表中筛选出年龄大于20岁且性别为男的学生。以下是实现该需求的标准SQL语句:\n\nsql\nSELECT * \nFROM students \nWHERE age > 20 \n AND gender = '男';\n\n\n代码说明:\n1. *SELECT :表示选择所有字段,您可以根据需要替换为具体字段名\n2. WHERE条件:\n - age > 20:筛选年龄超过20岁的记录\n - gender = '男':筛选性别为男的记录(若您的性别字段使用其他表示方式如'male'1,请相应调整字符串值)\n3. AND逻辑运算符:确保同时满足两个条件\n\n注意事项:\n- 如果gender字段存储的是英文(如male),请将条件改为gender = 'male'\n- 若年龄字段类型为字符串,请先确认存储格式是否为数值类型,否则需要转换\n- 建议在实际使用前先用DESC students确认表结构中的字段名称和类型\n\n需要其他调整请随时告知!",
"message_files": [],
"feedback": null,
"retriever_resources": [],
"created_at": 1744194206,
"agent_thoughts": [],
"status": "normal",
"error": null
}
]
}

Actual Behavior

Attached is the error log from dify-api-1

2025-04-10 20:02:39 api-1 | 2025-04-10 12:02:39.993 ERROR [Dummy-5] [app.py:875] - Exception on /v1/messages [GET]
2025-04-10 20:02:39 api-1 | Traceback (most recent call last):
2025-04-10 20:02:39 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 917, in full_dispatch_request
2025-04-10 20:02:39 api-1 | rv = self.dispatch_request()
2025-04-10 20:02:39 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^
2025-04-10 20:02:39 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 902, in dispatch_request
2025-04-10 20:02:39 api-1 | return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
2025-04-10 20:02:39 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-10 20:02:39 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 489, in wrapper
2025-04-10 20:02:39 api-1 | resp = resource(*args, **kwargs)
2025-04-10 20:02:39 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-10 20:02:39 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask/views.py", line 110, in view
2025-04-10 20:02:39 api-1 | return current_app.ensure_sync(self.dispatch_request)(**kwargs) # type: ignore[no-any-return]
2025-04-10 20:02:39 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-10 20:02:39 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init_.py", line 604, in dispatch_request
2025-04-10 20:02:39 api-1 | resp = meth(*args, **kwargs)
2025-04-10 20:02:39 api-1 | ^^^^^^^^^^^^^^^^^^^^^
2025-04-10 20:02:39 api-1 | File "/app/api/controllers/service_api/wraps.py", line 104, in decorated_view
2025-04-10 20:02:39 api-1 | return view_func(*args, **kwargs)
2025-04-10 20:02:39 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-10 20:02:39 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 701, in wrapper
2025-04-10 20:02:39 api-1 | return marshal(resp, self.fields, self.envelope)
2025-04-10 20:02:39 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-10 20:02:39 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 657, in marshal
2025-04-10 20:02:39 api-1 | return OrderedDict([(envelope, OrderedDict(items))]) if envelope else OrderedDict(items)
2025-04-10 20:02:39 api-1 | ^^^^^^^^^^^^^^^^^^
2025-04-10 20:02:39 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 655, in
2025-04-10 20:02:39 api-1 | else make(v).output(k, data))
2025-04-10 20:02:39 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^
2025-04-10 20:02:39 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/fields.py", line 197, in output
2025-04-10 20:02:39 api-1 | return self.format(value)
2025-04-10 20:02:39 api-1 | ^^^^^^^^^^^^^^^^^^
2025-04-10 20:02:39 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/fields.py", line 183, in format
2025-04-10 20:02:39 api-1 | self.container.output(idx,
2025-04-10 20:02:39 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/fields.py", line 152, in output
2025-04-10 20:02:39 api-1 | return marshal(value, self.nested)
2025-04-10 20:02:39 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-10 20:02:39 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 657, in marshal
2025-04-10 20:02:39 api-1 | return OrderedDict([(envelope, OrderedDict(items))]) if envelope else OrderedDict(items)
2025-04-10 20:02:39 api-1 | ^^^^^^^^^^^^^^^^^^
2025-04-10 20:02:39 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 655, in
2025-04-10 20:02:39 api-1 | else make(v).output(k, data))
2025-04-10 20:02:39 api-1 | ^^^^^^^^^^^^^^
2025-04-10 20:02:39 api-1 | AttributeError: 'function' object has no attribute 'output'
2025-04-10 20:05:47 api-1 | 2025-04-10 12:05:47.453 ERROR [Dummy-6] [app.py:875] - Exception on /v1/messages [GET]
2025-04-10 20:05:47 api-1 | Traceback (most recent call last):
2025-04-10 20:05:47 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 917, in full_dispatch_request
2025-04-10 20:05:47 api-1 | rv = self.dispatch_request()
2025-04-10 20:05:47 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^
2025-04-10 20:05:47 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 902, in dispatch_request
2025-04-10 20:05:47 api-1 | return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
2025-04-10 20:05:47 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-10 20:05:47 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 489, in wrapper
2025-04-10 20:05:47 api-1 | resp = resource(*args, **kwargs)
2025-04-10 20:05:47 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-10 20:05:47 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask/views.py", line 110, in view
2025-04-10 20:05:47 api-1 | return current_app.ensure_sync(self.dispatch_request)(**kwargs) # type: ignore[no-any-return]
2025-04-10 20:05:47 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-10 20:05:47 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init_
.py", line 604, in dispatch_request
2025-04-10 20:05:47 api-1 | resp = meth(*args, **kwargs)
2025-04-10 20:05:47 api-1 | ^^^^^^^^^^^^^^^^^^^^^
2025-04-10 20:05:47 api-1 | File "/app/api/controllers/service_api/wraps.py", line 104, in decorated_view
2025-04-10 20:05:47 api-1 | return view_func(*args, **kwargs)
2025-04-10 20:05:47 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-10 20:05:47 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 701, in wrapper
2025-04-10 20:05:47 api-1 | return marshal(resp, self.fields, self.envelope)
2025-04-10 20:05:47 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-10 20:05:47 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 657, in marshal
2025-04-10 20:05:47 api-1 | return OrderedDict([(envelope, OrderedDict(items))]) if envelope else OrderedDict(items)
2025-04-10 20:05:47 api-1 | ^^^^^^^^^^^^^^^^^^
2025-04-10 20:05:47 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 655, in
2025-04-10 20:05:47 api-1 | else make(v).output(k, data))
2025-04-10 20:05:47 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^
2025-04-10 20:05:47 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/fields.py", line 197, in output
2025-04-10 20:05:47 api-1 | return self.format(value)
2025-04-10 20:05:47 api-1 | ^^^^^^^^^^^^^^^^^^
2025-04-10 20:05:47 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/fields.py", line 183, in format
2025-04-10 20:05:47 api-1 | self.container.output(idx,
2025-04-10 20:05:47 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/fields.py", line 152, in output
2025-04-10 20:05:47 api-1 | return marshal(value, self.nested)
2025-04-10 20:05:47 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-10 20:05:47 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 657, in marshal
2025-04-10 20:05:47 api-1 | return OrderedDict([(envelope, OrderedDict(items))]) if envelope else OrderedDict(items)
2025-04-10 20:05:47 api-1 | ^^^^^^^^^^^^^^^^^^
2025-04-10 20:05:47 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 655, in
2025-04-10 20:05:47 api-1 | else make(v).output(k, data))
2025-04-10 20:05:47 api-1 | ^^^^^^^^^^^^^^
2025-04-10 20:05:47 api-1 | AttributeError: 'function' object has no attribute 'output'

Originally created by @AugNSo on GitHub (Apr 10, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.2.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce curl --location 'http://localhost/v1/messages?user=abc-123&conversation_id=90ca92e3-bde1-4d36-b2ad-ba0745cfb663' \ --header 'Authorization: Bearer app-jSbEAGjhXnlJs1LFPTPWzLJa' I noticed there was an earlier report of similar bug #17438 but closed by @crazywoola as not planned. But as far as I can remember this endpoint exists before 1.0.0 was released and worked properly until I upgrade to 1.2.0 last night. ### ✔️ Expected Behavior Attached is a response from another dify deployment [1.0.1, Self Hosted (Docker)] { "limit": 20, "has_more": false, "data": [ { "id": "09d638a0-ddf2-44a7-8c46-2f3fd10f66da", "conversation_id": "c1cdc535-a2e7-40e4-9383-5c87e95f59b2", "parent_message_id": "00000000-0000-0000-0000-000000000000", "inputs": { "model_name": "deepseek" }, "query": "你擅长编写SQL代码,请结合具体问题编写正确规范的SQL代码,我的问题是:帮我从 students 表中检索出所有年龄大于 20的男生", "answer": "\n<details style=\"color:gray;background-color: #f8f8f8;padding: 8px;border-radius: 4px;\" open> <summary> Thinking... </summary>\n嗯...用户让我帮忙写一个SQL查询,从students表中选出年龄大于20的男生。首先,我需要确认表结构,但用户没给,所以得做一些合理假设。通常students表可能有字段如id、name、age、gender之类的。\n\n接下来,用户的需求是年龄大于20且性别为男。性别字段可能用'male'或'男',或者用1/0之类的数字表示。这里中文环境下可能用'男',但也要考虑可能用英文。需要明确用户的gender列存储方式,但用户没说明,可能需要用常见的值猜测。\n\n然后,正确的SQL语句应该是SELECT * FROM students WHERE age > 20 AND gender = '男'。不过如果gender是用'male'的话,就得改成'male'。或者可能用性别代码,比如1代表男,这时候条件就是gender = 1。但用户的问题里用的是中文“男生”,所以可能更倾向于性别字段存储的是中文字符。\n\n另外,是否需要考虑大小写或者空格?比如'男 '或者'Male'的不同情况?可能需要用户确认,但作为示例,保持简单,使用'男'比较直接。\n\n还要确保年龄是数值类型,这样age>20才能正确比较。如果age是字符串类型的话就会有问题,但一般年龄都是整数,所以没问题。\n\n最后,是否需要选择特定的字段而不是*?用户没说明,所以用*是合理的,但可能建议选择具体字段更好。不过用户的问题只要求检索出记录,所以没问题。\n\n总结下来,正确的SQL应该是SELECT * FROM students WHERE age > 20 AND gender = '男';。不过需要提醒用户如果性别字段的值不同,可能需要调整条件。\n</details>\n\n<details style=\"color:gray;background-color: #f8f8f8;padding: 8px;border-radius: 4px;\" open> <summary> Thinking... </summary>\n好的,我来帮您编写这个SQL查询。根据您的需求,需要从students表中筛选出年龄大于20岁且性别为男的学生。以下是实现该需求的标准SQL语句:\n\n```sql\nSELECT * \nFROM students \nWHERE age > 20 \n AND gender = '男';\n```\n\n**代码说明:**\n1. **SELECT ***:表示选择所有字段,您可以根据需要替换为具体字段名\n2. **WHERE条件**:\n - `age > 20`:筛选年龄超过20岁的记录\n - `gender = '男'`:筛选性别为男的记录(若您的性别字段使用其他表示方式如`'male'`或`1`,请相应调整字符串值)\n3. **AND逻辑运算符**:确保同时满足两个条件\n\n**注意事项:**\n- 如果`gender`字段存储的是英文(如`male`),请将条件改为`gender = 'male'`\n- 若年龄字段类型为字符串,请先确认存储格式是否为数值类型,否则需要转换\n- 建议在实际使用前先用`DESC students`确认表结构中的字段名称和类型\n\n需要其他调整请随时告知!", "message_files": [], "feedback": null, "retriever_resources": [], "created_at": 1744194206, "agent_thoughts": [], "status": "normal", "error": null } ] } ### ❌ Actual Behavior Attached is the error log from dify-api-1 2025-04-10 20:02:39 api-1 | 2025-04-10 12:02:39.993 ERROR [Dummy-5] [app.py:875] - Exception on /v1/messages [GET] 2025-04-10 20:02:39 api-1 | Traceback (most recent call last): 2025-04-10 20:02:39 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 917, in full_dispatch_request 2025-04-10 20:02:39 api-1 | rv = self.dispatch_request() 2025-04-10 20:02:39 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^ 2025-04-10 20:02:39 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 902, in dispatch_request 2025-04-10 20:02:39 api-1 | return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return] 2025-04-10 20:02:39 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-04-10 20:02:39 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 489, in wrapper 2025-04-10 20:02:39 api-1 | resp = resource(*args, **kwargs) 2025-04-10 20:02:39 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-04-10 20:02:39 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask/views.py", line 110, in view 2025-04-10 20:02:39 api-1 | return current_app.ensure_sync(self.dispatch_request)(**kwargs) # type: ignore[no-any-return] 2025-04-10 20:02:39 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-04-10 20:02:39 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 604, in dispatch_request 2025-04-10 20:02:39 api-1 | resp = meth(*args, **kwargs) 2025-04-10 20:02:39 api-1 | ^^^^^^^^^^^^^^^^^^^^^ 2025-04-10 20:02:39 api-1 | File "/app/api/controllers/service_api/wraps.py", line 104, in decorated_view 2025-04-10 20:02:39 api-1 | return view_func(*args, **kwargs) 2025-04-10 20:02:39 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-04-10 20:02:39 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 701, in wrapper 2025-04-10 20:02:39 api-1 | return marshal(resp, self.fields, self.envelope) 2025-04-10 20:02:39 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-04-10 20:02:39 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 657, in marshal 2025-04-10 20:02:39 api-1 | return OrderedDict([(envelope, OrderedDict(items))]) if envelope else OrderedDict(items) 2025-04-10 20:02:39 api-1 | ^^^^^^^^^^^^^^^^^^ 2025-04-10 20:02:39 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 655, in <genexpr> 2025-04-10 20:02:39 api-1 | else make(v).output(k, data)) 2025-04-10 20:02:39 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^ 2025-04-10 20:02:39 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/fields.py", line 197, in output 2025-04-10 20:02:39 api-1 | return self.format(value) 2025-04-10 20:02:39 api-1 | ^^^^^^^^^^^^^^^^^^ 2025-04-10 20:02:39 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/fields.py", line 183, in format 2025-04-10 20:02:39 api-1 | self.container.output(idx, 2025-04-10 20:02:39 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/fields.py", line 152, in output 2025-04-10 20:02:39 api-1 | return marshal(value, self.nested) 2025-04-10 20:02:39 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-04-10 20:02:39 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 657, in marshal 2025-04-10 20:02:39 api-1 | return OrderedDict([(envelope, OrderedDict(items))]) if envelope else OrderedDict(items) 2025-04-10 20:02:39 api-1 | ^^^^^^^^^^^^^^^^^^ 2025-04-10 20:02:39 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 655, in <genexpr> 2025-04-10 20:02:39 api-1 | else make(v).output(k, data)) 2025-04-10 20:02:39 api-1 | ^^^^^^^^^^^^^^ 2025-04-10 20:02:39 api-1 | AttributeError: 'function' object has no attribute 'output' 2025-04-10 20:05:47 api-1 | 2025-04-10 12:05:47.453 ERROR [Dummy-6] [app.py:875] - Exception on /v1/messages [GET] 2025-04-10 20:05:47 api-1 | Traceback (most recent call last): 2025-04-10 20:05:47 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 917, in full_dispatch_request 2025-04-10 20:05:47 api-1 | rv = self.dispatch_request() 2025-04-10 20:05:47 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^ 2025-04-10 20:05:47 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 902, in dispatch_request 2025-04-10 20:05:47 api-1 | return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return] 2025-04-10 20:05:47 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-04-10 20:05:47 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 489, in wrapper 2025-04-10 20:05:47 api-1 | resp = resource(*args, **kwargs) 2025-04-10 20:05:47 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-04-10 20:05:47 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask/views.py", line 110, in view 2025-04-10 20:05:47 api-1 | return current_app.ensure_sync(self.dispatch_request)(**kwargs) # type: ignore[no-any-return] 2025-04-10 20:05:47 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-04-10 20:05:47 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 604, in dispatch_request 2025-04-10 20:05:47 api-1 | resp = meth(*args, **kwargs) 2025-04-10 20:05:47 api-1 | ^^^^^^^^^^^^^^^^^^^^^ 2025-04-10 20:05:47 api-1 | File "/app/api/controllers/service_api/wraps.py", line 104, in decorated_view 2025-04-10 20:05:47 api-1 | return view_func(*args, **kwargs) 2025-04-10 20:05:47 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-04-10 20:05:47 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 701, in wrapper 2025-04-10 20:05:47 api-1 | return marshal(resp, self.fields, self.envelope) 2025-04-10 20:05:47 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-04-10 20:05:47 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 657, in marshal 2025-04-10 20:05:47 api-1 | return OrderedDict([(envelope, OrderedDict(items))]) if envelope else OrderedDict(items) 2025-04-10 20:05:47 api-1 | ^^^^^^^^^^^^^^^^^^ 2025-04-10 20:05:47 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 655, in <genexpr> 2025-04-10 20:05:47 api-1 | else make(v).output(k, data)) 2025-04-10 20:05:47 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^ 2025-04-10 20:05:47 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/fields.py", line 197, in output 2025-04-10 20:05:47 api-1 | return self.format(value) 2025-04-10 20:05:47 api-1 | ^^^^^^^^^^^^^^^^^^ 2025-04-10 20:05:47 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/fields.py", line 183, in format 2025-04-10 20:05:47 api-1 | self.container.output(idx, 2025-04-10 20:05:47 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/fields.py", line 152, in output 2025-04-10 20:05:47 api-1 | return marshal(value, self.nested) 2025-04-10 20:05:47 api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-04-10 20:05:47 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 657, in marshal 2025-04-10 20:05:47 api-1 | return OrderedDict([(envelope, OrderedDict(items))]) if envelope else OrderedDict(items) 2025-04-10 20:05:47 api-1 | ^^^^^^^^^^^^^^^^^^ 2025-04-10 20:05:47 api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 655, in <genexpr> 2025-04-10 20:05:47 api-1 | else make(v).output(k, data)) 2025-04-10 20:05:47 api-1 | ^^^^^^^^^^^^^^ 2025-04-10 20:05:47 api-1 | AttributeError: 'function' object has no attribute 'output'
yindo added the 🐞 bug label 2026-02-21 19:08:54 -05:00
yindo closed this issue 2026-02-21 19:08:54 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 10, 2025):

There is a known issue with the /v1/messages endpoint in Dify version 1.2.0, which causes an "Internal server error" due to a bug in that version. This issue affects both cloud and self-hosted installations. A workaround is to use the /v1/chat-messages endpoint, which functions correctly. For further diagnosis in a self-hosted Docker setup, you can check the logs of the 'api' container using the command docker-compose logs api [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Apr 10, 2025): <!-- Answer --> There is a known issue with the `/v1/messages` endpoint in Dify version 1.2.0, which causes an "Internal server error" due to a bug in that version. This issue affects both cloud and self-hosted installations. A workaround is to use the `/v1/chat-messages` endpoint, which functions correctly. For further diagnosis in a self-hosted Docker setup, you can check the logs of the 'api' container using the command `docker-compose logs api` <sup>[[1]](https://github.com/langgenius/dify/issues/17712)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/a89f60d1-7430-45c0-8224-ad869e24c21d?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/a89f60d1-7430-45c0-8224-ad869e24c21d?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/a89f60d1-7430-45c0-8224-ad869e24c21d?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/a89f60d1-7430-45c0-8224-ad869e24c21d?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/a89f60d1-7430-45c0-8224-ad869e24c21d?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/a89f60d1-7430-45c0-8224-ad869e24c21d?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/a89f60d1-7430-45c0-8224-ad869e24c21d?feedback_type=other)</sup>
Author
Owner

@wangtao commented on GitHub (Apr 10, 2025):

check the commit in main branch

fix: 17712-get-messages-api-encountered-internal-server-error

you can modify the code in the container

@wangtao commented on GitHub (Apr 10, 2025): check the commit in main branch [fix: 17712-get-messages-api-encountered-internal-server-error](https://github.com/langgenius/dify/commit/63ba6077387ce5b0c1d4dd58079f9e8596240816) you can modify the code in the container
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#12759