Project

General

Profile

Actions

Defect #14939

closed

Wiki link to specific issues failed

Added by wooden rob over 10 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Wiki
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

Environment:
 Redmine version                2.3.3.devel
 Ruby version                   1.9.3-p385 (2013-02-06) [i686-linux]
 Rails version                  3.2.13
 Environment                    production
 Database adapter               Mysql2
SCM:
 Git                            1.7.10.4
 Filesystem                     
Redmine plugins:
 no plugin installed

Lets consider two users: A and B.
B is admin.

A get an "Internal Error" when accessing a wiki pages with links to specific issues.
B can always see the pages in
  1. When page content is as follow, A gets the error.
    #4346
    #12
    
  2. When page content is as follow, A can see the content of the page.
    #12
    #4346
    

When the "Internal Error" occurs, I can see a sql error in the log.


Related issues

Related to Redmine - Patch #14606: Internal error when copying an issue + on "my page" in block "assigned to me"Closed

Actions
Actions #1

Updated by wooden rob over 10 years ago

Actually, the "internal error" occured due to wrong sql request.
The syntax is wrong.

We observed a similar issue when reading an issue.

We need to investiguate why there is a syntax error in the generated request.

Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '))))

The error is about empty field in the query ex: "IN (72,25,,)"

Here is the full query.

SELECT `issues`.`id` AS t0_r0, `issues`.`tracker_id` AS t0_r1, `issues`.`project_id` AS t0_r2, `issues`.`subject` AS t0_r3, `issues`.`description` AS t0_r4, `issues`.`due_date` AS t0_r5, `issues`.`category_id` AS t0_r6, `issues`.`status_id` AS t0_r7, `issues`.`assigned_to_id` AS t0_r8, `issues`.`priority_id` AS t0_r9, `issues`.`fixed_version_id` AS t0_r10, `issues`.`author_id` AS t0_r11, `issues`.`lock_version` AS t0_r12, `issues`.`created_on` AS t0_r13, `issues`.`updated_on` AS t0_r14, `issues`.`start_date` AS t0_r15, `issues`.`done_ratio` AS t0_r16, `issues`.`estimated_hours` AS t0_r17, `issues`.`parent_id` AS t0_r18, `issues`.`root_id` AS t0_r19, `issues`.`lft` AS t0_r20, `issues`.`rgt` AS t0_r21, `issues`.`is_private` AS t0_r22, `issues`.`closed_on` AS t0_r23, `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 FROM `issues` LEFT OUTER JOIN `projects` ON `projects`.`id` = `issues`.`project_id` WHERE `issues`.`id` = 4481 AND (((projects.status <> 9 AND projects.id IN (SELECT em.project_id FROM enabled_modules em WHERE em.name='issue_tracking')) AND ((projects.is_public = 1 AND ((issues.is_private = 0 OR issues.author_id = 72 OR issues.assigned_to_id IN (72,25,,)))) OR (projects.id IN (84,10,135,16,36,120,86,90,85,98,28,7,115,134,110,24,25,17,50,23,88,4,136,22,19,108,137,131,27,133,91,6,83,94,31,32,37,35) AND ((issues.is_private = 0 OR issues.author_id = 72 OR issues.assigned_to_id IN (72,25,,)))) OR (projects.id IN (84,10,120,9,86,90,2,85,98,7,115,114,121,110,112,8,88,4,138,140,132,139,108,18,127,113,3,5,91,6,123,83,94,13,74) AND ((issues.is_private = 0 OR issues.author_id = 72 OR issues.assigned_to_id IN (72,25,,)))) OR (projects.id IN (124,120,122,128,121,112,138,132,127,113,123) AND ((issues.is_private = 0 OR issues.author_id = 72 OR issues.assigned_to_id IN (72,25,,)))) OR (projects.id IN (135,2,15,134,14,8,130,125,136,139,137,131,18,93,12,3,5,41,33,133,129,13,30,11,126) AND ((issues.is_private = 0 OR issues.author_id = 72 OR issues.assigned_to_id IN (72,25,,)))) OR (projects.id IN (2) AND ((issues.is_private = 0 OR issues.author_id = 72 OR issues.assigned_to_id IN (72,25,,))))))) LIMIT 1

Actions #2

Updated by wooden rob over 10 years ago

I find out that it is user.groups in app/models/issue.rb that seems "corrupted".

users.groups.map(&:id) returns either [25, nil, nil] or [nil, nil, nil].
But I expect [13, 15,60].

Actions #3

Updated by wooden rob over 10 years ago

  • Status changed from New to Resolved
Actions #5

Updated by Toshi MARUYAMA over 10 years ago

  • Related to Patch #14606: Internal error when copying an issue + on "my page" in block "assigned to me" added
Actions #6

Updated by Toshi MARUYAMA over 10 years ago

  • Status changed from Resolved to New
Actions #7

Updated by Toshi MARUYAMA over 10 years ago

  • Status changed from New to Closed
Actions

Also available in: Atom PDF