我已经在Ubuntu 12.04上安装了一个新的Redmine 2.5.1安装,使用 apache2 和乘客遵循以下方法:http ://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_Ubuntu_step_by_step
在那之后我已经
- 转储了现有 Redmine 1.1.3.stable 安装的 mysql 数据库,
- 将其还原到我的新服务器上的新数据库,
- 将附件从旧服务器复制到新服务器到 /usr/share/redmine/files (+ chmod 755)
- 告诉 redmine 将新创建的数据库与我在数据库配置中导入的旧票证一起使用。
- 将 dir 更改为 /usr/share/redmine 并触发此操作
rake db:migrate RAILS_ENV=production rake generate_secret_token
到目前为止,一切都很好。Redmine 可以在浏览器中查看,管理设置可以在 Projects 中更改。
但是,如果我尝试创建新票证或查看旧票证,我会收到错误 500。此外,Redmine 给了我版本 1.1.3,但应该是 2.5.1。看来我可能忘记运行迁移脚本了。
找到我创建的错误
- /usr/share/redmine/log/production.log
- chmod 755 生产日志
- 更改了我的 apache2 配置中的错误处理
LogFormat "%h %l %u %t \"%r\" %>s %b" common LogLevel WARN ErrorLog "/var/log/apache2/redmine-error.log" CustomLog "/var/log/apache2/redmine-access.log" common
但我在 production.log、redmine-error.log、error.log 中看不到任何错误!?
如何解决错误 500 问题?
更新我处理让日志记录运行。这是日志输出:
ActiveRecord::StatementInvalid (Mysql::Error: Unknown column 'author' in 'where clause': SELECT * FROM `workflows` WHERE (`workflows`.old_status_id = 1 AND (role_id IN (1) AND tracker_id = 1 AND ((author = 0 AND assignee = 0) OR author = 1))) ):
/usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract_adapter.rb:227:in `log'
/usr/lib/ruby/vendor_ruby/active_record/connection_adapters/mysql_adapter.rb:324:in `execute'
/usr/lib/ruby/vendor_ruby/active_record/connection_adapters/mysql_adapter.rb:639:in `select'
/usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/database_statements.rb:7:in `select_all_without_query_cache'
/usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/query_cache.rb:60:in `select_all'
/usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/query_cache.rb:81:in `cache_sql'
/usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/query_cache.rb:60:in `select_all'
/usr/lib/ruby/vendor_ruby/active_record/base.rb:665:in `find_by_sql'
/usr/lib/ruby/vendor_ruby/active_record/base.rb:1582:in `find_every'
/usr/lib/ruby/vendor_ruby/active_record/base.rb:619:in `find'
/usr/lib/ruby/vendor_ruby/active_record/associations/association_collection.rb:60:in `find'
app/models/issue_status.rb:78:in `find_new_statuses_allowed_to'
/usr/lib/ruby/vendor_ruby/active_record/associations/association_proxy.rb:215:in `send'
/usr/lib/ruby/vendor_ruby/active_record/associations/association_proxy.rb:215:in `method_missing'
app/models/issue.rb:471:in `new_statuses_allowed_to'
app/controllers/issues_controller.rb:325:in `build_new_issue_from_params'
/usr/lib/ruby/vendor_ruby/active_support/callbacks.rb:178:in `send'
/usr/lib/ruby/vendor_ruby/active_support/callbacks.rb:178:in `evaluate_method'
/usr/lib/ruby/vendor_ruby/active_support/callbacks.rb:166:in `call'
/usr/lib/ruby/vendor_ruby/action_controller/filters.rb:225:in `call'
/usr/lib/ruby/vendor_ruby/action_controller/filters.rb:629:in `run_before_filters'
/usr/lib/ruby/vendor_ruby/action_controller/filters.rb:615:in `call_filters'
/usr/lib/ruby/vendor_ruby/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/usr/lib/ruby/vendor_ruby/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/usr/lib/ruby/vendor_ruby/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/usr/lib/ruby/vendor_ruby/action_controller/rescue.rb:160:in `perform_action_without_flash'
/usr/lib/ruby/vendor_ruby/action_controller/flash.rb:151:in `perform_action'
/usr/lib/ruby/vendor_ruby/action_controller/base.rb:532:in `send'
/usr/lib/ruby/vendor_ruby/action_controller/base.rb:532:in `process_without_filters'
/usr/lib/ruby/vendor_ruby/action_controller/filters.rb:606:in `process'
/usr/lib/ruby/vendor_ruby/action_controller/base.rb:391:in `process'
/usr/lib/ruby/vendor_ruby/action_controller/base.rb:386:in `call'
/usr/lib/ruby/vendor_ruby/action_controller/routing/route_set.rb:438:in `call'
/usr/lib/ruby/vendor_ruby/action_controller/dispatcher.rb:87:in `dispatch'
/usr/lib/ruby/vendor_ruby/action_controller/dispatcher.rb:121:in `_call'
/usr/lib/ruby/vendor_ruby/action_controller/dispatcher.rb:130:in `build_middleware_stack'
/usr/lib/ruby/vendor_ruby/active_record/query_cache.rb:29:in `call'
/usr/lib/ruby/vendor_ruby/active_record/query_cache.rb:29:in `call'
/usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/usr/lib/ruby/vendor_ruby/active_record/query_cache.rb:9:in `cache'
/usr/lib/ruby/vendor_ruby/active_record/query_cache.rb:28:in `call'
/usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/usr/lib/ruby/vendor_ruby/action_controller/string_coercion.rb:25:in `call'
/usr/lib/ruby/vendor_ruby/rack/head.rb:9:in `call'
/usr/lib/ruby/vendor_ruby/rack/methodoverride.rb:24:in `call'
/usr/lib/ruby/vendor_ruby/action_controller/params_parser.rb:15:in `call'
/usr/lib/ruby/vendor_ruby/action_controller/session/cookie_store.rb:99:in `call'
/usr/lib/ruby/vendor_ruby/action_controller/failsafe.rb:26:in `call'
/usr/lib/ruby/vendor_ruby/rack/lock.rb:15:in `call'
/usr/lib/ruby/vendor_ruby/action_controller/dispatcher.rb:106:in `call'
/usr/lib/ruby/1.8/phusion_passenger/rack/request_handler.rb:92:in `process_request'
/usr/lib/ruby/1.8/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
/usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:418:in `start_request_handler'
/usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:358:in `handle_spawn_application'
/usr/lib/ruby/1.8/phusion_passenger/utils.rb:184:in `safe_fork'
/usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:354:in `handle_spawn_application'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `__send__'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `main_loop'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:163:in `start'
/usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:213:in `start'
/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'
/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:154:in `spawn_application'
/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `__send__'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `main_loop'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
/usr/lib/phusion_passenger/passenger-spawn-server:61
这个问题可以通过给 tmp dir chmod 755 来解决