Project

General

Profile

[PLEASE HELP] activitiy mysql error

Added by Christopher Köhnen about 12 years ago

Hi,

I upgraded from redmine 1.4.4 to 2.1. When I click on activity in redmine I now receive an Internal Server Error. In the ./log/production.log I read:

------------------------------------------------
Started GET "/redmine/projects/semanticweb/activity" for 192.168.64.130 at 2012-11-05 14:31:42 +0300
Processing by ActivitiesController#index as HTML
Parameters: {"id"=>"semanticweb"}
Current user: ckoehnen (id=3)
Completed 500 Internal Server Error in 433ms

ActiveRecord::StatementInvalid (Mysql2::Error: Unknown column 'projects.id' in 'where clause': SELECT `attachments`.* FROM `attachments` WHERE (attachments.created_on BETWEEN '2011-11-07' AND '2012-11-06') AND ((projects.id = 5 OR (projects.lft > 11 AND projects.rgt < 12)) AND (projects.status <> 9 AND projects.id IN (SELECT em.project_id FROM enabled_modules em WHERE em.name='documents')))):
lib/redmine/activity/fetcher.rb:76:in `block (2 levels) in events'
lib/redmine/activity/fetcher.rb:75:in `each'
lib/redmine/activity/fetcher.rb:75:in `block in events'
lib/redmine/activity/fetcher.rb:74:in `each'
lib/redmine/activity/fetcher.rb:74:in `events'
app/controllers/activities_controller.rb:41:in `index'


I already migrated the database using the rake command.

My setup is a Ubuntu 10.0.4 LTS with apache2/passenger
Environment:
Redmine version 2.1.2.stable
Ruby version 1.9.3 (i686-linux)
Rails version 3.2.8
Environment production
Database adapter Mysql2

Does anybody have a suggestion how to fix this issue or a hint where to start?

Kind regards
Christopher


Replies (1)

RE: activitiy mysql error - Added by Christopher Köhnen about 12 years ago

OK, I figured out, that the mysql command is wrong. It would work if it sounds:

SELECT `attachments`.* FROM `attachments`,`projects` WHERE (attachments.created_on BETWEEN '2011-11-07' AND '2012-11-06') AND ((projects.id = 6 OR (projects.lft > 9 AND projects.rgt < 10)) AND (projects.status <> 9 AND projects.id IN (SELECT em.project_id FROM enabled_modules em WHERE em.name='documents')));

The problem is the missing `projects` statement in the FROM-part of the query.

As I'm inexperienced with ruby on rails/redmine implementaion, please point me to the file where the query is constructed.

Kind regards
Christopher

    (1-1/1)