Deprec setup problems

As issues are encountered, please document them here. Make a note as to which platform your local development environment is.

Feisty Fawn Related Problems

If you upgrade Ubuntu to Feisty Fawn 7.04 before trying to run Deprec tasks on you server, be prepared to manually uncomment the universe lines in /etc/apt/sources.list before running the install_rails_stack task.

Log in to your slice and then run this command to edit the source list:

  sudo nano /etc/apt/sources.list

And then, remove all the # marks in front of lines that have the word universe. To save something in nano, press ctrl-o then use ctrl-x to exit.

You should now be able to log out and run through the rest of the deprec tutorial instructions as normal.

deprec_setup: capistrano asks for password, but doesn't accept it

Symptom:

Running capistrano commands (like ‘cap setup_ssh_keys’) gives a useless password prompt:

* executing task install_rails_stack
* executing task setup_user_perms
* executing "sudo  grep 'deploy:' /etc/group || sudo /usr/sbin/groupadd deploy"
 servers: ["my.server.ip"]
  [my.server.ip] executing command
** [out :: my.server.ip] [sudo] password for deploy:

typed pass shows up here – nothing happens

^C
/usr/local/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/capistrano/command.rb:41:in `sleep': Interrupt
      from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/capistrano/command.rb:41:in `process!'
      ... etc...

Resolution:

This can be fixed by adding the following line to config/deploy.rb on your local computer:

set :sudo, “sudo -p Password:”

Then it will give a proper password prompt!

deprec_setup: cannot create regular file xxx.conf

Symptom:

 >* executing "sudo cp /var/www/apps/myapp/shared/httpd.conf /etc/httpd/conf/apps/myapp.conf"
 servers: ["my.server.ip"]
 [my.server.ip] executing command
 ** [out :: my.server.ip] cp: cannot create regular file `/etc/httpd/conf/apps/myapp.conf': No such file or directory

Resolution:

The above error is because the deploy.rb script was not altered to reflect the correct location for the apache config files, i.e. /usr/local/apache2/conf not /etc/httpd/conf.

deprec_setup: permission denied uploading httpd.conf

Symptom:

When executing “cap deprec_setup” step. You get the following error:

 >* executing task configure_apache
 servers: ["63.97.251.53"]
 * uploading /var/www/apps/radrailstest1/shared/httpd.conf
 /usr/local/lib/ruby/gems/1.8/gems/net-sftp-1.1.0/lib/net/sftp/operations/abstract.rb:78:in `do_status': Net::SFTP::Operations::StatusException (3, "Permission denied")
 (Net::SFTP::Operations::StatusException (3, "Permission denied"))

Resolution:

This error happens because the file httpd.conf exists and is marked as read only.

/var/www/apps/radrailstest1/shared/httpd.conf

This would happen for one of two reasons, either “cap setup” was run (which is not needed, what it does is encompassed in deprec_setup) or “cap deprec_setup” was run previously and encountered an error after creating this file.

Simply remove the file on the slice at the specified path and try deprec_setup again.

deprec_setup: apache install file not found

Symptom:

 executing command
 ** [out :: 63.97.251.53] --00:05:48-- http://www.apache.org/dist/httpd/httpd-2.2.3.tar.gz
 ** [out :: 63.97.251.53] => `httpd-2.2.3.tar.gz'
 ** [out :: 63.97.251.53] Resolving www.apache.org... 
 ** [out :: 63.97.251.53] 140.211.11.130
 ** [out :: 63.97.251.53] Connecting to www.apache.org|140.211.11.130|:80...
 ** [out :: 63.97.251.53] connected.
 ** [out :: 63.97.251.53] HTTP request sent, awaiting response...
 ** [out :: 63.97.251.53] 404 Not Found
 ** [out :: 63.97.251.53] 00:05:48 ERROR 404: Not Found.

Resolution:

Version 1.3.1 of Deprec has an out of date url for downloading Apache. If you have a version of Deprec later then 1.3.1, you likely will not be affected by this.

Apache website killed the url that was being used - http://www.apache.org/dist/httpd/httpd-2.2.3.tar.gz

This one should be used instead- http://www.apache.org/dist/httpd/httpd-2.2.4.tar.gz

Until this gets incorporated into deprec, you will need to manually make this fix to lines 135 and 138 of

/usr/local/lib/ruby/gems/1.8/gems/deprec-1.3.1/lib/deprec/recipes.rb

line 135 should look like:

  version = 'httpd-2.2.4'

and line 138 should look like:

  :md5sum => '3add41e0b924d4bb53c2dee55a38c09e  httpd-2.2.4.tar.gz', 

If you’re paranoid you’ll want to find the md5sum yourself, since anyone can change it on this page.

For deprec-1.9.3, the URL for apache is in /usr/lib/ruby/gems/1.8/gems/deprec-1.9.3/lib/deprec/recipes/apache.rb Line number 8 and 11.

deprec_setup: apache fails to compile

Symptom:

  Configuring Apache Portable Runtime Utility library...
  
  checking for APR-util... yes
  configure: error: Cannot use an external APR-util with the bundled APR

Resolution:

Add --with-included-apr to line 142 of /usr/local/lib/ruby/gems/1.8/gems/deprec-1.3.1/lib/deprec/recipes.rb

Resolution 2:

Make sure you have the correct path to apache_conf in deploy.rb under Apache Options:

  set :apache_conf, "/usr/local/apache2/conf/apps/#{application}.conf"

deploy_with_migrations: Migrations Won't Run

Symptom

When you attempt to deploy your app with cap deploy_with_migrations you get the following error:

  executing "cd /var/www/apps/your-app/releases/20070413002601 && rake RAILS_ENV=production  db:migrate"
  servers: ["example.com"]
  [example.com] executing command
  ** [out :: example.com] (in /var/www/apps/your-app/releases/20070413002601)
  ** [out :: example.com] rake aborted!
  ** [out :: example.com] Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
  ** [out :: example.com] (See full trace by running task with --trace)
  command finished

Resolution

Change your socket setting in database.yml in your app, and then check in the changes and run cap deploy_with_migrations

MySQL socket may be: /var/run/mysqld/mysqld.sock instead of /tmp/mysqld.sock

Note: The socket variable isn’t set by default. You’ll need to modify the production environment of database.yml to look like this:

production:
  adapter: mysql
  database: myapp_production
  username: username
  password: password
  host: localhost
  socket: /var/run/mysqld/mysqld.sock

deprec_setup: sudo gem update --system fails on first attempt

Symptom:

  ...
  * executing "sudo  gem update --system"
    servers: ["XXX.XX.XX.XXX"]
 ** [XXX.XX.XX.XXX] executing command
 ** [out :: XXX.XX.XX.XXX] Updating RubyGems...
 ** [out :: XXX.XX.XX.XXX] Bulk updating Gem source index for: http://gems.rubyforge.org
 ** [out :: XXX.XX.XX.XXX] Attempting remote update of rubygems-update
 ** [out :: XXX.XX.XX.XXX] ERROR:  While executing gem ... (Gem::GemNotFoundException)
 ** [out :: XXX.XX.XX.XXX] Could not find rubygems-update (> 0) in any repository
    command finished
    command "sudo  gem update --system" failed on XXX.XX.XX.XXX

Resolution:

Not sure what the bug is, but I was able to run cap install_rails_stack again and everything worked fine.

Unable to view website because connection has been refused

Symptom:

Found this error in /usr/local/apache2/logs/XXX-error_log after following “automated_rails_using_deprec/capistrano” instructions

[Thu Apr 12 04:14:56 2007] [error] (111)Connection refused: proxy: HTTP: attempt to connect to 127.0.0.1:8000 (127.0.0.1) failed [Thu Apr 12 04:14:56 2007] [error] ap_proxy_connect_backend disabling worker for (127.0.0.1) [Thu Apr 12 04:14:56 2007] [error] (111)Connection refused: proxy: HTTP: attempt to connect to 127.0.0.1:8001 (127.0.0.1) failed [Thu Apr 12 04:14:56 2007] [error] ap_proxy_connect_backend disabling worker for (127.0.0.1)

Resolution

This is caused by the mongrel_cluster (or possibly just the one mongrel) failing to start. I have no idea why this is the case but I had the same issue when doing a deprec install from windows. It seems that the mongrel_cluster config file is in the wrong place, but I know nothing about Linux administration and so I don’t know how to really correct that, other than to follow these steps on your server slice (you’ll have to do this every time you deploy - it’s a pain I know, but not as much as copying all the files by hand). First, make sure you are in your current release directory - usually /var/www/apps/<your application name>/current

then execute the following statements

sudo mongrel_rails cluster::configure -p 8000 -N 2

sudo mongrel_rails cluster::start

in the above configure statement -p gives the port number to start from (in this case 8000) and -N gives the number of mongrels (in this case 2). This will write a mongrel_cluster.yml file into the config directory of you current release.

To stop the mongrels use

sudo mongrel_rails cluster::stop

For more information on mongrels http://mongrel.rubyforge.org/

Error in OS X: cap setup_admin_account_as_root

Symptom:

While running ‘cap setup_admin_account_as_root’ I run into the following problem. Looks like there’s something wrong with my ruby-net-ssh-setup?

my-macbook:~/Documents/workspace_rails/my_rails_project johndoe$ cap setup_admin_account_as_root
  * executing task setup_admin_account_as_root
  * executing task setup_admin_account
Enter userid for new user: <hidden_because_of_termios>
  * executing "sudo  grep '^deploy:' /etc/passwd || sudo /usr/sbin/useradd  --shell=/bin/bash  --create-home  deploy"
    servers: ["my_rails_server.com"]
/usr/local/lib/ruby/gems/1.8/gems/net-ssh-1.1.0/lib/net/ssh/userauth/agent.rb:70:in `initialize': No such file or directory - /tmp/501/nl.uu.phil.SSHAgent.socket (Errno::ENOENT)
        from /usr/local/lib/ruby/gems/1.8/gems/net-ssh-1.1.0/lib/net/ssh/userauth/agent.rb:70:in `connect!'
        from /usr/local/lib/ruby/gems/1.8/gems/net-ssh-1.1.0/lib/net/ssh/userauth/services.rb:56:in `register_services'
        from /usr/local/lib/ruby/gems/1.8/gems/needle-1.3.0/lib/needle/service-point.rb:122:in `instance'
        from /usr/local/lib/ruby/gems/1.8/gems/needle-1.3.0/lib/needle/container.rb:308:in `[]'
        from /usr/local/lib/ruby/gems/1.8/gems/net-ssh-1.1.0/lib/net/ssh/userauth/services.rb:70:in `open'
        from /usr/local/lib/ruby/gems/1.8/gems/net-ssh-1.1.0/lib/net/ssh/userauth/userkeys.rb:232:in `ensure_agent'
        from /usr/local/lib/ruby/gems/1.8/gems/net-ssh-1.1.0/lib/net/ssh/userauth/userkeys.rb:127:in `identities'
        from /usr/local/lib/ruby/gems/1.8/gems/net-ssh-1.1.0/lib/net/ssh/userauth/methods/publickey.rb:50:in `authenticate'
         ... 22 levels...
        from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/capistrano/cli.rb:239:in `execute!'
        from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/capistrano/cli.rb:12:in `execute!'
        from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.4.1/bin/cap:11
        from /usr/local/bin/cap:18

Resolution

Don’t ask me why exactly this problem happens, but this is the solution:

  1. run the command ‘ssh-agent’ in the terminal-window
  2. copy the line saying: SSH_AUTH_SOCK=/dir/to/some/file;
  3. paste it into the terminal window and press enter
  4. export the SSH_AUTH_SOCK-variable by typing ‘export SSH_AUTH_SOCK;’ in your terminal-window.

cap deprec_setup: chgrp / chown error

Symptom

You get a message like this:

  command "sudo  chgrp -R  /var/www/apps/yourapp/current/tmp /var/www/apps/yourapp/shared" failed on yourapp.com

When using deprec 1.6.0. chgrp is failing because it does not know what group name (or maybe user name in some cases) to change your files to.

Resolution

Either explicitly set :mongrel_user and :mongrel_group, or upgrade to deprec 1.7.0 which will supply correct default values.

Gems

Symptom

Migrations or mongrel start up fails, with an error message that mentions a gem name.

Resolution

You must unpack your gems into your vendor directory, or log in to your server and manually install them there.

 
/var/www/dokuwiki/data/pages/common_deprec_setup_errors.txt · Last modified: 2008/06/18 00:20 by phtphan
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
© Slicehost 2006-2007