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

DelayedJob crash if it failed to write error log #65

Open
guoyk93 opened this issue Sep 11, 2014 · 0 comments
Open

DelayedJob crash if it failed to write error log #65

guoyk93 opened this issue Sep 11, 2014 · 0 comments

Comments

@guoyk93
Copy link

guoyk93 commented Sep 11, 2014

Problem is described below.

  1. Server try to fetch a JSON object of user information from a remote server. However some special character (maybe utf8mb4) make JSON.parse raise a error.
  2. DelayedJob caught the error thrown above, then try to write the stack trace into last_error field of table.
  3. MySQL backend of ActiveRecord happend to be in UTF8 encoding, it throw a error.
  4. WHOLE running DelayedJob instance crashed and stopped.

I think some where need a 'begin ... rescue`

log writing failed. "\xEF" from ASCII-8BIT to UTF-8
Mysql2::Error: Incorrect string value: '\xF0\x9F\x92\x85 \xE1...' for column 'last_error' at row 1: UPDATE `delayed_jobs` SET `attempts` = 1, `last_error` = '757: unexpected token at \'{\"subscribe\":1,\"openid\":\"o6uLOt6Z3zaXfWBBcz4Z4Gz3PmP8\",\"nickname\":\" 麦小喵💅 ღ奶酪酱💋\",\"sex\":2,\"language\":\"zh_CN\",\"city\":\"\",\"province\":\"\",\"country\":\"斐 ....
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

1 participant