Closed

Description
AI Error in docker container: Invalid type for 'messages.[3].content'
Is there an existing issue for this?
- I have searched the existing issues
Can the issue be reproduced with the default theme (daylight/midnight)?
- I was able to reproduce the issue with the default theme
Could the issue be due to extensions?
- I've ruled out the possibility that the extension is causing the problem.
Describe the problem
- No extension installed
- Exact same config works in Windows desktop client
- Not working in hosted docker container
Expected result
Should work regardless of platform.
Screenshot or screen recording presentation
Version environment
- Version: v3.1.24
- Operating System: docker
- Browser (if used): up-to-date Firefox
Log file
E 2025/03/11 09:50:42 openai.go:55: create chat completion failed: error, status code: 400, status: 400 Bad Request, message: Invalid type for 'messages.[3].content': expected one of a string or array of objects, but got an object instead.
More information
Not sure why docker version does not work. Is it because of the networking is different for docker? Does the user need to config something such as DNS to make it work?
Metadata
Metadata
Assignees
Type
Projects
Relationships
Development
No branches or pull requests
Activity
88250 commentedon Mar 12, 2025
Please provide the complete log.
ps: I guess it may be a docker network configuration problem.
sz2013 commentedon Mar 14, 2025
一样的问题
这就是全部日志
E 2025/03/14 18:19:32 openai.go:55: create chat completion failed: error, status code: 400, status: 400 Bad Request, message: Invalid type for 'messages.[3].content': expected one of a string or array of objects, but got an object instead. (request id: 2025031418193220789630037510643)
winsonet commentedon Mar 14, 2025
I have the same issue~
ghost commentedon Mar 14, 2025
This entry of log is the only one that is related to AI failure. The other logs are unrelated. Please set up a container yourself, it is very easy to reproduce.
winsonet commentedon Mar 14, 2025
actually, just the Aliyun API has this issue, if using Siliconflow API then it will be fine
88250 commentedon Mar 15, 2025
Thanks for the information. It is possible that the Aliyun API is incompatible with the OpenAI API specification in some details. We cannot change this. Thanks for your feedback and discussion.
ghost commentedon Mar 17, 2025
As stated, it works in windows client, not in docker. This seems like an platform dependent implementation error instead of an error from aliyun from my perspective.
88250 commentedon Mar 17, 2025
The implementation code of this part has nothing to do with the specific platform and is the same code.
ghost commentedon Mar 20, 2025
I tried another AI provider: https://api.deepinfra.com/v1/openai
I got the same error in docker container again.
Not sure why this ticket is closed. Could you verify it before closing it? This should be very easy to verify. Just put in any provider in a docker container frontend. You will see the error.
88250 commentedon Mar 21, 2025
I tested https://api.deepseek.com/v1 with SiYuan Docker and it is available. The configuration is as follows:
I think you could try changing this
https://api.deepinfra.com/v1/openai
tohttps://api.deepinfra.com/v1
sz2013 commentedon Mar 21, 2025
我这不行,docker依然报错,但桌面端不报错
TCOTC commentedon Mar 21, 2025
超时时间改成600试试
sz2013 commentedon Mar 21, 2025
不行,一样的错
E 2025/03/21 17:01:55 openai.go:55: create chat completion failed: error, status code: 422, status: 422 Unprocessable Entity, message: invalid character 'F' looking for beginning of value, body: Failed to deserialize the JSON body into the target type: messages[0]: missing field
content
at line 1 column 5388250 commentedon Mar 21, 2025
你用的是 ai 的哪个功能?
13 remaining items