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

InvalidByteSequenceError #208

Open
pdelanauze opened this issue Feb 6, 2015 · 2 comments
Open

InvalidByteSequenceError #208

pdelanauze opened this issue Feb 6, 2015 · 2 comments

Comments

@pdelanauze
Copy link

Encoding::InvalidByteSequenceError at /queues/do-it/running
"\xC3" on US-ASCII

file: common.rb location: encode line: 148

Just ran into this , i'm storing some html in those jobs, which the json parser doesn't seem to like ..

@evanbattaglia
Copy link

I was able to work around this in:
https://github.com/seomoz/qless/tree/evans_encoding_error_workaround
762f7f6
It was at least good enough for me to run a script to reenqueue my failed jobs.

@evanbattaglia
Copy link

Update: for me this was caused by Ruby's default external encoding being "US-ASCII" instead "UTF-8", which was in turn caused by Ruby running in a docker container. The data jobs were valid UTF-8 (perhaps the strings had UTF-8 encoding when putting the job because the string originally came from a UTF-8 web page? not sure). The solution for me was to add the following to my Dockerfile:

ENV LANG C.UTF-8
ENV LANGUAGE en_US:C
ENV LC_ALL C.UTF-8

Then Ruby inside the container gives Encoding.default_external as UTF-8.

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

2 participants