OpenSourceBrain / redmine

This is a customised version of redmine for the Open Source Brain website
http://www.opensourcebrain.org
5 stars 3 forks source link

Error in viewing project page when logged in #279

Closed pgleeson closed 6 years ago

pgleeson commented 8 years ago

@tarelli still getting this error in redmine as you saw when you were here:


Started GET "/projects/acnet2" for 127.0.0.1 at 2016-09-01 15:38:32 +0100
Processing by ProjectsController#show as HTML
  Parameters: {"id"=>"acnet2"}
  Current user: padraig (id=4)
  Rendered projects/_members_box.html.erb (1.4ms)
  Rendered projects/show.html.erb within layouts/base (49.0ms)
Completed 500 Internal Server Error in 76.9ms

ActionView::Template::Error (Mysql2::Error: Expression #1 of ORDER BY clause is not in SELECT list, references column 'redmine.projects.name' which is not in SELECT list; this is incompatible with DISTINCT: SELECT  DISTINCT `members`.id 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` = 4 AND `members`.`project_id` = 73 AND (projects.status<>9) ORDER BY projects.name LIMIT 1):
    60:         <% bbrepo=getCustomField(@project,'Bitbucket repository') %>
    61:         <% tags=getCustomField(@project,'Tags') %>
    62:         <% neuroLexIds=getCustomField(@project,'NeuroLex Ids: Cells') %>
    63:         <% roles = User.current.roles_for_project(@project).collect(&:name) %>
    64:         <% if (modeldb!=nil and  modeldb!="") or (original!=nil and original!="") or (ghrepo!=nil and ghrepo!="")  or (bbrepo!=nil and bbrepo!="") or (tags!=nil and tags!='' and tags!=[nil]) or (neuroLexIds!=nil and neuroLexIds!="") or (roles.include? 'Developer' or roles.include? 'Manager' or User.current.admin?) %>
    65:             <section id="references">
    66:                 <div class="page-header">
  app/models/user.rb:464:in `block in membership'
  app/models/user.rb:466:in `yield'
  app/models/user.rb:466:in `membership'
  app/models/user.rb:479:in `roles_for_project'
  app/views/projects/show.html.erb:63:in `_app_views_projects_show_html_erb__282778182482861308_56737980'
  app/controllers/projects_controller.rb:406:in `show'
tarelli commented 8 years ago

Yep, still on my list.

On Thu, 1 Sep 2016, 15:42 Padraig Gleeson, notifications@github.com wrote:

@tarelli https://github.com/tarelli still getting this error in redmine as you saw when you were here:

Started GET "/projects/acnet2" for 127.0.0.1 at 2016-09-01 15:38:32 +0100 Processing by ProjectsController#show as HTML Parameters: {"id"=>"acnet2"} Current user: padraig (id=4) Rendered projects/_members_box.html.erb (1.4ms) Rendered projects/show.html.erb within layouts/base (49.0ms) Completed 500 Internal Server Error in 76.9ms

ActionView::Template::Error (Mysql2::Error: Expression #1 of ORDER BY clause is not in SELECT list, references column 'redmine.projects.name' which is not in SELECT list; this is incompatible with DISTINCT: SELECT DISTINCT members.id 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 = 4 AND members.project_id = 73 AND (projects.status<>9) ORDER BY projects.name LIMIT 1): 60: <% bbrepo=getCustomField(@project,'Bitbucket repository') %> 61: <% tags=getCustomField(@project,'Tags') %> 62: <% neuroLexIds=getCustomField(@project,'NeuroLex Ids: Cells') %> 63: <% roles = User.current.roles_for_project(@project).collect(&:name) %> 64: <% if (modeldb!=nil and modeldb!="") or (original!=nil and original!="") or (ghrepo!=nil and ghrepo!="") or (bbrepo!=nil and bbrepo!="") or (tags!=nil and tags!='' and tags!=[nil]) or (neuroLexIds!=nil and neuroLexIds!="") or (roles.include? 'Developer' or roles.include? 'Manager' or User.current.admin?) %> 65:

66:
tarelli commented 8 years ago

@pgleeson Trying to reproduce this, what are the exact steps? Does it happen on Comodl?

pgleeson commented 8 years ago

No not on comodl, or on the latest install I have on my laptop. Only the desktop we were working on that fri. Possibly something changed in the local user database? Would you suggest dumping/copying contents of DB from comodl or laptop to my local machine?

tarelli commented 8 years ago

@pgleeson yeah I'd recommend that, probably with all the updates something became inconsistent on the redmine database

pgleeson commented 8 years ago

@tarelli have tried copying the working databases for redmine and geppetto over from my laptop, but the error persists...

pgleeson commented 7 years ago

Have worked around this for now by taking out the call to User.current.roles_for_project() in app/views/projects/show.html.erb. Leaving issue open until I get round to looking more closely at it.