VertexAI Claude 3.5 Sonnet v2 Error when Sending a Message with Files #110

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

Originally created by @lema-founders on GitHub (Mar 22, 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

v1.1.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Use files input field

Image

  1. Use Vertex Claude 3.5 Sonnet v2 model

Image

  1. Upload a file through files input field and send a message (can be anything like a random .png)

Image

✔️ Expected Behavior

Model recognizing the file and using it to generate LLM output

Actual Behavior

[vertex_ai] Error: PluginInvokeError: {"args":{"description":"[models] Error: 'list' object has no attribute 'strip'"},"error_type":"InvokeError","message":"[models] Error: 'list' object has no attribute 'strip'"}

Image

Originally created by @lema-founders on GitHub (Mar 22, 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 v1.1.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1. Use files input field ![Image](https://github.com/user-attachments/assets/8a579e6c-3a5c-461b-bdae-a583daf9dd1d) 2. Use Vertex Claude 3.5 Sonnet v2 model ![Image](https://github.com/user-attachments/assets/8451d94b-f964-41ae-baa1-c6e9c73edd39) 3. Upload a file through files input field and send a message (can be anything like a random .png) ![Image](https://github.com/user-attachments/assets/c55230fc-195f-4966-867d-caf5faf04bca) ### ✔️ Expected Behavior Model recognizing the file and using it to generate LLM output ### ❌ Actual Behavior [vertex_ai] Error: PluginInvokeError: {"args":{"description":"[models] Error: 'list' object has no attribute 'strip'"},"error_type":"InvokeError","message":"[models] Error: 'list' object has no attribute 'strip'"} ![Image](https://github.com/user-attachments/assets/8cf746ae-9bd8-4483-8557-c5fa3fe6af9e)
yindo closed this issue 2026-02-16 10:18:06 -05:00
Author
Owner

@lema-founders commented on GitHub (Mar 22, 2025):

Might be because Dify chatflow and / workflow isn't making the file upload call properly to VertexAI? https://cloud.google.com/vertex-ai/docs/reference/rest

@lema-founders commented on GitHub (Mar 22, 2025): Might be because Dify chatflow and / workflow isn't making the file upload call properly to VertexAI? https://cloud.google.com/vertex-ai/docs/reference/rest
Author
Owner

@dosubot[bot] commented on GitHub (Mar 22, 2025):

The error you're encountering, PluginInvokeError: 'list' object has no attribute 'strip', suggests that there might be an issue with how the file data is being processed or formatted before being sent to the Vertex AI API. This could be due to the way Dify's chatflow is handling the file input or how it's interfacing with the Vertex AI API.

Here are a few things to consider:

  1. File Handling in Dify: Ensure that the file input is correctly configured in the Dify chatflow. The 'File List' type should be set up to handle the specific file types you are working with, and the files should be stored in conversational variables as needed [1].

  2. API Integration: Verify that the API call to Vertex AI is correctly formatted. The error message indicates that a list is being processed where a string is expected, possibly in a part of the code where a file path or content is being handled. Check if the file data is being converted to the expected format before making the API call.

  3. Debugging the Error: Look into the part of the code where the file data is being prepared for the API call. Ensure that any list of files is being iterated over and processed individually, and that string operations like strip() are not being mistakenly applied to a list object.

  4. Vertex AI API Documentation: Review the Vertex AI API documentation to ensure that the endpoints and methods being used are correct for your use case. The documentation provides details on how to import files and handle chat completions, which might be relevant for your setup [2].

By addressing these areas, you should be able to identify and resolve the issue with the file upload process in your Dify chatflow.

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 (Mar 22, 2025): <!-- Answer --> The error you're encountering, `PluginInvokeError: 'list' object has no attribute 'strip'`, suggests that there might be an issue with how the file data is being processed or formatted before being sent to the Vertex AI API. This could be due to the way Dify's chatflow is handling the file input or how it's interfacing with the Vertex AI API. Here are a few things to consider: 1. **File Handling in Dify**: Ensure that the file input is correctly configured in the Dify chatflow. The 'File List' type should be set up to handle the specific file types you are working with, and the files should be stored in conversational variables as needed <sup>[[1]](https://github.com/langgenius/dify/issues/15264)</sup>. 2. **API Integration**: Verify that the API call to Vertex AI is correctly formatted. The error message indicates that a list is being processed where a string is expected, possibly in a part of the code where a file path or content is being handled. Check if the file data is being converted to the expected format before making the API call. 3. **Debugging the Error**: Look into the part of the code where the file data is being prepared for the API call. Ensure that any list of files is being iterated over and processed individually, and that string operations like `strip()` are not being mistakenly applied to a list object. 4. **Vertex AI API Documentation**: Review the Vertex AI API documentation to ensure that the endpoints and methods being used are correct for your use case. The documentation provides details on how to import files and handle chat completions, which might be relevant for your setup <sup>[[2]](https://github.com/langgenius/dify-docs/blob/main/jp/guides/workflow/file-upload.md)</sup>. By addressing these areas, you should be able to identify and resolve the issue with the file upload process in your Dify chatflow. <!-- 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/1122e376-6598-4cac-8ac1-7411f79c5523?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/1122e376-6598-4cac-8ac1-7411f79c5523?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/1122e376-6598-4cac-8ac1-7411f79c5523?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/1122e376-6598-4cac-8ac1-7411f79c5523?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/1122e376-6598-4cac-8ac1-7411f79c5523?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/1122e376-6598-4cac-8ac1-7411f79c5523?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/1122e376-6598-4cac-8ac1-7411f79c5523?feedback_type=other)</sup>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#110