ricardochimal/taps

Taps Server Error: PGError: ERROR: time zone displacement out of range: "2011-11-15 12:00:00.000000+5894114400"

pupeno opened this issue · 59 comments

I run the following command to push the contents of my local database to Heroku:

heroku db:push --app my-app

which uses taps and from my home computer it works flawlessly but from my work computer I get this error:

Taps Server Error: PGError: ERROR: time zone displacement out of range: "2011-11-15 12:00:00.000000+5894114400"

I'm not sure where that date is coming from, I can't find it in the data anywhere. Any ideas what's going on and/or how to fix it?

Thanks.

This seems to happen with Ruby 1.9.3-p0 but not with 1.9.2.

Posted on sequel.

jeremyevans/sequel#405

mdi commented

Same problem here. Ruby v1.9.3

This is a problem due to remote ruby version mismatching. Just use 1.9.2 until heroku updates to 1.9.3.

I can confirm that switching to 1.9.2 locally fixed the issue in my situation.

This is a duplicate of Issue #92. I suggest closing it.

Yes, like jhorn424, i switched back from 1.9.3 to 1.9.2 locally, and the error disappeared

rvm use ruby-1.9.2-p290

heroku db:push

Taps Server Error: PGError: ERROR: time zone displacement out of range: "2012-04-24 12:00:00.000000+5894500800"

Any ideas?

$ rvm install ruby-1.9.2-p318
$ rvm use ruby-1.9.2-p318
$ heroku db:push
Resetting sequences

I had the same problem.. the rvm directions from dongriab fixed it.. just after the rvm use cmd you need to put your gems on since its a new ruby install..
sudo gem install heroku --no-ri --no-rdoc
sudo gem install taps --no-ri --no-rdoc
sudo gem install sqlite3 --no-ri --no-rdoc
Then it worked..fa

FYI, I tried setting the Heroku ruby version according to this article: http://blog.heroku.com/archives/2012/5/9/multiple_ruby_version_support_on_heroku/ . I confirmed that it worked to set the ruby version. But I'm still getting this error from taps.

Thanks! resetting my Ruby version to 1.9.2 worked for me :)

Just thought I would note this since I got stuck on this. If you are on Mac OSX Lion and get stuck with errors trying to install Ruby 1.9.2 because of the updated Xcode compiler add this to the end of your version install.
rvm install ruby-1.9.2-p318 --with-gcc=clang

Donwgrading ruby to version 1.9.2-p318 worked for me as well :)

hale commented

Both heroku and my local development envionment are using ruby 1.9.3p194. Still getting this issue.

hale commented

Downgrading to ruby 1.9.2-p320 locally fixed it.

This is a horrible solution to this problem. Has any other progress been made on this?

hale commented

if you use bundler beta you cab specify the ruby version in the gemfile, thereby forcing heroku to use whichever ruby version you like (also guarantees local and heroku have same ruby)

hale commented

bundler version you want is '1.2.0.rc'. Its a git tag so just add github url to bundler's entry in the gemfile.

I also had this issue. Using bundler 1.2.0.rc with the ruby '1.9.3' directive didn't solve it. I checked and both remote and local Ruby were 1.9.3-p194.

I was able to work around the issue by installing ruby 1.9.2:

$ rbenv install 1.9.2-p318
$ rbenv local 1.9.2-p318
$ gem install heroku
$ gem install sqlite3
$ gem install taps
$ heroku db:push

You probably haven't setup the PATH correctly, just look at the guide @lohsu mentioned. To verify, run heroku run "ruby -v" and make sure that you have the matching ruby version.

This is a non taps issue and should be closed.

Same as hale, I am running 1.9.3p194 both locally and on heroku

Only difference is heroku lists it as 1.9.3p194 and locally with rvm its listed as ruby-1.9.3-p194 I don't think that would matter though.

It fails, but just switching locally back to 1.9.2 and leaving heroku on 1.9.3 and it works.

Still an issue with 1.9.3p194 even after heroku added support for ruby version in the gem file.

Worked for me downgrading my ruby to 1.9.2, reinstalling heroku and taps gems and forcing ruby on Gemfile to 1.9.2 (to use with heroku).

I'd like to see this issue solved, running ruby 1.9.3p194 both on Heroku and locally.

Downgrading worked for me also.

rvm use 1.9.2 # => ruby-1.9.2-p290
heroku db:push

I've also experienced this issue and upgrading / downgrading both local and heroku ruby versions (1.9.2 and 1.9.3) did not solve the problem.

Looking at the original error message:

Taps Server Error: PGError: ERROR: time zone displacement out of range:

"2012-10-09 12:00:00.000000+5894904000"

It seems obvious that something is actually wrong with the way dates are getting converted during the process.

The actual value of the date field in my case was: "2012-10-09 02:35:34"

What part of the process is causing this change to happen?

It wasn't working for me even when I downgraded to 1.9.2. I had to install the heroku gem (I only had the toolbelt installed) and then heroku db:push worked with 1.9.2.

Note that this happens with 1.9.2p320 as well.

It worked when I went from 1.9.3 to ruby 1.9.2p320.

1.9.2p320 does not work for me, even using the Heroku gem.

Installing and using 1.9.2-p318 worked for me.

I assume this is still being worked on? Because this is a really bad solution to the issue.

Installing ruby-1.9.2-p320 (instead of 1.9.3) works for me. (on Mac OS X 10.8)

$ CC=/usr/bin/gcc rvm install ruby-1.9.2-p320
$ rvm use ruby-1.9.2-p320
$ gem install taps
$ ~/.rvm/bin/ruby-1.9.2-p320 /usr/bin/heroku db:push
(I needed to specify exact ruby-1.9.2-p320 path before heroku command.)

Downgrading to ruby 1.9.2-p320 locally fixed it.

How can we fix this? I would like to help but I don't know where to start. Pointers anyone?
Thanks.

+1

Heroku apps are now fully upgraded to use Heroku Postgres. With Heroku Postgres you can connect directly to PG with taps.

To do db:push, first start taps server locally:

taps server postgres://localdbuser:localdbpass@localhost/dbname httpuser httppassword

then do a taps pull to push to heroku:

taps pull postgres://dbuser:dbpassword@ec2-XX-XX-XX-XX.compute-1.amazonaws.com/dbname http://httpuser:httppassword@localhost:5000

where dbuser, dbpassword, and dbname can be obtained from https://postgres.heroku.com/databases

This should work with any ruby 1.9 that you have. I've tested it with 1.9.3-p327.

@kenips work with charm!

Using the next line worked for me:
~/.rvm/bin/ruby-1.9.2-p320 /usr/bin/heroku db:push

@kinduff's solution worked for me, surprisingly (only because I tried just about everything listed in this thread without success).

Thanks @kinduff

Please fix...

Many thanks @kinduff

Thanks @kenips

@kenips solutions worked for me. Thx!

I just had this issue, and I still haven't resolved it. I rolled back to ruby version 1.9.2-p290 and 1.9.2-p320. I read some articles in the postgreSQL documentation, and it seems that the issue is that the format for the datetime strings are incompatible. I'm not sure how to go about fixing this. Just thought I should report it.

I only just started having this issue. It worked fine several weeks ago. (before 2013)

@kenips thanks works perfectly using 1.9.3 using taps directly to pg

@kinduff You're the man!

The rbenv equivalent of what @kinduff wrote:

~/.rbenv/versions/1.9.2-p290/bin/ruby ~/.rbenv/versions/1.9.2-p290/bin/heroku db:push

@plindberg's solution worked fine for me (Thanks!)

$ ~/.rvm/wrappers/ruby-1.9.2-p320/ruby ~/.rvm/gems/ruby-1.9.2-p320/gems/heroku-2.34.0/bin/heroku db:push

+1 kinduff

+1 kinduff

After following @seanbehan advice I was able to push. Used the matching version of Ruby that Heroku is running (heroku run "ruby -v") and installed the heroku gem.

$ rvm install ruby-1.9.2-p290
$ rvm use ruby-1.9.2-p290
$ gem install heroku
$ gem install taps
$ heroku db:push

this works for me ~/.rvm/bin/ruby-1.9.2-p320 /usr/bin/heroku db:push

will commented

Don't use taps! Use pgbackups, or pg_dump and pg_restore directly

Thank you @roymckenzie that worked for me, be sure to run bundle install when you enter into a new version

Thanks yoshiokatsuneo ... your solution worked well after reinstalling the sqlite3 gem.

will commented

Taps will soon be replaced by pg:push and pg:pull. If you want a preview check out heroku/heroku-pg-extras#42

I had the same issue with rbenv instead of rvm, so i used
~/.rbenv/versions/1.9.2-p290/bin/ruby /usr/bin/heroku db:push

that worked for me, Thanks @kinduff