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.
Related
I am trying to deploy my Rails4 app locally(I just want to it run on my Mac). I use Passenger and Apache for deployment. After some configuration, my home page works fine. But when I click any links on my homepage or go to any other path, I got this error:
The page you were looking for doesn't exist.
So I added this line to my httpd.conf file in apache
RailsEnv development
And now I got this error:
No route matches [GET] "/Users/joey/Sites/index.html"
No route matches [POST] "/Users/joey/Sites/index.html" (If I make a post request)
My project directory is "/Users/joey/Sites/depot" and this is my httpd.conf file:
<VirtualHost *:80>
ServerName depot.joeyhu.info
DocumentRoot /Users/joey/Sites/depot/public/
RailsEnv development
<Directory /Users/joey/Sites/depot/public>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
LoadModule passenger_module /Users/joey/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/passenger-4.0.50/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /Users/joey/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/passenger-4.0.50
PassengerDefaultRuby /Users/joey/.rbenv/versions/2.1.0/bin/ruby
</IfModule>
This is my rails log(development.log and production.log basically show the same error):
I, [2014-09-12T10:31:17.300176 #41946] INFO -- : Started GET "/Users/joey/Sites/index.html" for 127.0.0.1 at 2014-09-12 10:31:17 -0700
F, [2014-09-12T10:31:17.300964 #41946] FATAL -- :
ActionController::RoutingError (No route matches [GET] "/Users/joey/Sites/index.html"):
actionpack (4.1.2) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
actionpack (4.1.2) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.1.2) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.1.2) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.1.2) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.1.2) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.1.2) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.1.2) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.1.2) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.1.2) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
railties (4.1.2) lib/rails/engine.rb:514:in `call'
railties (4.1.2) lib/rails/application.rb:144:in `call'
passenger (4.0.50) lib/phusion_passenger/rack/thread_handler_extension.rb:74:in `process_request'
passenger (4.0.50) lib/phusion_passenger/request_handler/thread_handler.rb:141:in `accept_and_process_next_request'
passenger (4.0.50) lib/phusion_passenger/request_handler/thread_handler.rb:109:in `main_loop'
passenger (4.0.50) lib/phusion_passenger/request_handler.rb:455:in `block (3 levels) in start_threads'
Except the root_url, it loooks like whatever path I go to, it will make a get or post request to the URL "/Users/joey/Sites/index.html" which doesn't make sense. Can someone help me? Thanks!
I am using Rails 4.1.2.
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
None of my tests have an error, except the one I'm adding with js => true. Oddly enough the test would pass if not for a routing error.
My test:
context 'Javascript', :js => true do
visit careers_path
page.should have_content("Your Recommendations")
end
I can actual puts page.body and see that the content is there, but it still comes up with this routing error. I notice that while running the actual server and it comes up with a GET request for the assets folder. I don't understand why or what is doing this, but it seems to be the cause of failure.
The errors:
While running rails s
Started GET "/assets/" for 127.0.0.1 at 2013-08-12 19:11:02 -0400
Served asset / - 404 Not Found (5ms)
While running rspec
Failure/Error: Unable to find matching line from backtrace
ActionController::RoutingError:
No route matches [GET] "/assets"
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/actionpack-3.2.14/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/actionpack-3.2.14/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/railties-3.2.14/lib/rails/rack/logger.rb:32:in `call_app'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/railties-3.2.14/lib/rails/rack/logger.rb:16:in `block in call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/activesupport-3.2.14/lib/active_support/tagged_logging.rb:22:in `tagged'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/railties-3.2.14/lib/rails/rack/logger.rb:16:in `call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/actionpack-3.2.14/lib/action_dispatch/middleware/request_id.rb:22:in `call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:in `call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/rack-1.4.5/lib/rack/runtime.rb:17:in `call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/activesupport-3.2.14/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/rack-1.4.5/lib/rack/lock.rb:15:in `call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/actionpack-3.2.14/lib/action_dispatch/middleware/static.rb:63:in `call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/railties-3.2.14/lib/rails/engine.rb:484:in `call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/railties-3.2.14/lib/rails/application.rb:231:in `call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/rack-1.4.5/lib/rack/builder.rb:134:in `call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/rack-1.4.5/lib/rack/urlmap.rb:64:in `block in call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/rack-1.4.5/lib/rack/urlmap.rb:49:in `each'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/rack-1.4.5/lib/rack/urlmap.rb:49:in `call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/capybara-2.1.0/lib/capybara/server.rb:19:in `call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/rack-1.4.5/lib/rack/handler/webrick.rb:59:in `service'
# /Users/tom/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
# /Users/tom/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
# /Users/tom/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
On a side note, adding config.action_dispatch.show_exceptions = true to config/environments/test.rb allows the test to pass, it does not explain why it is happening, it merely suppresses the warning
I was using my server yesterday no problem. Came back today with an error when starting the server
runnerw.exe C:\Ruby187\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) "C:/Users/Stefan/RubymineProjects/gallery/gallery-app/script/rails" server -b 127.0.0.1 -p 3000 -e development
=> Booting WEBrick
=> Rails 3.2.8 application starting in development on http://127.0.0.1:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
C:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:278:in `eval_block': C:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:1508: syntax error, unexpected kEND, expecting $end (SyntaxError)
from C:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:297:in `clear!'
from C:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:297:in `each'
from C:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:297:in `clear!'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:35:in `clear!'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:33:in `each'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:33:in `clear!'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:15:in `reload!'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:26:in `updater'
from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.2.8/lib/active_support/file_update_checker.rb:78:in `call'
from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.2.8/lib/active_support/file_update_checker.rb:78:in `execute'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:27:in `updater'
from C:0:in `execute_if_updated'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.2.8/lib/rails/application/finisher.rb:66
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `instance_exec'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `run'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.2.8/lib/rails/initializable.rb:55:in `run_initializers'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `each'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `run_initializers'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.2.8/lib/rails/application.rb:136:in `initialize!'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `send'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
from C:/Users/Stefan/RubymineProjects/gallery/gallery-app/config/environment.rb:5
from C:/Users/Stefan/RubymineProjects/gallery/gallery-app/config.ru:4:in `require'
from C:/Users/Stefan/RubymineProjects/gallery/gallery-app/config.ru:4
from C:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
from C:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
from C:/Users/Stefan/RubymineProjects/gallery/gallery-app/config.ru:1:in `new'
from C:/Users/Stefan/RubymineProjects/gallery/gallery-app/config.ru:1
Process finished with exit code 1
Not sure what could be causing this and it's baffling me why its only now decided to pop up.
I was able to fix this by reinstalling the actionpack gem. It must have got corrupt or I accidently changed it between last night and today.
Just start with rails and Linux a few days a go...
I want to deploy to heroku and one of there best practice is to user postgresql in local environment too anyway... I followed one of there tutorials and created a sample application
the pg gem installed. bundle install works ok. rake db:migrate works and created the table for my application. but... when i try to run my rails page it gives this error:
ActiveRecord::ConnectionNotEstablished
This is the end of the full trace:
> activerecord (3.2.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:398:in `retrieve_connection'
activerecord (3.2.3) lib/active_record/connection_adapters/abstract/connection_specification.rb:168:in `retrieve_connection'
activerecord (3.2.3) lib/active_record/connection_adapters/abstract/connection_specification.rb:142:in `connection'
activerecord (3.2.3) lib/active_record/query_cache.rb:67:in `rescue in call'
activerecord (3.2.3) lib/active_record/query_cache.rb:61:in `call'
activerecord (3.2.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:467:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.3) lib/active_support/callbacks.rb:405:in `_run__4423031206660944571__call__1711406629982304701__callbacks'
activesupport (3.2.3) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.3) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.3) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.3) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/reloader.rb:65:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
i am using pgadmin 3 to see my db. i created a user named schaller which is the same as my user in Ubuntu
my database.yml file:
development:
adapter: postgresql
database: rails
encoding: unicode
username: schaller
password: password123
host: localhost
pool: 5
what else can i check in order for rails to connect to postgres?
edit:
error when starting the rails server in netbeans on webrick
Started GET "/gangs/" for 127.0.0.1 at 2012-09-13 23:12:31 +0300
ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished):
activerecord (3.2.3) lib/active_record/connection_adapters/abstract /connection_pool.rb:398:in retrieve_connection'
activerecord (3.2.3) lib/active_record/connection_adapters/abstract /connection_specification.rb:168:inretrieve_connection'
activerecord (3.2.3) lib/active_record/connection_adapters/abstract /connection_specification.rb:142:in connection'
activerecord (3.2.3) lib/active_record/query_cache.rb:67:inrescue in call'
...
edit the main stuff in my gem file:
gem 'rails', '3.2.3'
gem 'pg'
gem 'thin'
edit:
adding logs for the postgresql connections
[local]
2012-09-15 18:05:35 IDT LOG: connection received: host=127.0.0.1 port=44038
2012-09-15 18:05:35 IDT LOG: connection authorized: user=schaller database=postgres
2012-09-15 18:05:35 IDT LOG: connection received: host=127.0.0.1 port=44039
2012-09-15 18:05:35 IDT LOG: connection authorized: user=schaller database=rails
2012-09-15 18:07:26 IDT LOG: connection received: host=127.0.0.1 port=44048
2012-09-15 18:07:26 IDT LOG: connection authorized: user=schaller database=rails
anyway i see logs being written when i connect with pgadmin 3 and when i run the command, 'rake db:migrate' but not when i run my rails app...
thanks
OK so its been a few days.. i read all answers and comments again because i really needed a solution anyway! the comment left by #Muhammad Sannan did the trick. i am new to rails so i didn't know what an adapter is.. but after a quick google search i ran this command:
gem install activerecord-postgresql-adapter
and that did the trick :)
everything is working now. i just don't understand how db:migrate worked without this adapter..
I think the problem is with your database.yml. You missed production section which is as I think the mode you are using on heroku. Simply add
production:
adapter: postgresql
database: rails
encoding: unicode
username: schaller
password: password123
host: localhost
pool: 5
to your database.yml on heroku
Well, if you can see the db in pgadmin you know the basic connection details are correct. If you've not tinkered in pgadmin, it's unlikely that the port number or other details have changed either.
So - we need to find out what's going on. First step is to turn connection logging on in PostgreSQL and see whether rails is actually connecting. Set log_connections on and restart PG then see what happens. If you don't see anything in the logs, but do from pgadmin then rails isn't seeing the right connection settings.
http://www.postgresql.org/docs/current/static/runtime-config-logging.html#GUC-LOG-CONNECTIONS