frappe / press

Full service cloud hosting for the Frappe stack - powers Frappe Cloud
https://frappe.cloud
GNU Affero General Public License v3.0
270 stars 191 forks source link

Analytics - Internal Server Error #2197

Open aidemkin opened 1 month ago

aidemkin commented 1 month ago

Hi. The site analytics shows error "111" and does not display information in dashboards. Below is a related error from the error log and a screenshot of the analytics page. Please help me solve the problem.

Снимок экрана 2024-10-01 в 22 08 17

Error "'str' object has no attribute 'max'": Traceback with variables (most recent call last): File "apps/frappe/frappe/app.py", line 114, in application response = frappe.api.handle(request) request = <Request 'http://89.169.169.178/api/method/press.api.analytics.get' [POST]> response = None rollback = True e = AttributeError("'str' object has no attribute 'max'") File "apps/frappe/frappe/api/init.py", line 49, in handle data = endpoint(arguments) request = <Request 'http://89.169.169.178/api/method/press.api.analytics.get' [POST]> endpoint = <function handle_rpc_call at 0x7fef572d5c60> arguments = {'method': 'press.api.analytics.get'} File "apps/frappe/frappe/api/v1.py", line 36, in handle_rpc_call return frappe.handler.handle() method = 'press.api.analytics.get' frappe = <module 'frappe' from 'apps/frappe/frappe/init.py'> File "apps/frappe/frappe/handler.py", line 49, in handle data = execute_cmd(cmd) cmd = 'press.api.analytics.get' data = None File "apps/frappe/frappe/handler.py", line 85, in execute_cmd return frappe.call(method, frappe.form_dict) cmd = 'press.api.analytics.get' from_async = False server_script = None method = <function get at 0x7fef523ef640> File "apps/frappe/frappe/init.py", line 1775, in call return fn(*args, newargs) fn = <function get at 0x7fef523ef640> args = () kwargs = {'name': 'support.wspacehub.com', 'timezone': 'Europe/Moscow', 'duration': '24h', 'cmd': 'press.api.analytics.get'} newargs = {'name': 'support.wspacehub.com', 'timezone': 'Europe/Moscow', 'duration': '24h'} File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper return func(*args, *kwargs) args = () kwargs = {'name': 'support.wspacehub.com', 'timezone': 'Europe/Moscow', 'duration': '24h'} apply_condition = <function whitelist..innerfn.. at 0x7fef523ef760> func = <FunctionWrapper at 0x7fef523e9b40 for function at 0x7fef523ef7f0> File "apps/press/press/api/site.py", line 75, in wrapper return wrapped(args, kwargs) wrapped = <function get at 0x7fef523ef7f0> instance = None args = () kwargs = {'name': 'support.wspacehub.com', 'timezone': 'Europe/Moscow', 'duration': '24h'} user_type = 'System User' doctypes = ['Site'] File "apps/press/press/api/analytics.py", line 84, in get "usage_counter": [{"value": r.max, "date": r.date} for r in request_data], name = 'support.wspacehub.com' timezone = 'Europe/Moscow' duration = '24h' timespan = 86400 timegrain = 1800 request_data = {'datasets': [], 'labels': []} request_count_by_path_data = {'datasets': [], 'labels': []} request_duration_by_path_data = {'datasets': [], 'labels': []} average_request_duration_by_path_data = {'datasets': [], 'labels': []} background_job_count_by_method_data = {'datasets': [], 'labels': []} background_job_duration_by_method_data = {'datasets': [], 'labels': []} average_background_job_duration_by_method_data = {'datasets': [], 'labels': []} slow_logs_by_count = {'datasets': [], 'labels': []} slow_logs_by_duration = {'datasets': [], 'labels': []} check = [] has_slow_queries = False job_data = {'datasets': [], 'labels': []} uptime_data = [] plan = 'default' plan_limit = None SLOW_QUERY_DURATION_THRESHOLD = 50 File "apps/press/press/api/analytics.py", line 84, in "usage_counter": [{"value": r.max, "date": r.date} for r in request_data], .0 = <dict_keyiterator object at 0x7fef522588b0> r = 'datasets' builtins.AttributeError: 'str' object has no attribute 'max'

aidemkin commented 20 hours ago

hey @BreadGenie

Could you answer my question? Thank you.