Project

General

Profile

Error 500 on first connection

Added by Aurelien PANIZZA over 9 years ago

Hi all,

I've got a problem with Redmine on the first connection. Indeed, the first connection is quite long (15-20s) and end up with an error 500. If I refresh the page, it then works well. After a long connection idle, the same happen.
I turned on debug log. It appears that the faulty SQL is :

[1m[35mSQL (0.0ms)[0m  SELECT `members`.`id` AS t0_r0, `members`.`user_id` AS t0_r1, `members`.`project_id` AS t0_r2, `members`.`created_on` AS t0_r3, `members`.`mail_notification` AS t0_r4, `projects`.`id` AS t1_r0, `projects`.`name` AS t1_r1, `projects`.`description` AS t1_r2, `projects`.`homepage` AS t1_r3, `projects`.`is_public` AS t1_r4, `projects`.`parent_id` AS t1_r5, `projects`.`created_on` AS t1_r6, `projects`.`updated_on` AS t1_r7, `projects`.`identifier` AS t1_r8, `projects`.`status` AS t1_r9, `projects`.`lft` AS t1_r10, `projects`.`rgt` AS t1_r11, `projects`.`inherit_members` AS t1_r12, `roles`.`id` AS t2_r0, `roles`.`name` AS t2_r1, `roles`.`position` AS t2_r2, `roles`.`assignable` AS t2_r3, `roles`.`builtin` AS t2_r4, `roles`.`permissions` AS t2_r5, `roles`.`issues_visibility` AS t2_r6 FROM `members` LEFT OUTER JOIN `projects` ON `projects`.`id` = `members`.`project_id` LEFT OUTER JOIN `member_roles` ON `member_roles`.`member_id` = `members`.`id` LEFT OUTER JOIN `roles` ON `roles`.`id` = `member_roles`.`role_id` WHERE `members`.`user_id` = 187 AND (projects.status<>9) ORDER BY projects.name
Completed 500 Internal Server Error in 921.9ms (Views: 234.4ms | ActiveRecord: 62.4ms)

If I execute this query directly on MySQL, it works well and return many rows.
On the second try I get :

[1m[36mSQL (0.0ms)[0m  [1mSELECT `members`.`id` AS t0_r0, `members`.`user_id` AS t0_r1, `members`.`project_id` AS t0_r2, `members`.`created_on` AS t0_r3, `members`.`mail_notification` AS t0_r4, `projects`.`id` AS t1_r0, `projects`.`name` AS t1_r1, `projects`.`description` AS t1_r2, `projects`.`homepage` AS t1_r3, `projects`.`is_public` AS t1_r4, `projects`.`parent_id` AS t1_r5, `projects`.`created_on` AS t1_r6, `projects`.`updated_on` AS t1_r7, `projects`.`identifier` AS t1_r8, `projects`.`status` AS t1_r9, `projects`.`lft` AS t1_r10, `projects`.`rgt` AS t1_r11, `projects`.`inherit_members` AS t1_r12, `roles`.`id` AS t2_r0, `roles`.`name` AS t2_r1, `roles`.`position` AS t2_r2, `roles`.`assignable` AS t2_r3, `roles`.`builtin` AS t2_r4, `roles`.`permissions` AS t2_r5, `roles`.`issues_visibility` AS t2_r6 FROM `members` LEFT OUTER JOIN `projects` ON `projects`.`id` = `members`.`project_id` LEFT OUTER JOIN `member_roles` ON `member_roles`.`member_id` = `members`.`id` LEFT OUTER JOIN `roles` ON `roles`.`id` = `member_roles`.`role_id` WHERE `members`.`user_id` = 187 AND (projects.status<>9) ORDER BY projects.name[0m
Completed 200 OK in 156.3ms (Views: 109.4ms | ActiveRecord: 31.3ms)

Any idea of what is the problem ?

Redmine run on Windows 2012 / IIS

Environment:
Redmine version 2.6.2.stable
Ruby version 1.9.3-p448 (2013-06-27) [i386-mingw32]
Rails version 3.2.21
Environment production
Database adapter Mysql2
SCM:
Filesystem
Redmine plugins:
manage_wiki_view_page_permission 0.0.1
redmine_admin_monitor 1.0.0
redmine_auto_lock 1.0.0
redmine_checklists 3.1.1
redmine_closes_resolved_issues 1.0.2
redmine_customized_report 0.0.1
redmine_inline_attach_screenshot 0.4.6
redmine_issue_reminder 0.0.1
redmine_stats 0.0.2
redmine_track_control 1.1.0
release_logs 0.1.1
version_time_control 1.1.0