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

An error was encountered when enabling the performance tracking feature. #15879

Open
5 tasks done
filwu8 opened this issue Mar 14, 2025 · 1 comment
Open
5 tasks done
Labels
🐞 bug Something isn't working

Comments

@filwu8
Copy link

filwu8 commented Mar 14, 2025

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

1.0.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

An error was encountered when enabling the performance tracking feature.

Image

✔️ Expected Behavior

the performance tracking feature si running

❌ Actual Behavior

api-1 | 2025-03-14 23:26:14.168 ERROR [Dummy-18] [app.py:875] - Exception on /console/api/apps/f112ffda-4341-40ce-b7ed-77bb7426803e/trace [POST]
api-1 | Traceback (most recent call last):
api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 917, in full_dispatch_request
api-1 | rv = self.dispatch_request()
api-1 | ^^^^^^^^^^^^^^^^^^^^^^^
api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 902, in dispatch_request
api-1 | return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/init.py", line 489, in wrapper
api-1 | resp = resource(*args, **kwargs)
api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^
api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask/views.py", line 110, in view
api-1 | return current_app.ensure_sync(self.dispatch_request)(**kwargs) # type: ignore[no-any-return]
api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/init.py", line 604, in dispatch_request
api-1 | resp = meth(*args, **kwargs)
api-1 | ^^^^^^^^^^^^^^^^^^^^^
api-1 | File "/app/api/controllers/console/wraps.py", line 187, in decorated
api-1 | return view(*args, **kwargs)
api-1 | ^^^^^^^^^^^^^^^^^^^^^
api-1 | File "/app/api/libs/login.py", line 94, in decorated_view
api-1 | return current_app.ensure_sync(func)(*args, **kwargs)
api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
api-1 | File "/app/api/controllers/console/wraps.py", line 30, in decorated
api-1 | return view(*args, **kwargs)
api-1 | ^^^^^^^^^^^^^^^^^^^^^
api-1 | File "/app/api/controllers/console/app/app.py", line 319, in post
api-1 | if not current_user.is_editing_role:
api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
api-1 | AttributeError: 'Account' object has no attribute 'is_editing_role'

@dosubot dosubot bot added the 🐞 bug Something isn't working label Mar 14, 2025
Copy link

dosubot bot commented Mar 14, 2025

The error you're encountering, "AttributeError: 'Account' object has no attribute 'is_editing_role'", is likely due to the absence of the is_editing_role method or attribute in the TenantAccountRole class. The Account class is attempting to use this method to check the user's role, but it seems to be missing.

To resolve this issue, ensure that the TenantAccountRole class includes a method named is_editing_role. Here's a possible implementation you can add to the TenantAccountRole class:

class TenantAccountRole:
    @staticmethod
    def is_editing_role(role):
        # Implement the logic to determine if the role is an editing role
        return role in ['editor', 'admin', 'owner']  # Example roles that might have editing permissions

Make sure to adjust the logic inside is_editing_role to fit the actual roles and permissions in your application [1].

To continue talking to Dosu, mention @dosu.


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

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

1 participant