Vertex AI integration throws "contents must not be empty" error in v1.2.0+ despite non-empty prompts #298

Closed
opened 2026-02-16 10:18:52 -05:00 by yindo · 4 comments
Owner

Originally created by @ukyonagata0105 on GitHub (May 20, 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.0/1.3.1/1.3.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Configure Dify with Vertex AI (Gemini 2.0 Flash) as the LLM provider
Create a simple workflow with a system prompt containing any text (e.g., "Hello, nice weather today")
Try to execute the workflow
The following error occurs:

{
"model_mode": "chat",
"prompts": [
{
"role": "system",
"text": "Hello, nice weather today",
"files": []
}
],
"model_provider": "langgenius/vertex_ai/vertex_ai",
"model_name": "gemini-2.0-flash-001"
}

Run failed: [vertex_ai] Error: PluginInvokeError: {"args":{},"error_type":"TypeError","message":"contents must not be empty"}

✔️ Expected Behavior

The workflow should execute successfully and return a response from Vertex AI/Gemini, regardless of the prompt content.

Actual Behavior

Workflow fails with "contents must not be empty" error when using Vertex AI as the LLM provider, even though the prompt content is clearly not empty.

Originally created by @ukyonagata0105 on GitHub (May 20, 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.0/1.3.1/1.3.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Configure Dify with Vertex AI (Gemini 2.0 Flash) as the LLM provider Create a simple workflow with a system prompt containing any text (e.g., "Hello, nice weather today") Try to execute the workflow The following error occurs: { "model_mode": "chat", "prompts": [ { "role": "system", "text": "Hello, nice weather today", "files": [] } ], "model_provider": "langgenius/vertex_ai/vertex_ai", "model_name": "gemini-2.0-flash-001" } Run failed: [vertex_ai] Error: PluginInvokeError: {"args":{},"error_type":"TypeError","message":"contents must not be empty"} ### ✔️ Expected Behavior The workflow should execute successfully and return a response from Vertex AI/Gemini, regardless of the prompt content. ### ❌ Actual Behavior Workflow fails with "contents must not be empty" error when using Vertex AI as the LLM provider, even though the prompt content is clearly not empty.
yindo closed this issue 2026-02-16 10:18:52 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (May 20, 2025):

The "contents must not be empty" error you're encountering with Vertex AI integration in Dify versions 1.4.0, 1.3.1, and 1.3.0 is likely due to the Gemini plugin version 0.2.0, which introduced breaking changes. To resolve this issue, you should downgrade the Gemini plugin version from 0.2.0 to 0.1.5. Additionally, ensure that you include a user prompt message in your LLM node, as relying solely on system prompts can trigger this error [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 (May 20, 2025): <!-- Answer --> The "contents must not be empty" error you're encountering with Vertex AI integration in Dify versions 1.4.0, 1.3.1, and 1.3.0 is likely due to the Gemini plugin version 0.2.0, which introduced breaking changes. To resolve this issue, you should downgrade the Gemini plugin version from 0.2.0 to 0.1.5. Additionally, ensure that you include a user prompt message in your LLM node, as relying solely on system prompts can trigger this error <sup>[[1]](https://github.com/langgenius/dify/issues/18834)</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/57f06c56-72f5-4f96-9863-286dbd1132c7?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/57f06c56-72f5-4f96-9863-286dbd1132c7?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/57f06c56-72f5-4f96-9863-286dbd1132c7?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/57f06c56-72f5-4f96-9863-286dbd1132c7?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/57f06c56-72f5-4f96-9863-286dbd1132c7?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/57f06c56-72f5-4f96-9863-286dbd1132c7?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/57f06c56-72f5-4f96-9863-286dbd1132c7?feedback_type=other)</sup>
Author
Owner

@ajaypushparaj5 commented on GitHub (May 29, 2025):

i would like to contribute on this issue as part of IEEE summer of Code. #ieeesoc

@ajaypushparaj5 commented on GitHub (May 29, 2025): i would like to contribute on this issue as part of IEEE summer of Code. #ieeesoc
Author
Owner

@ttsujino commented on GitHub (Jun 18, 2025):

This seems to be because, when using Gemini on Dify, you need to set up not only the system prompt but also the user prompt.

Image

@ttsujino commented on GitHub (Jun 18, 2025): This seems to be because, when using Gemini on Dify, you need to set up not only the system prompt but also the user prompt. ![Image](https://github.com/user-attachments/assets/7ba23ae7-b09b-4d46-99fd-6ea30e7a774e)
Author
Owner

@dosubot[bot] commented on GitHub (Aug 21, 2025):

Hi, @ukyonagata0105. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.

Issue Summary

  • Since Dify version 1.2.0, using Vertex AI (Gemini 2.0 Flash) as the LLM provider causes a "contents must not be empty" error on self-hosted Docker setups (1.3.0 to 1.4.0).
  • The error blocks workflow execution due to breaking changes in Gemini plugin version 0.2.0.
  • The recommended workaround is to downgrade the Gemini plugin to version 0.1.5 and ensure both system and user prompts are set.
  • Other users have confirmed the need to set both prompts, and there is interest in contributing a fix.

Next Steps

  • Please confirm if this issue is still relevant with the latest version of the dify-official-plugins repository.
  • If it is, you can keep the discussion open by commenting on this issue; otherwise, I will automatically close it in 5 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Aug 21, 2025): Hi, @ukyonagata0105. I'm [Dosu](https://dosu.dev), and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale. **Issue Summary** - Since Dify version 1.2.0, using Vertex AI (Gemini 2.0 Flash) as the LLM provider causes a "contents must not be empty" error on self-hosted Docker setups (1.3.0 to 1.4.0). - The error blocks workflow execution due to breaking changes in Gemini plugin version 0.2.0. - The recommended workaround is to downgrade the Gemini plugin to version 0.1.5 and ensure both system and user prompts are set. - Other users have confirmed the need to set both prompts, and there is interest in contributing a fix. **Next Steps** - Please confirm if this issue is still relevant with the latest version of the dify-official-plugins repository. - If it is, you can keep the discussion open by commenting on this issue; otherwise, I will automatically close it in 5 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#298