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

Error occurs in app log page #11942

Closed
5 tasks done
leslie2046 opened this issue Dec 21, 2024 · 1 comment · Fixed by #11943
Closed
5 tasks done

Error occurs in app log page #11942

leslie2046 opened this issue Dec 21, 2024 · 1 comment · Fixed by #11943
Labels
🐞 bug Something isn't working

Comments

@leslie2046
Copy link
Contributor

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).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.14.1

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

1.Enter in studio
2.Enter in a chatflow/workflow app
3.Enter in Logs page
4.If some messages of all of the conversations are in stopped or running status will get error

✔️ Expected Behavior

图片

❌ Actual Behavior

1734780051234
1734780099148

Copy link

dosubot bot commented Dec 21, 2024

The error you're encountering is a KeyError for the key 'stopped' in the status_count function of the models/model.py file. This function is designed to count the number of messages with statuses like "success", "failed", and "partial_success" but does not handle the "stopped" status, which is causing the error [1].

To resolve this issue, you need to modify the status_count function to account for the "stopped" status. You can do this by adding a check for the "stopped" status in the function and updating the dictionary it returns to include this status. Here's a possible modification:

{
    "success": status_counts.get(WorkflowRunStatus.SUCCEEDED, 0),
    "failed": status_counts.get(WorkflowRunStatus.FAILED, 0),
    "partial_success": status_counts.get(WorkflowRunStatus.PARTIAL_SUCCESSED, 0),
    "stopped": status_counts.get(WorkflowRunStatus.STOPPED, 0),
}

This change uses the get method to safely retrieve the count for each status, defaulting to 0 if the status is not present, and includes the "stopped" status in the returned dictionary.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@dosubot dosubot bot added the 🐞 bug Something isn't working label Dec 21, 2024
@leslie2046 leslie2046 mentioned this issue Dec 21, 2024
5 tasks
crazywoola pushed a commit that referenced this issue Dec 21, 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

Successfully merging a pull request may close this issue.

1 participant