BUG about ChatTTS #15249

Closed
opened 2026-02-21 19:20:52 -05:00 by yindo · 6 comments
Owner

Originally created by @yep123456 on GitHub (Jul 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.4.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I am running dify using Docker. I have configured the ChatTTS launched by Xinference in the configuration table of dify. However, when I try to play sound, It's not responding., and I cannot play any sound normally. When I look at the container logs, I see that an error is reported.Could you please tell me what the problem is and if there is a troubleshooting plan.

logs:
[2025-07-09 09:08:19 +0000] [91] [ERROR] Error handling request /console/api/apps/1b9a4491-da07-40de-9155-246c9ef58a74/text-to-audio
Traceback (most recent call last):
File "/app/api/.venv/lib/python3.12/site-packages/gunicorn/workers/base_async.py", line 54, in handle
self.handle_request(listener_name, req, client, addr)
File "/app/api/.venv/lib/python3.12/site-packages/gunicorn/workers/ggevent.py", line 127, in handle_request
super().handle_request(listener_name, req, sock, addr)
File "/app/api/.venv/lib/python3.12/site-packages/gunicorn/workers/base_async.py", line 114, in handle_request
for item in respiter:
^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/werkzeug/wsgi.py", line 256, in next
return self._next()
^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/werkzeug/wrappers/response.py", line 32, in _iter_encoded
for item in iterable:
^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/flask/helpers.py", line 125, in generator
yield from gen
File "/app/api/core/plugin/impl/model.py", line 403, in invoke_tts
for result in response:
^^^^^^^^
File "/app/api/core/plugin/impl/base.py", line 211, in _request_with_plugin_daemon_response_stream
self._handle_plugin_daemon_error(error.error_type, error.message)
File "/app/api/core/plugin/impl/base.py", line 235, in _handle_plugin_daemon_error
raise InvokeBadRequestError(description=args.get("description"))
core.model_runtime.errors.invoke.InvokeBadRequestError: Response ended prematurely

Image

✔️ Expected Behavior

After the dedify app is published and I click the voice play button, I would like the sound to play correctly

Actual Behavior

After the dify app is published, clicking the voice play button does not have any corresponding.

Originally created by @yep123456 on GitHub (Jul 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.4.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce I am running dify using Docker. I have configured the ChatTTS launched by Xinference in the configuration table of dify. However, when I try to play sound, It's not responding., and I cannot play any sound normally. When I look at the container logs, I see that an error is reported.Could you please tell me what the problem is and if there is a troubleshooting plan. logs: [2025-07-09 09:08:19 +0000] [91] [ERROR] Error handling request /console/api/apps/1b9a4491-da07-40de-9155-246c9ef58a74/text-to-audio Traceback (most recent call last): File "/app/api/.venv/lib/python3.12/site-packages/gunicorn/workers/base_async.py", line 54, in handle self.handle_request(listener_name, req, client, addr) File "/app/api/.venv/lib/python3.12/site-packages/gunicorn/workers/ggevent.py", line 127, in handle_request super().handle_request(listener_name, req, sock, addr) File "/app/api/.venv/lib/python3.12/site-packages/gunicorn/workers/base_async.py", line 114, in handle_request for item in respiter: ^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/werkzeug/wsgi.py", line 256, in __next__ return self._next() ^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/werkzeug/wrappers/response.py", line 32, in _iter_encoded for item in iterable: ^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/flask/helpers.py", line 125, in generator yield from gen File "/app/api/core/plugin/impl/model.py", line 403, in invoke_tts for result in response: ^^^^^^^^ File "/app/api/core/plugin/impl/base.py", line 211, in _request_with_plugin_daemon_response_stream self._handle_plugin_daemon_error(error.error_type, error.message) File "/app/api/core/plugin/impl/base.py", line 235, in _handle_plugin_daemon_error raise InvokeBadRequestError(description=args.get("description")) core.model_runtime.errors.invoke.InvokeBadRequestError: Response ended prematurely <img width="1109" height="427" alt="Image" src="https://github.com/user-attachments/assets/e014157b-bafa-4c14-81f6-3ebcef9cc5bb" /> ### ✔️ Expected Behavior After the dedify app is published and I click the voice play button, I would like the sound to play correctly ### ❌ Actual Behavior After the dify app is published, clicking the voice play button does not have any corresponding. <!-- Uploading "docker-api-1 log.png"... -->
yindo added the 🐞 bugstt & tts labels 2026-02-21 19:20:52 -05:00
yindo closed this issue 2026-02-21 19:20:52 -05:00
Author
Owner

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

The "Response ended prematurely" error means Dify's TTS request to the ChatTTS/Xinference plugin daemon was unexpectedly cut off. This usually points to a problem on the plugin side or with the connection between Dify and the plugin daemon—not within Dify itself.

Here’s a focused troubleshooting plan:

  1. Check the logs for your ChatTTS/Xinference service for any errors, crashes, or warnings at the time of the failed request.
  2. Make sure the ChatTTS/Xinference service is running and healthy, and that Dify can reach it over the network.
  3. Double-check your Dify TTS configuration: ensure a valid voice is set and that TTS is enabled for your app. If no voice is available or configured, TTS will fail and can cause this error. Recent Dify updates improved voice handling and error messages for this case—if you can, try upgrading or backporting those fixes see PR #21821 and voice selection fix.
  4. Try a simple, short text input and the default voice to rule out edge cases.
  5. If the problem persists, collect both Dify and ChatTTS/Xinference logs for the failed request to help pinpoint the root cause.

This error is surfaced when the plugin daemon stops streaming audio unexpectedly, so the most likely causes are a crash, misconfiguration, network timeout, or missing/invalid voice setting in the TTS backend. There’s no internal retry or advanced recovery for this in Dify—the fix will be on the plugin or its integration side.

Let me know what you find in the plugin logs or if you need help interpreting them.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Jul 10, 2025): <!-- Answer --> The "Response ended prematurely" error means Dify's TTS request to the ChatTTS/Xinference plugin daemon was unexpectedly cut off. This usually points to a problem on the plugin side or with the connection between Dify and the plugin daemon—not within Dify itself. Here’s a focused troubleshooting plan: 1. Check the logs for your ChatTTS/Xinference service for any errors, crashes, or warnings at the time of the failed request. 2. Make sure the ChatTTS/Xinference service is running and healthy, and that Dify can reach it over the network. 3. Double-check your Dify TTS configuration: ensure a valid voice is set and that TTS is enabled for your app. If no voice is available or configured, TTS will fail and can cause this error. Recent Dify updates improved voice handling and error messages for this case—if you can, try upgrading or backporting those fixes [see PR #21821](https://github.com/langgenius/dify/pull/21821) and [voice selection fix](https://github.com/langgenius/dify/pull/21877). 4. Try a simple, short text input and the default voice to rule out edge cases. 5. If the problem persists, collect both Dify and ChatTTS/Xinference logs for the failed request to help pinpoint the root cause. This error is surfaced when the plugin daemon stops streaming audio unexpectedly, so the most likely causes are a crash, misconfiguration, network timeout, or missing/invalid voice setting in the TTS backend. There’s no internal retry or advanced recovery for this in Dify—the fix will be on the plugin or its integration side. Let me know what you find in the plugin logs or if you need help interpreting them. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/28ef8e6e-d712-4cfe-942a-e48abf014780?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/28ef8e6e-d712-4cfe-942a-e48abf014780?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/28ef8e6e-d712-4cfe-942a-e48abf014780?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/28ef8e6e-d712-4cfe-942a-e48abf014780?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/28ef8e6e-d712-4cfe-942a-e48abf014780?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/28ef8e6e-d712-4cfe-942a-e48abf014780?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/28ef8e6e-d712-4cfe-942a-e48abf014780?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/22176)
Author
Owner

@crazywoola commented on GitHub (Jul 10, 2025):

Based on the information provided, it's difficult for us to determine what exactly went wrong.

  • Please share the complete DSL.
  • Upgrade to the latest version — we've addressed many tts-related bugs, and you may also want to check for duplicate issues.
  • We haven't received widespread feedback about similar problems.
@crazywoola commented on GitHub (Jul 10, 2025): Based on the information provided, it's difficult for us to determine what exactly went wrong. * Please share the complete DSL. * Upgrade to the latest version — we've addressed many tts-related bugs, and you may also want to check for duplicate issues. * We haven't received widespread feedback about similar problems.
Author
Owner

@yep123456 commented on GitHub (Jul 10, 2025):

Here is my DSL about text2vocie test.But the system says: File type not allowed: .yml

@yep123456 commented on GitHub (Jul 10, 2025): Here is my DSL about text2vocie test.But the system says: File type not allowed: .yml
Author
Owner

@crazywoola commented on GitHub (Jul 10, 2025):

Please use zip instead.

@crazywoola commented on GitHub (Jul 10, 2025): Please use zip instead.
Author
Owner

@yep123456 commented on GitHub (Jul 10, 2025):

Thanks,here is my DSL
text2vocie.zip

@yep123456 commented on GitHub (Jul 10, 2025): Thanks,here is my DSL [text2vocie.zip](https://github.com/user-attachments/files/21174103/text2vocie.zip)
Author
Owner

@Harvey-ZouZ commented on GitHub (Aug 19, 2025):

Image Try to use "OpenAI-API-compatible", I think the latest xinference-plugin is incompatible.
@Harvey-ZouZ commented on GitHub (Aug 19, 2025): <img width="443" height="88" alt="Image" src="https://github.com/user-attachments/assets/632fb0ed-9f14-4a53-a30c-27c066c7c356" /> Try to use "OpenAI-API-compatible", I think the latest xinference-plugin is incompatible.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#15249