-
Notifications
You must be signed in to change notification settings - Fork 87
Cache write is failing when converting ASCII-8BIT characters to UTF-8 #38
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
Comments
@salbertson there is any public URL that is producing this error that we can use to debug it? |
I created a branch with a test to reproduce the issue. My first thought was to skip the write if the encoding fails. salbertson/faraday-http-cache@master...sa-skip-write-when-encoding-errors |
@salbertson thanks for the report. I'm not sure of how to fix this without messing up with the response, as the issue lies with On your app you can swap the serializer to In the mean time, a PR that emits a warning with the storage logger (instead of |
@lucasmazza using |
* Cache requests to limit requests that count against rate limit * Use Marshal for serialization instead of JSON because of serialization issue sourcelevel/faraday-http-cache#38
I just ran into this as well, and I was able to get rid of the error by using
Any idea what might be causing this and how to fix it? Thanks! |
Using Rails 4.2.0.rc3, warden-github, octokit and faraday-http-cache runs into a ASCII-8BIT to UTF-8 error. Its about the response body that holds a german "umlaut" like ü,ä or ö. As long as i use the faraday-http-cache middleware i get this error. Only way is to set Marshal as serializer instead of JSON. Didn't found any other solution for now. |
Please see sourcelevel/faraday-http-cache#38 for more information.
Below copied from launchdarkly#51 (comment) Almost have this integrated, but wanted to mention that I ran into the same problem mentioned at sourcelevel/faraday-http-cache#38. There's a gem that supposedly works around the problem that ultimately lies with Net::HTTP, https://github.com/ma2gedev/faraday-encoding, but for now I just changed the serializer to Marshal as in https://github.com/andrew/contribulator/pull/47/files. I also added back our LDClient#add_user_override to my fork. Not sure if you were planning to implement that, but if not then I'll move it elsewhere so we can use your gem unmodified.
I'm getting a
Encoding::UndefinedConversionError
exception when trying to cache GitHub responses. Some responses will be cached, but some will fail to write because of an encoding conversion issue.I'm using faraday 0.8.8 and faraday-http-cache 0.4.0 and here's the backtrace.
Any help would be greatly appreciated.
The text was updated successfully, but these errors were encountered: