504 Gateway timeout error - my rails site won't run - ruby-on-rails-3

I've set up my rails application to be deployed on a digitalocean droplet using capistrano. However for some odd reason no matter what I do I keep getting a 504 Gateway Timeout nginx error. I've tried restarting unicorn but the error still persists.
I've included here the last 50 lines of the unicorn.log file - what could be the problem here?
/usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/open-uri.rb:29:in `initialize'
/usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/open-uri.rb:29:in `open'
/usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/open-uri.rb:29:in `open'
/usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/open-uri.rb:29:in `open'
/usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/logger.rb:592:in `open_logfile'
/usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/logger.rb:549:in `initialize'
/usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/logger.rb:314:in `new'
/usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/logger.rb:314:in `initialize'
/home/etyme/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/core_ext/logger.rb:72:in `initialize'
/home/etyme/releases/20140120142015/config/environments/development.rb:53:in `new'
/home/etyme/releases/20140120142015/config/environments/development.rb:53:in `block in <top (required)>'
/home/etyme/shared/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:24:in `class_eval'
/home/etyme/shared/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:24:in `configure'
/home/etyme/releases/20140120142015/config/environments/development.rb:1:in `<top (required)>'
/home/etyme/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/home/etyme/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
/home/etyme/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/etyme/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/home/etyme/shared/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/engine.rb:571:in `block in <class:Engine>'
/home/etyme/shared/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec'
/home/etyme/shared/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run'
/home/etyme/shared/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/etyme/shared/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each'
/home/etyme/shared/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers'
/home/etyme/shared/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!'
/home/etyme/shared/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
/home/etyme/releases/20140120142015/config/environment.rb:5:in `<top (required)>'
/usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
config.ru:4:in `block in <main>'
/usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
/usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
config.ru:1:in `new'
config.ru:1:in `<main>'
/usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/gems/1.9.1/gems/unicorn-4.6.3/lib/unicorn.rb:48:in `eval'
/usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/gems/1.9.1/gems/unicorn-4.6.3/lib/unicorn.rb:48:in `block in builder'
/usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/gems/1.9.1/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:722:in `call'
/usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/gems/1.9.1/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:722:in `build_app!'
/usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/gems/1.9.1/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:595:in `init_worker_process'
/usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/gems/1.9.1/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:615:in `worker_loop'
/usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/gems/1.9.1/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:500:in `spawn_missing_workers'
/usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/gems/1.9.1/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:511:in `maintain_worker_count'
/usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/gems/1.9.1/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:277:in `join'
/usr/bin/unicorn:121:in `<main>'
E, [2014-01-21T05:42:51.210093 #30994] ERROR -- : reaped #<Process::Status: pid 31079 exit 1> worker=0
I, [2014-01-21T05:42:51.210263 #30994] INFO -- : worker=0 spawning...
I, [2014-01-21T05:42:51.213421 #31093] INFO -- : worker=0 spawned pid=31093
I, [2014-01-21T05:42:51.228866 #31093] INFO -- : Refreshing Gem list
/usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/gems/1.9.1/gems/bundler-1.5.1/lib/bundler/runtime.rb:220: warning: Insecure world writable dir /home/etyme/releases in PATH, mode 040777
/usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/gems/1.9.1/gems/bundler-1.5.1/lib/bundler/runtime.rb:220: warning: Insecure world writable dir /home/etyme/releases in PATH, mode 040777
This is my nginx conf
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events { worker_connections 1024; }
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable "msie6";
gzip_types text/plain text/xml text/css text/comma-separated-values;
upstream app_server { server 127.0.0.1:8080 fail_timeout=0; }
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}

You're opening an HTTP connection to another site that is timing out. Because that site is not failing, but waiting to properly connect from code within your app, your app request never completes and request to your app now times out.
There are several things you can do to fix this:
Fix your configuration. Perhaps you have the host/port wrong on this connection? You're hitting the wrong place and it's just hanging instead of failing
Set a proper HTTP timeout of 10-20sec on this connection. Fail gracefully when it times out.
Remove this code entirely, since the resource you're trying to use doesn't appear stable

Related

Getting Failure/Error: Puppet::SSL::CertificateAuthority.new in puppet

I built the puppet from source code ,on a solo architecture with both puppet master and agent on the same node , when i run the rspec test cases , i am getting a lot of SSL certs issues , and almost all of the have same failure.
Puppet::Face[:ca, v0.1.0]
Failure/Error: Puppet::SSL::CertificateAuthority.new
Errno::EACCES:
Permission denied # rb_sysopen - /tmp/rspecrun20150617-23070-1ls4i9z/face-ca-ssldir20150617-23070-hwwl9f/ca/ca_key.pem
# ./lib/puppet/file_system/file_impl.rb:26:in `initialize'
# ./lib/puppet/file_system/file_impl.rb:26:in `open'
# ./lib/puppet/file_system/file_impl.rb:26:in `open'
# ./lib/puppet/file_system.rb:37:in `open'
# ./lib/puppet/settings/file_setting.rb:197:in `block in open'
# ./lib/puppet/settings/file_setting.rb:230:in `block (2 levels) in controlled_access'
# ./lib/puppet/util.rb:48:in `withumask'
# ./lib/puppet/settings/file_setting.rb:221:in `block in controlled_access'
# ./lib/puppet/util/suidmanager.rb:72:in `asuser'
# ./lib/puppet/settings/file_setting.rb:219:in `controlled_access'
# ./lib/puppet/settings/file_setting.rb:196:in `open'
# ./lib/puppet/indirector/ssl_file.rb:162:in `write'
# ./lib/puppet/indirector/ssl_file.rb:98:in `save'
# ./lib/puppet/indirector/indirection.rb:276:in `save'
# ./lib/puppet/ssl/host.rb:151:in `generate_key'
# ./lib/puppet/ssl/host.rb:197:in `certificate'
# ./lib/puppet/ssl/certificate_authority.rb:270:in `setup'
# ./lib/puppet/ssl/certificate_authority.rb:161:in `initialize'
# ./spec/integration/faces/ca_spec.rb:20:in `new'
# ./spec/integration/faces/ca_spec.rb:20:in `block (2 levels) in <top (required)>'

No Backtrace on request specs with Rspec

I have a request spec like this
require 'rails_helper'
describe 'People API' do
describe 'GET /api/v1/people/lookup.json?phone_number=PHONE_NUMBER', :wip do
it 'returns a 200 status code' do
auth_get '/api/v1/people/lookup.json', phone_number: '91900199'
expect(response.status).to eq(200)
end
end
end
and if the specs fail for some reason I just get a 500 status code in the response, and that's it, so I have to check the log/test.log file to get to know what went wrong, that is pretty annoying.
Why rspec is not showing the backtrace like in other types of specs?
Here is how I run my specs, notice that I include the -b option
$ rspec -b -t wip -f documentation
Run options: include {:wip=>true}
People API
GET /api/v1/people/lookup.json?phone_number=PHONE_NUMBER
returns a 200 status code
Failures:
1) People API GET /api/v1/people/lookup.json?phone_number=PHONE_NUMBER with an empty phone number returns a empty response
Failure/Error: expect(response.status).to eq(200)
expected: 200
got: 500
(compared using ==)
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-expectations-3.0.1/lib/rspec/expectations/fail_with.rb:30:in `fail_with'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-expectations-3.0.1/lib/rspec/expectations/handler.rb:35:in `handle_failure'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-expectations-3.0.1/lib/rspec/expectations/handler.rb:48:in `handle_matcher'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-expectations-3.0.1/lib/rspec/expectations/expectation_target.rb:54:in `to'
# ./spec/requests/api/v1/people_spec.rb:15:in `block (4 levels) in <top (required)>'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example.rb:148:in `instance_exec'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example.rb:148:in `block in run'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example.rb:210:in `call'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example.rb:210:in `block (2 levels) in <class:Procsy>'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-rails-3.0.1/lib/rspec/rails/adapters.rb:68:in `block (2 levels) in <module:MinitestLifecycleAdapter>'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example.rb:294:in `instance_exec'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example.rb:294:in `instance_exec'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/hooks.rb:430:in `block (2 levels) in run'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example.rb:210:in `call'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example.rb:210:in `block (2 levels) in <class:Procsy>'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/hooks.rb:432:in `run'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/hooks.rb:485:in `run'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example.rb:303:in `with_around_example_hooks'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example.rb:145:in `run'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example_group.rb:494:in `block in run_examples'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example_group.rb:490:in `map'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example_group.rb:490:in `run_examples'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example_group.rb:457:in `run'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example_group.rb:458:in `block in run'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example_group.rb:458:in `map'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example_group.rb:458:in `run'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example_group.rb:458:in `block in run'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example_group.rb:458:in `map'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example_group.rb:458:in `run'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/runner.rb:112:in `block (2 levels) in run_specs'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/runner.rb:112:in `map'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/runner.rb:112:in `block in run_specs'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/reporter.rb:54:in `report'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/runner.rb:108:in `run_specs'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/runner.rb:86:in `run'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/runner.rb:70:in `run'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/runner.rb:38:in `invoke'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/exe/rspec:4:in `<top (required)>'
# /Users/fespinoza/.rbenv/versions/2.1.1/bin/rspec:23:in `load'
# /Users/fespinoza/.rbenv/versions/2.1.1/bin/rspec:23:in `<main>'
Finished in 0.46863 seconds (files took 3.59 seconds to load)
1 examples, 1 failures
but it does not contain the real reason of the 500 error
Your request specs interact with your full stack, including middleware. When an error occurs inside one of your controller methods, it is caught higher up the stack so that a 500 error can be returned to the client. This is what you are seeing in the assertion failure.
You might be able to write your own middleware for testing purposes which prints errors to stderr if you really want this.

500 Error with the latest Gitlab (6.23)

Just backup and reinstall it.
Basic Information:
System information
System: Ubuntu 12.04
Current User: git
Using RVM: no
Ruby Version: 2.0.0p247
Gem Version: 2.0.3
Bundler Version:1.3.5
Rake Version: 10.1.0
GitLab information
Version: 6.2.3
Revision: b490fde
Directory: /home/git/gitlab
DB Adapter: mysql2
URL: https://git.XXXX.org
HTTP Clone URL: https://git.XXXX.org/some-project.git
SSH Clone URL: git#git.XXXX.org:some-project.git
Using LDAP: no
Using Omniauth: no
GitLab Shell
Version: 1.7.6
Repositories: /home/git/repositories/
Hooks: /home/git/gitlab-shell/hooks/
Git: /usr/local/bin/git
If I check status with this command:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
Everything is OK and green.
No error found in Nginx log.
Error log found in gitlab/log/production.log (this error was created every time I refresh the webpage):
Started GET "/" for 127.0.0.1 at 2013-11-12 22:23:24 -0800
Processing by DashboardController#show as HTML
Completed 401 Unauthorized in 5ms
Redis::ProtocolError ( Got 'H' as initial reply byte. If you're in a forking environment, such as Unicorn, you need to connect to Redis after forking. ):
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis/connection/ruby.rb:257:in `format_reply'
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis/connection/ruby.rb:244:in `read'
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis/client.rb:215:in `block in read'
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis/client.rb:206:in `io'
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis/client.rb:214:in `read'
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis/client.rb:84:in `block in call'
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis/client.rb:187:in `block (2 levels) in process'
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis/client.rb:295:in `ensure_connected'
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis/client.rb:177:in `block in process'
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis/client.rb:256:in `logging'
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis/client.rb:176:in `process'
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis/client.rb:84:in `call'
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis.rb:630:in `block in set'
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis.rb:36:in `block in synchronize'
/usr/local/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis.rb:36:in `synchronize'
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis.rb:629:in `set'
vendor/bundle/ruby/2.0.0/gems/redis-store-1.1.4/lib/redis/store/interface.rb:9:in `set'
vendor/bundle/ruby/2.0.0/gems/redis-store-1.1.4/lib/redis/store/ttl.rb:8:in `set'
vendor/bundle/ruby/2.0.0/gems/redis-store-1.1.4/lib/redis/store/marshalling.rb:5:in `block in set'
vendor/bundle/ruby/2.0.0/gems/redis-store-1.1.4/lib/redis/store/marshalling.rb:29:in `_marshal'
vendor/bundle/ruby/2.0.0/gems/redis-store-1.1.4/lib/redis/store/marshalling.rb:5:in `set'
vendor/bundle/ruby/2.0.0/gems/redis-rack-1.4.4/lib/rack/session/redis.rb:31:in `block in get_session'
vendor/bundle/ruby/2.0.0/gems/redis-rack-1.4.4/lib/rack/session/redis.rb:55:in `with_lock'
vendor/bundle/ruby/2.0.0/gems/redis-rack-1.4.4/lib/rack/session/redis.rb:28:in `get_session'
vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:251:in `load_session'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/session/abstract_store.rb:49:in `block in load_session'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/session/abstract_store.rb:57:in `stale_session_check!'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/session/abstract_store.rb:49:in `load_session'
vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:135:in `load!'
vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:131:in `load_for_write!'
vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:71:in `[]='
vendor/bundle/ruby/2.0.0/gems/devise-2.2.5/lib/devise/failure_app.rb:176:in `store_location!'
vendor/bundle/ruby/2.0.0/gems/devise-2.2.5/lib/devise/failure_app.rb:55:in `redirect'
vendor/bundle/ruby/2.0.0/gems/devise-2.2.5/lib/devise/failure_app.rb:37:in `respond'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/abstract_controller/base.rb:167:in `process_action'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/abstract_controller/base.rb:121:in `process'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_controller/metal.rb:203:in `dispatch'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_controller/metal.rb:246:in `block in action'
vendor/bundle/ruby/2.0.0/gems/devise-2.2.5/lib/devise/failure_app.rb:20:in `call'
vendor/bundle/ruby/2.0.0/gems/devise-2.2.5/lib/devise/failure_app.rb:20:in `call'
vendor/bundle/ruby/2.0.0/gems/devise-2.2.5/lib/devise/delegator.rb:5:in `call'
vendor/bundle/ruby/2.0.0/gems/warden-1.2.3/lib/warden/manager.rb:130:in `call_failure_app'
vendor/bundle/ruby/2.0.0/gems/warden-1.2.3/lib/warden/manager.rb:116:in `process_unauthenticated'
vendor/bundle/ruby/2.0.0/gems/warden-1.2.3/lib/warden/manager.rb:47:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/etag.rb:23:in `call'
vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/conditionalget.rb:25:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/head.rb:14:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/flash.rb:242:in `call'
vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:210:in `context'
vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:205:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/cookies.rb:341:in `call'
vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/query_cache.rb:64:in `call'
vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:405:in `_run__1837039011266915719__call__1965958118966391004__callbacks'
vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:405:in `__run_callback'
vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:81:in `run_callbacks'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/rack/logger.rb:32:in `call_app'
vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/rack/logger.rb:16:in `block in call'
vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/tagged_logging.rb:22:in `tagged'
vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/rack/logger.rb:16:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/request_id.rb:22:in `call'
vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:in `call'
vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/runtime.rb:17:in `call'
vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/lock.rb:15:in `call'
vendor/bundle/ruby/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
vendor/bundle/ruby/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:143:in `pass'
vendor/bundle/ruby/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:172:in `rescue in lookup'
vendor/bundle/ruby/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:168:in `lookup'
vendor/bundle/ruby/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'
vendor/bundle/ruby/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/engine.rb:479:in `call'
vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/application.rb:223:in `call'
vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/builder.rb:134:in `call'
vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/urlmap.rb:64:in `block in call'
vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/urlmap.rb:49:in `each'
vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/urlmap.rb:49:in `call'
vendor/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:552:in `process_client'
vendor/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:632:in `worker_loop'
vendor/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:500:in `spawn_missing_workers'
vendor/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:142:in `start'
vendor/bundle/ruby/2.0.0/gems/unicorn-4.6.3/bin/unicorn_rails:209:in `<top (required)>'
vendor/bundle/ruby/2.0.0/bin/unicorn_rails:23:in `load'
vendor/bundle/ruby/2.0.0/bin/unicorn_rails:23:in `<main>'
Dump of /gitlab-shell/config.yml:
# GitLab user. git by default
user: git
# Url to gitlab instance. Used for api calls. Should end with a slash.
gitlab_url: "http://git.XXXX.org/"
http_settings:
# user: someone
# password: somepass
# ca_file: /etc/ssl/certs
# ca_path: /etc/ssl/localcerts
self_signed_cert: false
# Repositories path
# Give the canonicalized absolute pathname,
# REPOS_PATH MUST NOT CONTAIN ANY SYMLINK!!!
# Check twice that none of the components is a symlink, including "/home".
repos_path: "/home/git/repositories"
# File used as authorized_keys for gitlab user
auth_file: "/home/git/.ssh/authorized_keys"
# Redis settings used for pushing commit notices to gitlab
redis:
bin: /usr/bin/redis-cli
host: 127.0.0.1
port: 6379
# socket: /tmp/redis.socket # Only define this if you want to use sockets
namespace: resque:gitlab
# rest of this file remain unchanged.
Nginx Configuration File:
upstream gitlab {
server unix:/home/git/gitlab/tmp/sockets/gitlab.socket;
}
server {
listen 173.230.1.2:80;
server_name git.XXXX.org;
server_tokens off;
root /nowhere; # this doesn't have to be a valid path since we are redirecting, you don't have to change it.
rewrite ^ https://$server_name$request_uri permanent;
}
server {
listen 173.230.1.2:443 ssl; # e.g., listen 192.168.1.1:80; In most cases *:80 is a good idea
server_name git.XXXX.org; # e.g., server_name source.example.com;
server_tokens off; # don't show the version number, a security best practice
root /home/git/gitlab/public;
ssl on;
ssl_certificate /etc/ssl/localcerts/git.XXXX.org.crt;
ssl_certificate_key /etc/ssl/localcerts/git.XXXX.org.key;
ssl_ciphers RC4:HIGH:!aNULL:!MD5:!kEDH;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
# individual nginx logs for this gitlab vhost
access_log /var/log/nginx/gitlab_access.log;
error_log /var/log/nginx/gitlab_error.log;
#rest of this file remain unchanges
Part of Unicorn config file:
working_directory "/home/git/gitlab" # available in 0.94.0+
# listen on both a Unix domain socket and a TCP port,
# we use a shorter backlog for quicker failover when busy
listen "/home/git/gitlab/tmp/sockets/gitlab.socket", :backlog => 64
listen "127.0.0.1:6379", :tcp_nopush => true
It seems unicorn throws a 401 error according to the logs.
Anyone familiar with Gitlab please help me.
By the way, this is my 4th time reinstalling the Gitlab.

Error compiling native support for Phusion Passenger

I'm trying to setup Phusion Passenger for Apache on a Ubuntu 12.04 LTS 64-bit server for a Rails 3.2.13 application.
I can run the Rails application perfectly fine using the Webrick server but whenever I run it under Apache I get a 500 Internal Server error and the Apache error log shows the following,
*** Phusion Passenger: no passenger_native_support.so found for the current Ruby interpreter. Compiling one...
# mkdir -p /buildout/ruby/ruby-1.9.3-x86_64-linux
# cd /buildout/ruby/ruby-1.9.3-x86_64-linux
*** Phusion Passenger: no passenger_native_support.so found for the current Ruby interpreter. Compiling one...
# mkdir -p /buildout/ruby/ruby-1.9.3-x86_64-linux
# cd /buildout/ruby/ruby-1.9.3-x86_64-linux
/var/lib/gems/1.9.1/gems/passenger-4.0.10/lib/phusion_passenger/native_support.rb:67:in `join': can't convert nil into String (TypeError)
from /var/lib/gems/1.9.1/gems/passenger-4.0.10/lib/phusion_passenger/native_support.rb:67:in `extconf_rb'
from /var/lib/gems/1.9.1/gems/passenger-4.0.10/lib/phusion_passenger/native_support.rb:178:in `block (2 levels) in compile'
from /var/lib/gems/1.9.1/gems/passenger-4.0.10/lib/phusion_passenger/native_support.rb:176:in `chdir'
from /var/lib/gems/1.9.1/gems/passenger-4.0.10/lib/phusion_passenger/native_support.rb:176:in `block in compile'
from /var/lib/gems/1.9.1/gems/passenger-4.0.10/lib/phusion_passenger/native_support.rb:170:in `each'
from /var/lib/gems/1.9.1/gems/passenger-4.0.10/lib/phusion_passenger/native_support.rb:170:in `each_with_index'
from /var/lib/gems/1.9.1/gems/passenger-4.0.10/lib/phusion_passenger/native_support.rb:170:in `compile'
from /var/lib/gems/1.9.1/gems/passenger-4.0.10/lib/phusion_passenger/native_support.rb:140:in `compile_and_load'
from /var/lib/gems/1.9.1/gems/passenger-4.0.10/lib/phusion_passenger/native_support.rb:37:in `start'
from /var/lib/gems/1.9.1/gems/passenger-4.0.10/lib/phusion_passenger/native_support.rb:228:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /var/lib/gems/1.9.1/gems/passenger-4.0.10/lib/phusion_passenger/utils.rb:26:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/share/phusion-passenger/helper-scripts/passenger-spawn-server:102:in `rescue in <main>'
from /usr/share/phusion-passenger/helper-scripts/passenger-spawn-server:30:in `<main>'
*** Phusion Passenger: no passenger_native_support.so found for the current Ruby interpreter. Compiling one...
# mkdir -p /buildout/ruby/ruby-1.9.3-x86_64-linux
# cd /buildout/ruby/ruby-1.9.3-x86_64-linux
*** Phusion Passenger: no passenger_native_support.so found for the current Ruby interpreter. Compiling one...
# mkdir -p /buildout/ruby/ruby-1.9.3-x86_64-linux
# cd /buildout/ruby/ruby-1.9.3-x86_64-linux
/var/lib/gems/1.9.1/gems/passenger-4.0.10/lib/phusion_passenger/native_support.rb:67:in `join': can't convert nil into String (TypeError)
from /var/lib/gems/1.9.1/gems/passenger-4.0.10/lib/phusion_passenger/native_support.rb:67:in `extconf_rb'
from /var/lib/gems/1.9.1/gems/passenger-4.0.10/lib/phusion_passenger/native_support.rb:178:in `block (2 levels) in compile'
from /var/lib/gems/1.9.1/gems/passenger-4.0.10/lib/phusion_passenger/native_support.rb:176:in `chdir'
from /var/lib/gems/1.9.1/gems/passenger-4.0.10/lib/phusion_passenger/native_support.rb:176:in `block in compile'
from /var/lib/gems/1.9.1/gems/passenger-4.0.10/lib/phusion_passenger/native_support.rb:170:in `each'
from /var/lib/gems/1.9.1/gems/passenger-4.0.10/lib/phusion_passenger/native_support.rb:170:in `each_with_index'
from /var/lib/gems/1.9.1/gems/passenger-4.0.10/lib/phusion_passenger/native_support.rb:170:in `compile'
from /var/lib/gems/1.9.1/gems/passenger-4.0.10/lib/phusion_passenger/native_support.rb:140:in `compile_and_load'
from /var/lib/gems/1.9.1/gems/passenger-4.0.10/lib/phusion_passenger/native_support.rb:37:in `start'
from /var/lib/gems/1.9.1/gems/passenger-4.0.10/lib/phusion_passenger/native_support.rb:228:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /var/lib/gems/1.9.1/gems/passenger-4.0.10/lib/phusion_passenger/utils.rb:26:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/share/phusion-passenger/helper-scripts/passenger-spawn-server:102:in `rescue in <main>'
from /usr/share/phusion-passenger/helper-scripts/passenger-spawn-server:30:in `<main>'
[ pid=2036 thr=140218616461056 file=ext/apache2/Hooks.cpp:884 time=2013-08-05 12:42:29.716 ]: Unexpected error in mod_passenger: Cannot spawn application '/home/cms/sandbox': Could not read from the spawn server: Connection reset by peer (104)
Backtrace:
(empty)
I've checked the line in the source code and its referring to a ruby_extension_source_dir. I presume its something wrong with my config somewhere but I've checked the paths for Passenger using the passenger-config tool and they are correct (the relevant Apache config is below),
<IfModule mod_passenger.c>
PassengerRoot /var/lib/gems/1.9.1/gems/passenger-4.0.10
PassengerRuby /usr/bin/ruby1.9.1
</IfModule>

Problems Deploying a rails app to Heroku

I am having problems deploying a Rails app to Heroku, I can't even run the Heroku console! (see below for the response I get from terminal)
I'm pretty new to rails and programming in general, so I don't really understand what the problem is here, would really appreciate some assistance!
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:239:in `require': /app/config/environments/production.rb:3: unknown regexp options - lcal (SyntaxError)
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:239:in `block in require'
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:225:in `block in load_dependency'
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:596:in `new_constants_in'
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:225:in `load_dependency'
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:239:in `require'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.0.8/lib/rails/application/bootstrap.rb:11:in `block in <module:Bootstrap>'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.0.8/lib/rails/initializable.rb:25:in `instance_exec'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.0.8/lib/rails/initializable.rb:25:in `run'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.0.8/lib/rails/initializable.rb:50:in `block in run_initializers'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.0.8/lib/rails/initializable.rb:49:in `each'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.0.8/lib/rails/initializable.rb:49:in `run_initializers'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.0.8/lib/rails/application.rb:134:in `initialize!'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.0.8/lib/rails/application.rb:77:in `method_missing'
from /app/config/environment.rb:7:in `<top (required)>'
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:239:in `require'
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:239:in `block in require'
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:225:in `block in load_dependency'
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:596:in `new_constants_in'
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:225:in `load_dependency'
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:239:in `require'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.0.8/lib/rails/application.rb:103:in `require_environment!'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.0.8/lib/rails/commands.rb:22:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Here is config/environments./production.rb, I commented out line 3 as I thought that might be the issue, but I get the same problem whether it's commented, uncommented or deleted completely!
Pingpong::Application.configure do
# /opt/local/bin/convert
# Settings specified here will take precedence over those in config/application.rb
# The production environment is meant for finished, "live" apps.
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Specifies the header that your server uses for sending files
config.action_dispatch.x_sendfile_header = "X-Sendfile"
# For nginx:
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
# If you have no front-end server that supports something like X-Sendfile,
# just comment this out and Rails will serve the files
# See everything in the log (default is :info)
# config.log_level = :debug
# Use a different logger for distributed setups
# config.logger = SyslogLogger.new
# Use a different cache store in production
# config.cache_store = :mem_cache_store
# Disable Rails's static asset server
# In production, Apache or nginx will already do this
config.serve_static_assets = false
# Enable serving of images, stylesheets, and javascripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"
# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.raise_delivery_errors = false
# Enable threaded mode
# config.threadsafe!
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation can not be found)
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify
end
/app/config/environment
# Load the rails application
require File.expand_path('../application', __FILE__)
# Initialize the rails application
Pingpong::Application.initialize!
The problem is line 3. Make sure you have committed your changes and then push them to Heroku.