I cant figure out whats wrong with Unicorn, it doesnt want to start up. Any help is appreciated
ubuntu#ip-172-31-15-195:~/www/tf/current$ RAILS_ENV=production bundle exec unicorn_rails -c config/unicorn.rb -D
bundler: failed to load command: unicorn_rails (/home/ubuntu/www/tf/shared/bundle/ruby/2.3.0/bin/unicorn_rails)
Errno::EEXIST: File exists # dir_s_mkdir - tmp/pids
/usr/local/lib/ruby/2.3.0/fileutils.rb:254:in `mkdir'
/usr/local/lib/ruby/2.3.0/fileutils.rb:254:in `fu_mkdir'
/usr/local/lib/ruby/2.3.0/fileutils.rb:228:in `block (2 levels) in mkdir_p'
/usr/local/lib/ruby/2.3.0/fileutils.rb:226:in `reverse_each'
/usr/local/lib/ruby/2.3.0/fileutils.rb:226:in `block in mkdir_p'
/usr/local/lib/ruby/2.3.0/fileutils.rb:211:in `each'
/usr/local/lib/ruby/2.3.0/fileutils.rb:211:in `mkdir_p'
/home/ubuntu/www/tf/shared/bundle/ruby/2.3.0/gems/unicorn-5.0.1/bin/unicorn_rails:202:in `block in <top (required)>'
/home/ubuntu/www/tf/shared/bundle/ruby/2.3.0/gems/unicorn-5.0.1/lib/unicorn/configurator.rb:80:in `reload'
/home/ubuntu/www/tf/shared/bundle/ruby/2.3.0/gems/unicorn-5.0.1/lib/unicorn/configurator.rb:65:in `initialize'
/home/ubuntu/www/tf/shared/bundle/ruby/2.3.0/gems/unicorn-5.0.1/lib/unicorn/http_server.rb:76:in `new'
/home/ubuntu/www/tf/shared/bundle/ruby/2.3.0/gems/unicorn-5.0.1/lib/unicorn/http_server.rb:76:in `initialize'
/home/ubuntu/www/tf/shared/bundle/ruby/2.3.0/gems/unicorn-5.0.1/bin/unicorn_rails:209:in `new'
/home/ubuntu/www/tf/shared/bundle/ruby/2.3.0/gems/unicorn-5.0.1/bin/unicorn_rails:209:in `<top (required)>'
/home/ubuntu/www/tf/shared/bundle/ruby/2.3.0/bin/unicorn_rails:22:in `load'
/home/ubuntu/www/tf/shared/bundle/ruby/2.3.0/bin/unicorn_rails:22:in `<top (required)>'
master failed to start, check stderr log for details
You have symbolic link ~www/tf/current/tmp/pids present but its target directory ~www/tf/shared/pids/ doesn't exist so the link is broken. unicorn is attempting to create tmp/pids directory in the ~www/tf/current/ but the symbolic link which already exists causes failure.
To fix this you need to create ~www/tf/shared/pids/ directory with appropriate ownership and permissions.
Related
I have a ruby web app configured, with all the gems installed etc. It runs fine through my apache server, but now I have to debug something (which I'm still figuring out) and I need to run the rails server -b (ip) -p (port) command.
However I get the following outcome:
=> Booting Thin
=> Rails 4.0.12 application starting in development on http://192.168.39.163:3004
=> Run 'rails server -h' for more startup options
=> Ctrl-C to shutdown server
Exiting
/home/vicky/.rbenv/versions/2.2.3/lib/ruby/2.2.0/fileutils.rb:252:in 'mkdir': Permission denied # dir_s_mkdir - /home/vicky/vanerum/tmp/pids (Errno::EACCES)
from /home/vicky/.rbenv/versions/2.2.3/lib/ruby/2.2.0/fileutils.rb:252:in 'fu_mkdir'
from /home/vicky/.rbenv/versions/2.2.3/lib/ruby/2.2.0/fileutils.rb:226:in `block (2 levels) in mkdir_p'
from /home/vicky/.rbenv/versions/2.2.3/lib/ruby/2.2.0/fileutils.rb:224:in `reverse_each'
from /home/vicky/.rbenv/versions/2.2.3/lib/ruby/2.2.0/fileutils.rb:224:in `block in mkdir_p'
from /home/vicky/.rbenv/versions/2.2.3/lib/ruby/2.2.0/fileutils.rb:210:in `each'
from /home/vicky/.rbenv/versions/2.2.3/lib/ruby/2.2.0/fileutils.rb:210:in `mkdir_p'
from /home/vicky/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.0.12/lib/rails/commands/server.rb:71:in `block in start'
from /home/vicky/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.0.12/lib/rails/commands/server.rb:70:in `each'
from /home/vicky/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.0.12/lib/rails/commands/server.rb:70:in `start'
from /home/vicky/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.0.12/lib/rails/commands.rb:76:in `block in <top (required)>'
from /home/vicky/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.0.12/lib/rails/commands.rb:71:in `tap'
from /home/vicky/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.0.12/lib/rails/commands.rb:71:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
I've changed ~/.rbenv's owner to myself, I've tried setting the permissions to 775 on that folder. It keeps giving me this error. Any more ideas?
Create a folder in /home/vicky/vanerum/ with name tmp.
For a case, create a folder pids in /home/vicky/vanerum/tmp.
I assume the problem in thin server, it not able to create folder.
I'm logged into the GCE console and copied my rails app onto the server (tried both var/www and my home directory just to be sure). Connected via gcloud auth login and gcloud compute ssh to my instance as the same user that is owning the project.
Once I'm in the rails directory:
-bundle install works
- rake comes up with this error:
/usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/fileutils.rb:250:in `mkdir': Permission denied # dir_s_mkdir - /usr/local/rvm/gems/ruby-2.1.1/extensions/x86_64-linux/2.1.0/bcrypt-3.1.7 (Errno::EACCES)
from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/fileutils.rb:250:in `fu_mkdir'
from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/fileutils.rb:224:in `block (2 levels) in mkdir_p'
from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/fileutils.rb:222:in `reverse_each'
from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/fileutils.rb:222:in `block in mkdir_p'
from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/fileutils.rb:208:in `each'
from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/fileutils.rb:208:in `mkdir_p'
from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/ext/builder.rb:210:in `write_gem_make_out'
from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/ext/builder.rb:132:in `build_error'
from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/ext/builder.rb:171:in `rescue in build_extension'
from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/ext/builder.rb:156:in `build_extension'
from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/ext/builder.rb:198:in `block in build_extensions'
from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/ext/builder.rb:195:in `each'
from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/ext/builder.rb:195:in `build_extensions'
from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/specification.rb:1436:in `block in build_extensions'
from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/user_interaction.rb:45:in `use_ui'
from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/specification.rb:1434:in `build_extensions'
from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/stub_specification.rb:60:in `build_extensions'
from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/basic_specification.rb:56:in `contains_requirable_file?'
from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/specification.rb:925:in `block in find_inactive_by_path'
from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/specification.rb:924:in `each'
from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/specification.rb:924:in `find'
from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/specification.rb:924:in `find_inactive_by_path'
from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems.rb:185:in `try_activate'
from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:132:in `rescue in require'
from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in `require'
from /usr/local/rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:9:in `<main>'
When I try sudo rake:
sudo: rake: command not found
any ideas? I'm totally lost with this, cant find any place to set permissions or something similar.
Please try this instead:
$ rvmsudo rake ...
Plase see also:
rvmsudo vs sudo?
Here's what worked for me:
sudo chown -R $USER /usr/local/
Rake can then be run without issues.
I am trying to deploy my rails app with capistrano and I am getting the following error after the command:
cap production deploy
Output:
DEBUG[a3e9636c] Running /usr/bin/env [ -d ~/.rvm ] on handco-op.com
DEBUG[a3e9636c] Command: [ -d ~/.rvm ]
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host appname.com: Authentication failed for user deploy#appname.com
/home/deploy/.rvm/gems/ruby-2.1.2/gems/net-ssh-2.9.1/lib/net/ssh.rb:219:in `start'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/connection_pool.rb:50:in `call'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/connection_pool.rb:50:in `create_new_entry'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/connection_pool.rb:22:in `checkout'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:179:in `with_ssh'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:131:in `block in _execute'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:128:in `tap'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:128:in `_execute'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:62:in `test'
/home/deploy/.rvm/gems/ruby-2.1.2/bundler/gems/rvm-dc35ec5e7a74/lib/capistrano/tasks/rvm.rake:19:in `block (3 levels) in <top (required)>'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:54:in `run'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/runners/parallel.rb:13:in `block (2 levels) in execute'
Net::SSH::AuthenticationFailed: Authentication failed for user deploy#appname.com
/home/deploy/.rvm/gems/ruby-2.1.2/gems/net-ssh-2.9.1/lib/net/ssh.rb:219:in `start'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/connection_pool.rb:50:in `call'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/connection_pool.rb:50:in `create_new_entry'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/connection_pool.rb:22:in `checkout'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:179:in `with_ssh'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:131:in `block in _execute'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:128:in `tap'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:128:in `_execute'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:62:in `test'
/home/deploy/.rvm/gems/ruby-2.1.2/bundler/gems/rvm-dc35ec5e7a74/lib/capistrano/tasks/rvm.rake:19:in `block (3 levels) in <top (required)>'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:54:in `run'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/runners/parallel.rb:13:in `block (2 levels) in execute'
Tasks: TOP => rvm:hook
(See full trace by running task with --trace)
Just to be clear, I replaced my real server name with "appname" to stay secret;) Thanks for any advice! I hope it is a simple fix and I will keep looking into the error as well.
I was missing secret keys, had to set up nopassword ssh and a lot of other tweaks. It is a hard error to fix and takes a lot of things to get around. It was about three hours of debugging and fixing my permissions. Some tutorials setting this up actually can mess things up such as setting the users in the sudo group really makes it hard to define the user directly in: visudo I recommend not adding anything to the sudo group via:
sudo adduser user sudo
This was just my set up so you may need to add a user to sudo but I prefer giving ALL permissions to my users in visudo with:
visudo
user ALL = NOPASSWD:
Hope this someone get around this! it was a dang hard error to fix with a lot happening and was mostly my user errors when configuring capistrano. Good luck! Keep calm and code on!;)
recently my app stacked and I tried to make some checks.
I run such command through console:
passenger-config --detect-apache2
Got this error.
Detecting configuration file location...
--> /etc/httpd/conf/httpd.conf
Detecting error log file...
/home3/ecotec11/ruby/gems/gems/passenger-4.0.37/lib/phusion_passenger/platform_info/apache.rb:241:in `initialize': No such file or directory - /etc/httpd/conf/httpd.conf (Errno::ENOENT)
from /home3/ecotec11/ruby/gems/gems/passenger-4.0.37/lib/phusion_passenger/platform_info/apache.rb:241:in `open'
from /home3/ecotec11/ruby/gems/gems/passenger-4.0.37/lib/phusion_passenger/platform_info/apache.rb:241:in `httpd_actual_error_log'
from /home3/ecotec11/ruby/gems/gems/passenger-4.0.37/lib/phusion_passenger/platform_info.rb:115:in `httpd_actual_error_log'
from /home3/ecotec11/ruby/gems/gems/passenger-4.0.37/lib/phusion_passenger/platform_info/apache_detector.rb:148:in `block in detect_one'
from /home3/ecotec11/ruby/gems/gems/passenger-4.0.37/lib/phusion_passenger/platform_info/apache_detector.rb:226:in `add_result'
from /home3/ecotec11/ruby/gems/gems/passenger-4.0.37/lib/phusion_passenger/platform_info/apache_detector.rb:118:in `detect_one'
from /home3/ecotec11/ruby/gems/gems/passenger-4.0.37/lib/phusion_passenger/platform_info/apache_detector.rb:112:in `block in detect_all'
from /home3/ecotec11/ruby/gems/gems/passenger-4.0.37/lib/phusion_passenger/platform_info/apache_detector.rb:111:in `each'
from /home3/ecotec11/ruby/gems/gems/passenger-4.0.37/lib/phusion_passenger/platform_info/apache_detector.rb:111:in `detect_all'
from /home3/ecotec11/ruby/gems/gems/passenger-4.0.37/lib/phusion_passenger/config/about_command.rb:140:in `run'
from /home3/ecotec11/ruby/gems/gems/passenger-4.0.37/lib/phusion_passenger/config/main.rb:60:in `run!'
from /home3/ecotec11/ruby/gems/gems/passenger-4.0.37/bin/passenger-config:37:in `<top (required)>'
from /home3/ecotec11/ruby/gems/bin/passenger-config:23:in `load'
from /home3/ecotec11/ruby/gems/bin/passenger-config:23:in `<main>'
ecotec11#ecotechno.lv [~/rails_apps/darbs]#
I have an existing application with database ready I have made all the changes in database.yml and did bundle install when I am trying to do rails s to start the WEBrick server I am getting the following error
/usr/lib/ruby/1.9.1/fileutils.rb:247:in `mkdir': File exists - /home/username/appname/app/releases/20120831125545/tmp (Errno::EEXIST)
from /usr/lib/ruby/1.9.1/fileutils.rb:247:in `fu_mkdir'
from /usr/lib/ruby/1.9.1/fileutils.rb:221:in `block (2 levels) in mkdir_p'
from /usr/lib/ruby/1.9.1/fileutils.rb:219:in `reverse_each'
from /usr/lib/ruby/1.9.1/fileutils.rb:219:in `block in mkdir_p'
from /usr/lib/ruby/1.9.1/fileutils.rb:205:in `each'
from /usr/lib/ruby/1.9.1/fileutils.rb:205:in `mkdir_p'
from /home/username/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.10/lib/rails/commands/server.rb:62:in `block in start'
from /home/username/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.10/lib/rails/commands/server.rb:61:in `each'
from /home/username/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.10/lib/rails/commands/server.rb:61:in `start'
from /home/username/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.10/lib/rails/commands.rb:30:in `block in <top (required)>'
from /home/username/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.10/lib/rails/commands.rb:27:in `tap'
from /home/username/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.10/lib/rails/commands.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Am I missing some step , Do I have to re run the migration (I have the database ready with me with data in it)
any help?
Apparently the tmp directory Rails uses for session store is already present. Try deleting the /tmp folder in your release directory.