task deploy:web:disable broken on 2.6.0 #73

Closed
gucki opened this Issue Aug 1, 2011 · 8 comments

Comments

Projects
None yet
5 participants

gucki commented Aug 1, 2011

cap deploy:web:disable

  * executing `deploy:web:disable'

        # Please add something like this to your site's htaccess to redirect users to the maintenance page.
        # More Info: http://www.shiftcommathree.com/articles/make-your-rails-maintenance-page-respond-with-a-503

        ErrorDocument 503 /system/maintenance.html
        RewriteEngine On
        RewriteCond %{REQUEST_URI} !.(css|gif|jpg|png)$
        RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
        RewriteCond %{SCRIPT_FILENAME} !maintenance.html
        RewriteRule ^.*$  -  [redirect=503,last]

    servers: ["vs15786"]
 ** sftp upload #<StringIO:0x00000001c622e8> -> /home/test/shared/system/maintenance.html
/home/gucki/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.6.0/lib/capistrano/transfer.rb:156:in `[]=': undefined method `[]=' for nil:NilClass (NoMethodError)
  from /home/gucki/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.6.0/lib/capistrano/transfer.rb:207:in `handle_error'
  from /home/gucki/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.6.0/lib/capistrano/transfer.rb:48:in `rescue in block in process!'
  from /home/gucki/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.6.0/lib/capistrano/transfer.rb:44:in `block in process!'
  from /home/gucki/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.6.0/lib/capistrano/transfer.rb:43:in `loop'
  from /home/gucki/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.6.0/lib/capistrano/transfer.rb:43:in `process!'
  from /home/gucki/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.6.0/lib/capistrano/transfer.rb:11:in `process'
  from /home/gucki/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.6.0/lib/capistrano/configuration/actions/file_transfer.rb:43:in `block in transfer'
  from /home/gucki/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.6.0/lib/capistrano/configuration/connections.rb:192:in `block in execute_on_servers'
  from /home/gucki/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.6.0/lib/capistrano/configuration/connections.rb:180:in `each'
  from /home/gucki/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.6.0/lib/capistrano/configuration/connections.rb:180:in `each_slice'
  from /home/gucki/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.6.0/lib/capistrano/configuration/connections.rb:180:in `execute_on_servers'
  from /home/gucki/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.6.0/lib/capistrano/configuration/actions/file_transfer.rb:38:in `transfer'
  from /home/gucki/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.6.0/lib/capistrano/configuration/actions/file_transfer.rb:26:in `upload'
  from /home/gucki/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.6.0/lib/capistrano/configuration/actions/file_transfer.rb:13:in `put'
  from /home/gucki/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.6.0/lib/capistrano/configuration/namespaces.rb:186:in `method_missing'
  from /home/gucki/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.6.0/lib/capistrano/configuration/namespaces.rb:186:in `method_missing'
  from /home/gucki/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.6.0/lib/capistrano/recipes/deploy.rb:584:in `block (3 levels) in load'
  from /home/gucki/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.6.0/lib/capistrano/configuration/execution.rb:139:in `instance_eval'
  from /home/gucki/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.6.0/lib/capistrano/configuration/execution.rb:139:in `invoke_task_directly'
  from /home/gucki/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.6.0/lib/capistrano/configuration/callbacks.rb:27:in `invoke_task_directly_with_callbacks'
  from /home/gucki/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.6.0/lib/capistrano/configuration/execution.rb:89:in `execute_task'
  from /home/gucki/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.6.0/lib/capistrano/configuration/execution.rb:101:in `find_and_execute_task'
  from /home/gucki/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.6.0/lib/capistrano/cli/execute.rb:46:in `block in execute_requested_actions'
  from /home/gucki/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.6.0/lib/capistrano/cli/execute.rb:45:in `each'
  from /home/gucki/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.6.0/lib/capistrano/cli/execute.rb:45:in `execute_requested_actions'
  from /home/gucki/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.6.0/lib/capistrano/cli/help.rb:19:in `execute_requested_actions_with_help'
  from /home/gucki/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.6.0/lib/capistrano/cli/execute.rb:34:in `execute!'
  from /home/gucki/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.6.0/lib/capistrano/cli/execute.rb:14:in `execute'
  from /home/gucki/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.6.0/bin/cap:4:in `<top (required)>'
  from /home/gucki/.rvm/gems/ruby-1.9.2-p290/bin/cap:19:in `load'
  from /home/gucki/.rvm/gems/ruby-1.9.2-p290/bin/cap:19:in `<main>'
Owner

leehambley commented Aug 1, 2011

@gucki - you're the first person in about 2 years to care about that method! I expect it's because a file is missing… and I had plans to remove this feature anyway (and move it to an extension)...

gucki commented Aug 1, 2011

@leehambley ahm, ok ;-). which file should be missing, shouldn't it work out of the box?

Owner

leehambley commented Aug 1, 2011

@gucki, naturally there's a message in the executable, here - that you need to install some stuff into your apache config, my problem with web:disable that there's more to it than that, one you need to be using apache, two you need to install the config as proposed here (but you don't wanna see that message every time!) and there's a maintenance page, which might not be in the path… that's the problem here, I think, is that you don't have a web:disable template, and I don't even know if it's still in the Gem... The Rails world has been headed towards downtimeless deploys, with Unicorn and Passenger 3 both supporting restarts without downtime, there's not a lot of reasons for Rails people to use these tasks to disable the website for a deploy ( who can afford downtime, anyway, right?!)

I'll look into this, and get back to you.

gucki commented Aug 1, 2011

Yeah, I already use unicorn with nginx for zero downtime upgrades. But you know, there are always cases when a (short?) downtime cannot be avoided and then this maintenance task seems pretty handy. I already configured unicorn to serve the maintenance.html in case it exists (http://wiki.nginx.org/HttpCoreModule#try_files). In which folder do I need to put the template? Having a pretty basic one in the gem would be great.. :)

Contributor

rgo commented Nov 8, 2011

Before to extract it as a gem we can write a deprecation warning to this tasks (web:enable and web:disable) for a while

I use both sometimes (with my own templates) :)

Contributor

carsomyr commented Sep 30, 2012

I think that deploy:web:disable and deploy:web:enable are too ad-hoc and would be in favor of removing them entirely and directing people to write their own.

Contributor

carsomyr commented Oct 1, 2012

Alright, I'm removing them and closing this issue.

carsomyr closed this Oct 1, 2012

That feature is indeed quite useful. We are all using "zero downtime delpoys" these days, but raise your hands if once in a while unicorn failed to reload your app.

Btw is there a separate gem or "official gist" I can drop in after upgrade?

@hezequiel hezequiel pushed a commit to hezequiel/cggem that referenced this issue Feb 28, 2014

@benichu benichu Added a web:enable task. 34255e3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment