Re: Heroku console crashing

2010-08-02 Thread Jonathan
Running database transactions through this remote console setup is
iffy...  It might work better to do a db:pull (ideally of just the
tables you want to change), do the database maintenance locally, and
then push the updated tables.  You can put the site into maintenance
mode while you do this, if necessary.  This technique works reasonably
well for me.

On Aug 1, 6:44 pm, Mike mikel...@gmail.com wrote:
 I'm updating some data in my database, and running them through the
 Heroku console since we have no direct database access...

-- 
You received this message because you are subscribed to the Google Groups 
Heroku group.
To post to this group, send email to her...@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Re: Heroku console crashing

2010-08-02 Thread Oren Teich
Also check out
http://github.com/ddollar/heroku-sql-console

On Mon, Aug 2, 2010 at 9:15 AM, Jonathan jse...@gmail.com wrote:
 Running database transactions through this remote console setup is
 iffy...  It might work better to do a db:pull (ideally of just the
 tables you want to change), do the database maintenance locally, and
 then push the updated tables.  You can put the site into maintenance
 mode while you do this, if necessary.  This technique works reasonably
 well for me.

 On Aug 1, 6:44 pm, Mike mikel...@gmail.com wrote:
 I'm updating some data in my database, and running them through the
 Heroku console since we have no direct database access...

 --
 You received this message because you are subscribed to the Google Groups 
 Heroku group.
 To post to this group, send email to her...@googlegroups.com.
 To unsubscribe from this group, send email to 
 heroku+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/heroku?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Heroku group.
To post to this group, send email to her...@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Re: Heroku console crashing

2010-08-02 Thread Mike
Wow, thanks, that sql console looks amazing! How come Heroku doesn't
fold this into its official tools?

Regarding using db:pull, maintenance, followed by db:push, that
technique was extremely troublesome for me in the past, probably
because my database is big, around 5 GB. When uploading on db:push,
the initial ETA starts low, and then shoots up the longer it runs
(mine starts at 8 and then takes around 36 hours total). This
combined, with the fact that the db:push process seems to be fragile
means anytime I use push my site will be down for a while.

Last time I used it, my first attempt to push the database died after
about 24 hours with a Taps error (which I reported to support already)
where it spuriously complained that there was a duplicate key in the
primary keys of a table. My second attempt to push the database died
after another day when I briefly lost my Internet connection. The
third attempt successfully pushed it up, but I really want to avoid
using the push/pull tools on my site again unless necessary.

I will definitely check out the console, seems like just the ticket
for this sort of thing.

On Aug 2, 1:34 pm, Oren Teich o...@heroku.com wrote:
 Also check outhttp://github.com/ddollar/heroku-sql-console



 On Mon, Aug 2, 2010 at 9:15 AM, Jonathan jse...@gmail.com wrote:
  Running database transactions through this remote console setup is
  iffy...  It might work better to do a db:pull (ideally of just the
  tables you want to change), do the database maintenance locally, and
  then push the updated tables.  You can put the site into maintenance
  mode while you do this, if necessary.  This technique works reasonably
  well for me.

  On Aug 1, 6:44 pm, Mike mikel...@gmail.com wrote:
  I'm updating some data in my database, and running them through the
  Heroku console since we have no direct database access...

  --
  You received this message because you are subscribed to the Google Groups 
  Heroku group.
  To post to this group, send email to her...@googlegroups.com.
  To unsubscribe from this group, send email to 
  heroku+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/heroku?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Heroku group.
To post to this group, send email to her...@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Re: Heroku console crashing

2010-08-01 Thread Mike
Okay, actually fixed this, sort of, by updating my heroku gem.

Now it now longer crashes and just quits the console and tells me that
it's timed out and I should run it as a rake task instead of from the
console.

Overall behavior seems to be the same still, with the request
continuing to run on the dyno until completed.

On Aug 1, 9:44 pm, Mike mikel...@gmail.com wrote:
 I'm updating some data in my database, and running them through the
 Heroku console since we have no direct database access.

 I'm calling this like so: ActiveRecord::Base.connection.execute MY
 SQL COMMAND;

 The command takes about 5-10 minutes to run.

 Every time I run it, it's causing the console to crash, with the
 following message:
 /var/lib/gems/1.8/gems/heroku-1.9.9/lib/heroku/client.rb:202:in
 `console': undefined method `code' for nil:NilClass (NoMethodError)
         from /var/lib/gems/1.8/gems/heroku-1.9.9/lib/heroku/commands/app.rb:
 158:in `console_session'
         from /var/lib/gems/1.8/gems/heroku-1.9.9/lib/heroku/commands/app.rb:
 147:in `console'
         from /var/lib/gems/1.8/gems/heroku-1.9.9/lib/heroku/command.rb:48:in
 `send'
         from /var/lib/gems/1.8/gems/heroku-1.9.9/lib/heroku/command.rb:48:in
 `run_internal'
         from /var/lib/gems/1.8/gems/heroku-1.9.9/lib/heroku/command.rb:20:in
 `run'
         from /var/lib/gems/1.8/gems/heroku-1.9.9/bin/heroku:13
         from /var/lib/gems/1.8/bin/heroku:19:in `load'
         from /var/lib/gems/1.8/bin/heroku:19

 After that, apparently the command is continuing to run even though I
 have no access to the console, as for about the runtime of my command,
 the dyno continues to be completely tied up and non-responsive.
 Afterwards, I can connect to the console again, and the data appears
 upon first inspection to have been changed.

 Has anyone else seen behavior like this? Did your data integrity turn
 out okay in the end?

-- 
You received this message because you are subscribed to the Google Groups 
Heroku group.
To post to this group, send email to her...@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Re: Heroku console crashing

2010-08-01 Thread Oren Teich
That's how Heroku works -
http://docs.heroku.com/performance#request-timeout.  A console command
is treated identically to a HTTP request.

Oren

On Sun, Aug 1, 2010 at 6:57 PM, Mike mikel...@gmail.com wrote:
 Okay, actually fixed this, sort of, by updating my heroku gem.

 Now it now longer crashes and just quits the console and tells me that
 it's timed out and I should run it as a rake task instead of from the
 console.

 Overall behavior seems to be the same still, with the request
 continuing to run on the dyno until completed.

 On Aug 1, 9:44 pm, Mike mikel...@gmail.com wrote:
 I'm updating some data in my database, and running them through the
 Heroku console since we have no direct database access.

 I'm calling this like so: ActiveRecord::Base.connection.execute MY
 SQL COMMAND;

 The command takes about 5-10 minutes to run.

 Every time I run it, it's causing the console to crash, with the
 following message:
 /var/lib/gems/1.8/gems/heroku-1.9.9/lib/heroku/client.rb:202:in
 `console': undefined method `code' for nil:NilClass (NoMethodError)
         from /var/lib/gems/1.8/gems/heroku-1.9.9/lib/heroku/commands/app.rb:
 158:in `console_session'
         from /var/lib/gems/1.8/gems/heroku-1.9.9/lib/heroku/commands/app.rb:
 147:in `console'
         from /var/lib/gems/1.8/gems/heroku-1.9.9/lib/heroku/command.rb:48:in
 `send'
         from /var/lib/gems/1.8/gems/heroku-1.9.9/lib/heroku/command.rb:48:in
 `run_internal'
         from /var/lib/gems/1.8/gems/heroku-1.9.9/lib/heroku/command.rb:20:in
 `run'
         from /var/lib/gems/1.8/gems/heroku-1.9.9/bin/heroku:13
         from /var/lib/gems/1.8/bin/heroku:19:in `load'
         from /var/lib/gems/1.8/bin/heroku:19

 After that, apparently the command is continuing to run even though I
 have no access to the console, as for about the runtime of my command,
 the dyno continues to be completely tied up and non-responsive.
 Afterwards, I can connect to the console again, and the data appears
 upon first inspection to have been changed.

 Has anyone else seen behavior like this? Did your data integrity turn
 out okay in the end?

 --
 You received this message because you are subscribed to the Google Groups 
 Heroku group.
 To post to this group, send email to her...@googlegroups.com.
 To unsubscribe from this group, send email to 
 heroku+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/heroku?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Heroku group.
To post to this group, send email to her...@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.