我已经建立了一个新的Redmine 2.5.1安装于Ubuntu 12.04使用 apache2 和 Passenger 按照以下步骤操作:http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_Ubuntu_step_by_step
此后我
- 转储现有 Redmine 1.1.3.stable 安装的 mysql 数据库,
- 将其还原到我的新服务器上的新数据库,
- 将附件从旧服务器复制到新服务器 /usr/share/redmine/文件(+修改权限 755)
- 告诉redmine在数据库配置中使用我以前导入的票证和新创建的数据库。
- 将目录更改为 /usr/share/redmine 并触发此操作
rake db:migrate RAILS_ENV=production rake generate_secret_token
到目前为止一切顺利。可以在浏览器中查看 Redmine,可以在那里更改管理设置和项目。
但是,如果我尝试创建新票据或查看旧票据,则会收到错误 500。此外,Redmine 给我的版本是 1.1.3,但应该是 2.5.1。看来我可能忘了运行迁移脚本。
查找我创建的错误
- /usr/share/redmine/log/production.log
- chmod 755 生产.log
- 改变了我的 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
答案1
可以通过为 tmp 目录赋予 chmod 755 来解决该问题