xmera-circle / redmine_workload

[Fork] Calculate user workload over time
6 stars 3 forks source link

500 Error when loading Workloads main page #9

Closed AndreiIf closed 1 year ago

AndreiIf commented 2 years ago
Started GET "/workloads" for 192.168.206.13 at 2022-09-21 10:11:21 +0300
Processing by WorkloadsController#index as HTML
  Current user: andrei.ifrim (id=90)
Completed 500 Internal Server Error in 114ms (ActiveRecord: 21.1ms)

ActiveRecord::StatementInvalid (PG::SyntaxError: ERROR:  syntax error at or near "end"
LINE 1: ...tional_holidays" WHERE (start <= '2022-09-11' AND end >= '20...
                                                             ^
: SELECT  1 AS one FROM "wl_national_holidays" WHERE (start <= '2022-09-11' AND end >= '2022-09-11') LIMIT $1):

plugins/redmine_workload/lib/redmine_workload/wl_date_tools.rb:79:in `holiday?'
plugins/redmine_workload/lib/redmine_workload/wl_date_tools.rb:63:in `block (2 levels) in working_days_in_time_span'
plugins/redmine_workload/lib/redmine_workload/wl_date_tools.rb:61:in `block in working_days_in_time_span'
plugins/redmine_workload/lib/redmine_workload/wl_date_tools.rb:58:in `working_days_in_time_span'
plugins/redmine_workload/app/models/user_workload.rb:358:in `working_days_in_time_span'
plugins/redmine_workload/app/models/user_workload.rb:66:in `block in hours_per_user_issue_and_day'
plugins/redmine_workload/app/models/user_workload.rb:65:in `each'
plugins/redmine_workload/app/models/user_workload.rb:65:in `hours_per_user_issue_and_day'
plugins/redmine_workload/app/controllers/workloads_controller.rb:42:in `index'
lib/redmine/sudo_mode.rb:61:in `sudo_mode'
liaham commented 2 years ago

Hi @AndreiIf ,

Thank you very much for opening your first issue here! Contributions are always welcome.

Since you're reporting a bug, please add some steps to reproduce the issue. Add also some information about your environment. You will get that info by navigating into your Redmine root directory and typing:

bin/rails about

This would help us to investigate your issue.

Best Regards, Liane

AndreiIf commented 2 years ago

Hello @liaham, So , to reproduce the steps: Installed the plugin accordingly , after that I added 1 entry for holidays. As long as the user or group that I want to see the workload for has no active issues between the interval selected, it return no activity. After I add some Issues for the same user it return error 500 with the error mentioned above in production.log Here are some information about the enviroment:

  Ruby version                   2.7.4-p191 (2021-07-07) [x86_64-linux]
  Rails version                  5.2.8
  Environment                    production
  Database adapter               PostgreSQL
List of installed plugins:
additionals
author
default_roles
periodictask
progressive_projects_list
redmine_agile
redmine_announcements
redmine_base_deface
redmine_base_select2
redmine_better_overview
redmine_checklists
redmine_contacts
redmine_contacts_helpdesk
redmine_dmsf
redmine_documents_short
redmine_drive
redmine_excel_connector
redmine_favorite_projects
redmine_issue_dynamic_edit
redmine_issue_evm
redmine_issue_templates
redmine_lightbox2
redmine_more_context
redmine_my_page_paginations
redmine_people
redmine_questions
redmine_reporter
redmine_resources
redmine_tint_issues
redmineup_tags
redmine_view_issue_description
redmine_wiki_issue_fields
redmine_workload
redmine_x_assets
redmine_x_gantt
redmine_xlsx_format_issue_exporter
sidebar_hide
status_button
that_meeting

Thank you!

liaham commented 2 years ago

Hi @AndreiIf ,

Thank your very much for your quick response!

We will try to reproduce the error. Please be patient, since this may take a while.

Have a nice weekend!

Best Regards, Liane

mboremski commented 1 year ago

Hello @AndreiIf, I updated your comments for better readability. 😃 Best regards, Markus

mboremski commented 1 year ago

Solution will not be realized by @liaham or @mboremski since we normally do not use postgre. We need support from community here.

liaham commented 1 year ago

Same as #16!