dify icon indicating copy to clipboard operation
dify copied to clipboard

after Prview, rein this application ,got :Application error

Open lingfengchencn opened this issue 1 year ago • 2 comments

Self Checks

  • [X] This is only for bug report, if you would like to ask a quesion, please head to Discussions.
  • [X] I have searched for existing issues search for existing issues, including closed ones.
  • [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [X] Pleas do not modify this template :) and fill in all the required fields.

Dify version

0.6.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

1、create a new application "问题分类 + 知识库 + 聊天机器人" ; 2、click "Preview" 3、click "Studio" to go back application list; 4、click "问题分类 + 知识库 + 聊天机器人" application ; 5、perhaps you will get the error “ Application error: a client-side exception has occurred (see the browser console for more information).”

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

lingfengchencn avatar Apr 10 '24 07:04 lingfengchencn

你好,@lingfengchencn!很高兴再次见到你,希望你一切都好。

The error you're encountering seems to be related to a misconfiguration or network issue preventing your application from communicating with the code execution service. This is a common issue when the application is unable to reach the code execution service, possibly due to incorrect settings or network problems.

A similar problem was resolved by changing the connection address to http://host.docker.internal:19530/ instead of using 127.0.0.1:19530, ensuring that Docker's WSL 2 based engine is configured to add *.docker.internal names to the host's etc/hosts file. This adjustment was effective for users experiencing connectivity issues with the code execution service.

Make sure that your CODE_EXECUTION_ENDPOINT and CODE_EXECUTION_API_KEY environment variables are correctly configured. These variables should match the settings expected by your code execution service. Additionally, verify that the code execution service is running and accessible from your application.

Here's a snippet to help you handle exceptions in your code_executor.py more effectively:

try:
    response = post(str(url), json=data, headers=headers, timeout=CODE_EXECUTION_TIMEOUT)
    if response.status_code == 503:
        raise CodeExecutionException('Code execution service is unavailable')
    elif response.status_code != 200:
        raise Exception(f'Failed to execute code, got status code {response.status_code}, please check if the sandbox service is running')
except CodeExecutionException as e:
    raise e
except Exception as e:
    raise CodeExecutionException('Failed to execute code, this is likely a network issue, please check if the sandbox service is running')

This code ensures that any issues with the code execution service are correctly identified and reported, helping you diagnose the problem more effectively.

If after these adjustments the issue remains, it would be beneficial to check both the application and service logs for more detailed error messages that could provide further insight into the problem.

Unfortunately, without specific details on the changes made in Dify version 0.6.0, I recommend checking the release notes or changelog for any updates that might impact your application.

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.

If you want to continue the conversation, start your reply with @dosu-bot.

dosubot[bot] avatar Apr 10 '24 07:04 dosubot[bot]

Please try the latest version v0.6.1

crazywoola avatar Apr 10 '24 08:04 crazywoola