Taps Server Error During Heroku Database Push

I’ve been enjoying the services of Heroku recently. Heroku exemplifies cloud computing for developers, with simple tools to deploy your Ruby on Rails application.

While uploading a development database to Heroku, I encountered the following error: 75% |================================== | ETA: 00:00:06 Saving session to push_201102111450.dat.. !!! Caught Server Exception HTTP CODE: 500 Taps Server Error: PGError: ERROR: invalid byte sequence for encoding "UTF8": 0xae HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".

Google searches failed to discover an easy fix.

To elaborate on the error a bit, my database contained a byte sequence that Heroku’s Taps Server did not allow under UTF-8 encoding. I’m not sure how this byte sequence got in. My SQLite database also used UTF-8 encoding, but apparently SQLite had been more tolerant of byte sequences when I imported the data.

In any case, it was worth noting that I had a progress indicator (“75%” above) on the specific table that contained the bad byte sequence.

When I viewed the table in a web page and scrolled down approximately 75% of the way down, I found some strange characters. When I edited the offending characters out of the table, the database push worked.

Of course, the web page view had to use the default ordering of the data. I was lucky that the run-time ordering of the data (used in my web page view) was the same as the push-time ordering of the data.

Tags: Technical

Created at: 11 February 2011 4:02 PM