mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
Volcengine plugin error: token too long #256
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Nothing1024 on GitHub (May 7, 2025).
Self Checks
Dify version
1.3.1
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Request Configuration
The whole step flow is
The whole step is automatic. Every epoch the step will request 3 times and wait for 2 seconds.
✔️ Expected Behavior
When I request the workflow API, it should give me the text result.
❌ Actual Behavior
But Sometimes the request will be error, the fetch response content is
The dashboard show nothing, just the ”FAILED“ status task. When I try to find the logs, the error step just showed "running" status, no other outputs.
Then I try to get the docker logs (
docker-plugin_daemon-1), I found that the plugin is always killed, so when it restart, the related request will be down.Related logs
The
tokenintoken too longmaybe not my prompt token, because I found various size image also have the same error.@dosubot[bot] commented on GitHub (May 7, 2025):
The "token too long" error you're encountering with the Volcengine plugin in Dify could be related to the handling of large data inputs, such as images, which are converted to base64 encoding. This can result in a token length that exceeds the limits set by the system. Here are some steps you can take to address this issue:
Reduce Image Size: Try reducing the size of the images before uploading them to Dify. This can help prevent the base64 encoded data from exceeding the token limit.
Check Token Limits: Ensure that the token limits for your model and API requests are configured correctly. Dify imposes a generation length limit of 2k tokens for reasoning models, which might be relevant if your workflow involves such models [1].
Switch Model Provider: If you're using the
openai_api_compatibleprovider, consider switching to a different model provider that might handle larger token sizes more effectively [2].Review Workflow Configuration: Double-check your workflow configuration to ensure that all parameters and settings are optimized for handling the data sizes you're working with.
By implementing these suggestions, you should be able to mitigate the "token too long" error and improve the stability of your plugin operations.
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
@Nothing1024 commented on GitHub (May 7, 2025):
Step 1 and Step 2 are tried to fix, but failed.
Step 3 is not fit, because I use the offical Volcengine plugin.
Step 4 is not clear.
@DevilMayCrySamsara commented on GitHub (May 8, 2025):
same problem
@764852987 commented on GitHub (May 19, 2025):
Unable to reproduce this issue with Dify online 1.4.0, doubao-1.5-vision-pro-250328
Try upgrading your local version of Dify
@AnoyiX commented on GitHub (May 20, 2025):
@764852987 你拿个大图片试试,超过 5MB 的
@Nothing1024 commented on GitHub (May 20, 2025):
目前的情况是,偶发性产生,WEB-GUI调试是没问题的,API会高频次产生,而且无论图片大小都会有这种情况出现。
@TaylorSwift5201314 commented on GitHub (May 29, 2025):
I don't encounter this issue with GPT-4.1, but when using Doubao-1.5-vision-pro, if the image size exceeds 3MB, it directly prompts: "failed to read response body: bufio.Scanner: token too long".
Version: 1.4.1
@EndlessSeeker commented on GitHub (Jun 4, 2025):
From the reason description above, the cause of the problem is the limit of bufio.Scanner. But it is a Go struct in deamon-plugin, that should be a common problem in model plugin, i'd like to ask why the problem only occurs in volcengine and openai-compatible plugin?
@yueru-mylove commented on GitHub (Jul 2, 2025):
save error with plugin: hjlarry/markdown-editor: 0.0.2
2025/07/02 10:59:24 stdio.go:188: [ERROR]plugin hjlarry/markdown-editor:0.0.2 has an error on stdout: bufio.Scanner: token too long
2025/07/02 10:59:24 run.go:135: [ERROR]plugin hjlarry/markdown-editor:0.0.2 exited with error: signal: killed
@sgguo commented on GitHub (Jul 2, 2025):
Same issue happened: plugin_daemon-1 | 2025/07/02 14:33:57 stdio.go:188: [ERROR]plugin hjlarry/agent:0.0.1 has an error on stdout: bufio.Scanner: token too long
plugin_daemon-1 | 2025/07/02 14:33:57 run.go:135: [ERROR]plugin hjlarry/agent:0.0.1 exited with error: signal: killed. VERSION: 1.5.0
@sgguo commented on GitHub (Jul 2, 2025):
A similar here: plugin_daemon-1 | 2025/07/02 14:27:41 stdio.go:182: [INFO]plugin junjiem/mcp_see_agent:0.2.2: response content: b''
plugin_daemon-1 | 2025/07/02 14:27:55 stdio.go:182: [INFO]plugin junjiem/mcp_see_agent:0.2.2: response status: 200 OK
plugin_daemon-1 | 2025/07/02 14:27:55 stdio.go:182: [INFO]plugin junjiem/mcp_see_agent:0.2.2: response headers: Headers({'date': 'Wed, 02 Jul 2025 14:27:40 GMT', 'server': 'uvicorn', 'cache-control': 'no-cache, no-transform', 'connection': 'keep-alive', 'content-type': 'text/event-stream', 'mcp-session-id': 'f85208f7ab6b41b79480fe497b4bf5ce', 'x-accel-buffering': 'no', 'transfer-encoding': 'chunked'})
plugin_daemon-1 | 2025/07/02 14:27:55 stdio.go:188: [ERROR]plugin junjiem/mcp_see_agent:0.2.2 has an error on stdout: bufio.Scanner: token too long
plugin_daemon-1 | 2025/07/02 14:27:55 run.go:135: [ERROR]plugin junjiem/mcp_see_agent:0.2.2 exited with error: signal: killed
plugin_daemon-1 | 2025/07/02 14:27:55 run.go:190: [INFO]plugin junjiem/mcp_see_agent:0.2.2 stopped
plugin_daemon-1 | 2025/07/02 14:28:00 run.go:147: [INFO]plugin junjiem/mcp_see_agent:0.2.2 started
@yueru-mylove commented on GitHub (Jul 11, 2025):
doesn't this bug fixed in 1.6.0? I still got this probem in 1.6.0 with plugin hjlarry/dify-plugin-markdown-editor.
@1107186916 commented on GitHub (Aug 5, 2025):
After I modified the limit of dify, changing from 12288 to 24576, I reported an error:"[volcengine_maas] Error: PluginInvokeError: {"args":{},"error_type":"ArkBadRequestError","message":"Error code: 400 - {'error': {'code': 'InvalidParameter', 'message': 'The parameter
max_tokensspecified in the request are not valid: integer above maximum value, expected a value \u003c= 12288, but got 24576 instead. Request id: 021754374445564519af2f3595cfd396cd863a5a5db32d63d28db', 'param': 'max_tokens', 'type': 'BadRequest'}}, request_id: 20250805061405iijIAgF0P2boGUQOrbJY"}"Is this the limitation of dify itself or the limitation of doubao model?
How can I increase this limit?
my dify is 1.7.1
@crazywoola commented on GitHub (Aug 15, 2025):
@1107186916
https://github.com/langgenius/dify/pull/23980
You can add these environment variables in the compose file and restart the plugin daemon service.