Search code examples
redminethin

Thin Server Permission and Daemonizing Problems


I'm trying to deploy Redmine 2.x via Thin and have run into a couple of different problems. The first is, when testing via webrick I can successfully navigate Redmine anonymously. I can even login, however after submitting the form I receive an application error. Here is the production.log relevant parts:

Successful authentication for 'admin' from 97.79.126.223 at Fri Feb 01 00:14:04 UTC 2013
Redirected to http://54.235.144.11:3000/
Completed 302 Found in 67ms (ActiveRecord: 37.3ms)

NoMethodError (undefined method `options' for {:ctime=>1359677644, :user_id=>1, :atime=>1359677644}:Hash):
rack (1.5.1) lib/rack/session/abstract/id.rb:321:in `commit_session'
rack (1.5.1) lib/rack/session/abstract/id.rb:218:in `context'
rack (1.5.1) lib/rack/session/abstract/id.rb:212:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/cookies.rb:341:in `call'
activerecord (3.2.11) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.2.11) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/callbacks.rb:28:in `call'
activesupport (3.2.11) lib/active_support/callbacks.rb:405:in `_run__750860825__call__4__callbacks'
activesupport (3.2.11) lib/active_support/callbacks.rb:405:in `send'
activesupport (3.2.11) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.11) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.11) lib/active_support/callbacks.rb:81:in `send'
activesupport (3.2.11) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.11) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.11) lib/rails/rack/logger.rb:32:in `call_app'
railties (3.2.11) lib/rails/rack/logger.rb:16:in `call'
activesupport (3.2.11) lib/active_support/tagged_logging.rb:22:in `tagged'
railties (3.2.11) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.5.1) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.1) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.11) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.5.1) lib/rack/lock.rb:17:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/static.rb:62:in `call'
rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
rack-cache (1.2) lib/rack/cache/context.rb:143:in `pass'
rack-cache (1.2) lib/rack/cache/context.rb:155:in `invalidate'
rack-cache (1.2) lib/rack/cache/context.rb:71:in `call!'
rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
railties (3.2.11) lib/rails/engine.rb:479:in `call'
railties (3.2.11) lib/rails/application.rb:223:in `call'
rack (1.5.1) lib/rack/content_length.rb:14:in `call'
railties (3.2.11) lib/rails/rack/log_tailer.rb:17:in `call'
rack (1.5.1) lib/rack/handler/webrick.rb:60:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
rack (1.5.1) lib/rack/handler/webrick.rb:14:in `run'
rack (1.5.1) lib/rack/server.rb:264:in `start'
railties (3.2.11) lib/rails/commands/server.rb:70:in `start'
railties (3.2.11) lib/rails/commands.rb:55
railties (3.2.11) lib/rails/commands.rb:50:in `tap'
railties (3.2.11) lib/rails/commands.rb:50
script/rails:6:in `require'
script/rails:6

I've received this error both deploying with Thin and Webrick. I've never encountered this error with redmine before, regardless of how it is deployed.

The other problem I'm facing is how to start the thin servers. When I'm in the Rails directory and supply sudo thin start Thin successfully starts, however, if I try to start thin via sudo /etc/init.d/thin start I get this lovely error

>> Exiting!
/usr/lib64/ruby/gems/1.8/gems/eventmachine-1.0.0/lib/eventmachine.rb:528:in `start_unix_server': no unix-domain acceptor (RuntimeError)
    from /usr/lib64/ruby/gems/1.8/gems/eventmachine-1.0.0/lib/eventmachine.rb:528:in `start_server'
    from /usr/lib64/ruby/gems/1.8/gems/eventmachine-1.0.0/lib/eventmachine.rb:548:in `start_unix_domain_server'
    from /usr/lib64/ruby/gems/1.8/gems/thin-1.5.0/lib/thin/backends/unix_server.rb:19:in `connect'
    from /usr/lib64/ruby/gems/1.8/gems/thin-1.5.0/lib/thin/backends/base.rb:55:in `start'
    from /usr/lib64/ruby/gems/1.8/gems/eventmachine-1.0.0/lib/eventmachine.rb:187:in `call'
    from /usr/lib64/ruby/gems/1.8/gems/eventmachine-1.0.0/lib/eventmachine.rb:187:in `run_machine'
    from /usr/lib64/ruby/gems/1.8/gems/eventmachine-1.0.0/lib/eventmachine.rb:187:in `run'
    from /usr/lib64/ruby/gems/1.8/gems/thin-1.5.0/lib/thin/backends/base.rb:63:in `start'
    from /usr/lib64/ruby/gems/1.8/gems/thin-1.5.0/lib/thin/server.rb:159:in `start'
    from /usr/lib64/ruby/gems/1.8/gems/thin-1.5.0/lib/thin/controllers/controller.rb:86:in `start'
    from /usr/lib64/ruby/gems/1.8/gems/thin-1.5.0/lib/thin/runner.rb:187:in `send'
    from /usr/lib64/ruby/gems/1.8/gems/thin-1.5.0/lib/thin/runner.rb:187:in `run_command'
    from /usr/lib64/ruby/gems/1.8/gems/thin-1.5.0/lib/thin/runner.rb:152:in `run!'
    from /usr/lib64/ruby/gems/1.8/gems/thin-1.5.0/bin/thin:6
    from /usr/bin/thin:19:in `load'
    from /usr/bin/thin:19

Here is my redmine.yml thin config file

servers: 3
chdir: /www/redmine.guidelinecentral.com
user: apache
log: /var/log/thin/redmine.log
daemonize: true
pid: /var/run/thin/redmine.pid
group: apahce
require: []

timeout: 30
wait: 30
max_persistent_conns: 100
socket: /var/run/redmine/sockets/thin.sock
max_conns: 1024
environment: production

Solution

  • I was not able to solve this issue and ended up doing a reinstall of both Thin and Redmine. I think there was a bad gem somewhere.