Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArgumentError (string contains null byte) with Rails 4 & Postgres #15

Open
pirkka opened this issue Feb 16, 2015 · 2 comments
Open

ArgumentError (string contains null byte) with Rails 4 & Postgres #15

pirkka opened this issue Feb 16, 2015 · 2 comments

Comments

@pirkka
Copy link

pirkka commented Feb 16, 2015

I didn't go deep trying to solve this by myself, but looks like with any image I throw at it, the upload gives me this error.

The stacktrace got lost already, but the exception was raised in "lib/active_record/connection_adapters/postgresql/oid/bytea.rb".

I was using ruby 2.0, Postgres & Rails 4.2.

I already started to switch to using S3, but thought I still want to report this. Storing images in the local database would been a perfect fit for this small application (tiny amoung of images, no long term data retention, security important).

@feddgs
Copy link

feddgs commented May 8, 2015

Hi, I found this problem, i leave the solution here for future reference. The way to solve this, tis to downgrade the postgresql gem 'pg' to version 0.17.1, this solve the null byte problem.

@thisisole
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants