LibreChat frequently unable to display images generated by DALL-E #3320
-
What happened?LibreChat v0.7.4-rc1 running via Docker Compose on an Ubuntu 22.04.4 LTS VM Hello All, I am unable to get LibreChat to consistently display images generated using DALL-E. I send prompts like "draw a cute cat" to an OpenAI GPT Model to make it generate DALL-E images using the DALL-E plugins from the plugin store. It sometimes succesfully displays the image, but a lot of times it does not. Changing the GPT or DALL-E version doesn't seem to have an effect. When it works, the image gets displayed just fine, when it doesn't the DALL-E prompt generated by GPT shows in the browser followed by a "generated image" line: There seems to be no pattern to this behavior. Using tcpdump from the When the error occurs, the docker log for the api container always shows the following lines, indicating an issue with correctly saving the image file:
in the .env file the following variables are set using the same key:
Any ideas what's causing this? Kind regards, Tom Steps to Reproduce
What browsers are you seeing the problem on?Microsoft Edge Relevant log output2024-07-10 14:28:40 error: [saveFileFromURL] Error while saving the file: Cannot read properties of undefined (reading 'status')
[tool/end] [1:chain:AgentExecutor > 3:tool:DALLE3] [20.09s] Exiting Tool run with output: "![generated image](/images/664f16d57f38d0edd47df187/img-fec228b2-2281-447d-936d-6008316b5e05.png)" ScreenshotsCode of Conduct
|
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 16 replies
-
I moved this to discussion because it can't be reproduced. This could depend on several things, including your docker setup. Are you using the default docker setup? |
Beta Was this translation helpful? Give feedback.
-
Hi @danny-avila thank you for your response. Indeed, I am not running a default docker setup on my server. I have since done some further testing. Both on my company laptop (Windows 11) and on my private machine (Linux Mint). In both cases with the absolute minimum and most default setup possible. And on both machines I observe the same error as on the server. With a few differences: running Librechat on localhost using Docker Desktop I get no log entries when it fails to display the image. This ist true on both PCs. I think the only relevant difference between my work laptop and my private one is the much simpler network setup for the latter. Is it possible that a part of LibreChat is super sensitive to timing and doesn't wait long enough before it looks for the image? Maybe it just hasn't finished downloading yet or it is still being checked by anti-malware. |
Beta Was this translation helpful? Give feedback.
-
Having the same issue. It hasn't been functioning for some time now, but definitely was at one point.
Manually editing the message, adding the domain, and saving it will result in the image displaying properly. I assumed there was a config change and I needed to add a base URL or something, but haven't seen that anywhere in the docs/code so far. |
Beta Was this translation helpful? Give feedback.
-
I was able to resolve the issue. It was my firewall blocking downloads from domain |
Beta Was this translation helpful? Give feedback.
-
I'm using this as part of my prompt prefix, and now image URLs have been correct every time. It can probably be optimized a bit.
@danny-avila Would something along these lines fit within imageInstructions? Maybe with an adjustment for handling/detecting both internal and external URLs. |
Beta Was this translation helpful? Give feedback.
-
I found the cause for my issue: It was the firewall, but in a really advanced and non-obvious way. Using tcpdump, I saw that the DALL-E images all seem to come from a certain URL. I've whitelisted this before, but now adding this URL to absolutely all possible whitelists and exceptions makes image display reliable enough for me. It now works in 9/10 cases. I am going to close this discussion. |
Beta Was this translation helpful? Give feedback.
-
I see this behavior too now. In the debug logs nothing really shows up. The image files are not saved in the client/public/images folder. |
Beta Was this translation helpful? Give feedback.
I found the cause for my issue: It was the firewall, but in a really advanced and non-obvious way. Using tcpdump, I saw that the DALL-E images all seem to come from a certain URL. I've whitelisted this before, but now adding this URL to absolutely all possible whitelists and exceptions makes image display reliable enough for me. It now works in 9/10 cases. I am going to close this discussion.