maxrossello / redmine_app_timesheets

A true timesheet plugin using orders, not bound to timelogs over issues
GNU General Public License v2.0
32 stars 10 forks source link

500 Internal Server Error - redmine 3.1.3 #75

Closed blackophelia closed 8 years ago

blackophelia commented 8 years ago

Redmine version 3.1.3 Ruby version ruby 2.0.0p598 (2014-11-13) [x86_64-linux] Rails version 4.2.5 CentOS 7

I'm upgrading redmine from 2.6.0 to v3.1.3, and have come across the following issue, with a failing query.

Started GET "/apps/timesheets" for 127.0.0.1 at 2016-01-15 14:14:46 +1100 Processing by TimesheetsController#index as HTML Current user: redacted (id=506) Completed 500 Internal Server Error in 173ms (ActiveRecord: 14.4ms)

ActiveRecord::StatementInvalid (PG::SyntaxError: ERROR: subquery has too many columns LINE 2: ...ersions.project_id != 181 AND versions.project_id IN (SELECT... ^ : SELECT "versions".* FROM "versions" INNER JOIN "projects" ON "projects"."id" = "versions"."project_id" WHERE (projects.id = 181 OR (projects.status <> 9 AND ( versions.sharing = 'system' OR (projects.lft >= 535 AND projects.rgt <= 536 AND versions.sharing = 'tree') OR (projects.lft < 535 AND projects.rgt > 536 AND versions.sharing IN ('hierarchy', 'descendants')) OR (projects.lft > 535 AND projects.rgt < 536 AND versions.sharing = 'hierarchy')))) AND ((versions.project_id = 181 AND versions.id IN (552,554,556,553,1082,926,643)) OR (versions.project_id != 181 AND versions.project_id IN (SELECT "projects".* FROM "projects" WHERE (projects.status <> 9 AND projects.id IN (SELECT em.project_id FROM enabled_modules em WHERE em.name='issue_tracking'))))) AND (projects.status <> 9 AND projects.id IN (SELECT em.project_id FROM enabled_modules em WHERE em.name='issue_tracking')) AND "versions"."in_timesheet" = $1): lib/redmine/sudo_mode.rb:63:in `sudo_mode'

The nested subquery failing is shown in bold.

Any help would be appreciated.

Cheers, Josie

cc @greyman888

greyman888 commented 8 years ago

Hi Josie,

Can you please try upgrading ruby to 2.2? In the rails docs it recommends this. http://rubyonrails.org/download/

I currently have redmine working with the timesheet plugin with this setup:

Environment

Redmine version: 3.1.3.stable Ruby version: 2.2.1-p85 (2015-02-26) [x86_64-linux] Rails version: 4.2.5 Database adapter: PostgreSQL

Redmine plugins

redmine_app__space: 1.0.4 redmine_app_timesheets: 1.5.9

blackophelia commented 8 years ago

Hi Adam,

Thanks for the update. I'll try your suggestions today.

Cheers, Josie

blackophelia commented 8 years ago

Update:

Got the timesheets working with the following. Thanks for your help!

Environment

Redmine version: 3.2.0.stable Ruby version: 2.3.0 Rails version: 4.2.5 Database adapter: PostgreSQL

Redmine plugins