Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The environment variable CONSOLE_WEB_URL is set to blank #4428

Closed
4 tasks done
TinsFox opened this issue May 15, 2024 · 2 comments
Closed
4 tasks done

The environment variable CONSOLE_WEB_URL is set to blank #4428

TinsFox opened this issue May 15, 2024 · 2 comments
Labels
🐞 bug Something isn't working

Comments

@TinsFox
Copy link
Contributor

TinsFox commented May 15, 2024

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).
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.6.8

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. clone source code
  2. Expose the server port in the host
    # uncomment to expose dify-api port to host
    # ports:
    # - "5001:5001"
  3. cd web && yarn && yarn dev
  4. Open the settings panel and enter the model supplier. You can see the picture below. The icon of the model is missing.
image

✔️ Expected Behavior

The model's icon should show up

❌ Actual Behavior

The icon of the model is missing.

Copy link

dosubot bot commented May 15, 2024

To address the issue of the missing model icon in your self-hosted Dify setup, ensure you have correctly set the CONSOLE_URL and APP_URL environment variables, not CONSOLE_WEB_URL. These variables should point to your backend service URL, for example:

docker run -it -p 3000:3000 -e CONSOLE_URL=http://127.0.0.1:5001 -e APP_URL=http://127.0.0.1:5001 langgenius/dify-web:latest

Adjust these variables to match your setup, then restart your Docker containers. This step is crucial for the frontend to correctly fetch resources and make API calls.

Additionally, check for JavaScript errors in the console, as they could be related to the issue. If you find errors, compare them with common issues documented in the Dify installation FAQ to find potential fixes.

Dify uses a TypeScript component for handling model icons, which imports SVG data from a JSON file. This setup ensures icons are efficiently managed and displayed. If the environment variables and JavaScript errors don't seem to be the issue, there might be a problem with how these components are loaded or rendered.

If the problem persists after checking these areas, please provide more detailed error messages from both the frontend console and any backend logs, along with your Docker setup details, to further diagnose the issue.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

@dosubot dosubot bot added the 🐞 bug Something isn't working label May 15, 2024
@TinsFox
Copy link
Contributor Author

TinsFox commented May 15, 2024

After some exploration, I located where the bug occurred. This was because CONSOLE_API_URL in docker-compose.yml was set to an empty string.

But you may be wondering why there is no problem accessing localhost in the docker-compose service. This is because a layer of forwarding is done in Nginx. Nginx forwards /console/api to http://api:5001, which allows images to be found normally.

When the backend is started with source code, CONSOLE_API_URL in .env will be set to http://127.0.0.1:5001, so there will be no problems when starting the source code.

But when starting the backend through docker-compose, the address returned by the model image will be /console/api/xxxx.png, and then it will go to http://localhost:3000/console/api/workspaces/xxxx.png Search under, this will result in the picture not being found.

When I comment out this variable or fill it in as http://127.0.0.1:5001, the performance becomes normal.

CONSOLE_API_URL: ''

Although the performance during generation is normal, the logic behind it is different. I think this problem needs to be improved, because it is actually two different sets of logic achieving the same effect.

@TinsFox TinsFox changed the title CONSOLE_WEB_URL environment variables are set to blank The environment variable CONSOLE_WEB_URL is set to blank May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants