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

本地源码启动 GET http://localhost:5001/console/api/enterprise-features net::ERR_CONNECTION_REFUSED localhost:5001/console/api/apps?page=1&limit=30&name=:1 #4196

Closed
4 tasks done
wdkrdem opened this issue May 8, 2024 · 1 comment
Labels
🐞 bug Something isn't working

Comments

@wdkrdem
Copy link

wdkrdem commented May 8, 2024

Self Checks

  • This is only for bug report, if you would like to ask a quesion, 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).
  • Pleas do not modify this template :) and fill in all the required fields.

Dify version

0.3.21

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

为什么本地源码启动 web页面正常 但是不能访问
查看报错为系统接口是localhost地址 没有解析为IP
GET http://localhost:5001/console/api/enterprise-features net::ERR_CONNECTION_REFUSED localhost:5001/console/api/apps?page=1&limit=30&name=:1
Snipaste_2024-05-08_23-18-58

✔️ Expected Behavior

应当解析为IP

❌ Actual Behavior

localhost

@dosubot dosubot bot added the 🐞 bug Something isn't working label May 8, 2024
Copy link

dosubot bot commented May 8, 2024

To address the net::ERR_CONNECTION_REFUSED errors and the uncaught TypeError due to null references when accessing http://localhost:5001/console/api/enterprise-features and other API endpoints, follow these troubleshooting steps:

  1. Verify Backend Services: Ensure the backend services are running on localhost at port 5001. If not, start them as per the Dify documentation.

  2. Network Configuration: Check that your network configuration allows connections to localhost on port 5001. This includes ensuring your firewall allows incoming connections on this port and that localhost and 127.0.0.1 are excluded from any proxy configurations.

  3. Use Docker for Frontend Services: If developing the backend separately, use Docker to run the frontend services, ensuring they point to your backend services running on localhost:5001.

  4. Environment Variables Configuration: Ensure environment variables NEXT_PUBLIC_API_PREFIX and NEXT_PUBLIC_PUBLIC_API_PREFIX are correctly set to point to your backend services.

  5. Correct Typo in Document Body Attribute: If using HTML attributes to set the API prefix, ensure the correct spelling is used (data-public-api-prefix).

  6. Browser Configuration: Ensure your browser allows connections to localhost. Typically, no specific configuration is needed for this.

  7. Configure CORS: If your frontend and backend are on different ports, configure your backend to allow CORS requests from your frontend's origin.

  8. Check for Null References: Use browser developer tools to identify and correct any null references in your code.

By following these steps, you should be able to resolve the connection issues and errors when accessing backend services in your self-hosted instance of Dify.

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.

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