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

Already on GitHub? Sign in to your account

DOWNLOAD_ERROR exceptions being thrown during facial recognition API calls #2

Closed
mcginty opened this Issue Mar 5, 2012 · 8 comments

Comments

Projects
None yet
2 participants
Member

mcginty commented Mar 5, 2012

Seems to happen on and off. We should find root cause soon, even if it's just "it happens from time to time." Example tweet:

[ :) ] text score: 4      tweet: RT @SpeakingTeenz: #YouProbablyShouldnt leave someone you love for someone you like.
[ :) ] img score: 41.0    url: http://a0.twimg.com/profile_images/1863592888/4llF2iLb
[erro] Exception caught (Error: 30, DOWNLOAD_ERROR)
[erro]     /Users/dakewiemcsquintpants/.rvm/gems/ruby-1.9.3-p125/gems/face-0.0.4/lib/face/client/utils.rb:36:in `make_request'
[erro]     /Users/dakewiemcsquintpants/.rvm/gems/ruby-1.9.3-p125/gems/face-0.0.4/lib/face/client/recognition.rb:7:in `faces_detect'
[erro]     /Users/dakewiemcsquintpants/git/twitter-sentiment/lib/twitter-sentiment/input/face_recon.rb:24:in `detect_faces'
[erro]     /Users/dakewiemcsquintpants/git/twitter-sentiment/lib/twitter-sentiment/parser/face_recon.rb:41:in `profile_image_happiness'
[erro]     /Users/dakewiemcsquintpants/git/twitter-sentiment/lib/twitter-sentiment/parser/user_info.rb:21:in `gather'
[erro]     app.rb:41:in `block in initialize'
[erro]     /Users/dakewiemcsquintpants/git/twitter-sentiment/lib/twitter-sentiment/input/twitter.rb:34:in `call'
[erro]     /Users/dakewiemcsquintpants/git/twitter-sentiment/lib/twitter-sentiment/input/twitter.rb:34:in `block in initialize'
[erro]     /Users/dakewiemcsquintpants/.rvm/gems/ruby-1.9.3-p125/gems/tweetstream-1.1.3/lib/tweetstream/client.rb:380:in `block (2 levels) in start'
[erro]     /Users/dakewiemcsquintpants/.rvm/gems/ruby-1.9.3-p125/gems/twitter-stream-0.1.14/lib/twitter/json_stream.rb:277:in `call'
[erro]     /Users/dakewiemcsquintpants/.rvm/gems/ruby-1.9.3-p125/gems/twitter-stream-0.1.14/lib/twitter/json_stream.rb:277:in `parse_stream_line'
[erro]     /Users/dakewiemcsquintpants/.rvm/gems/ruby-1.9.3-p125/gems/twitter-stream-0.1.14/lib/twitter/json_stream.rb:208:in `block in receive_stream_data'
[erro]     /Users/dakewiemcsquintpants/.rvm/gems/ruby-1.9.3-p125/gems/twitter-stream-0.1.14/lib/twitter/json_stream.rb:207:in `each'
[erro]     /Users/dakewiemcsquintpants/.rvm/gems/ruby-1.9.3-p125/gems/twitter-stream-0.1.14/lib/twitter/json_stream.rb:207:in `receive_stream_data'
[erro]     /Users/dakewiemcsquintpants/.rvm/gems/ruby-1.9.3-p125/gems/twitter-stream-0.1.14/lib/twitter/json_stream.rb:121:in `call'
[erro]     /Users/dakewiemcsquintpants/.rvm/gems/ruby-1.9.3-p125/gems/twitter-stream-0.1.14/lib/twitter/json_stream.rb:121:in `<<'
[erro]     /Users/dakewiemcsquintpants/.rvm/gems/ruby-1.9.3-p125/gems/twitter-stream-0.1.14/lib/twitter/json_stream.rb:121:in `receive_data'
[erro]     /Users/dakewiemcsquintpants/.rvm/gems/ruby-1.9.3-p125/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:in `run_machine'
[erro]     /Users/dakewiemcsquintpants/.rvm/gems/ruby-1.9.3-p125/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:in `run'
[erro]     /Users/dakewiemcsquintpants/.rvm/gems/ruby-1.9.3-p125/gems/tweetstream-1.1.3/lib/tweetstream/client.rb:338:in `start'
[erro]     /Users/dakewiemcsquintpants/.rvm/gems/ruby-1.9.3-p125/gems/tweetstream-1.1.3/lib/tweetstream/client.rb:122:in `filter'
[erro]     /Users/dakewiemcsquintpants/.rvm/gems/ruby-1.9.3-p125/gems/tweetstream-1.1.3/lib/tweetstream/client.rb:89:in `track'
[erro]     /Users/dakewiemcsquintpants/git/twitter-sentiment/lib/twitter-sentiment/input/twitter.rb:28:in `initialize'
[erro]     app.rb:16:in `new'
[erro]     app.rb:16:in `initialize'
[erro]     app.rb:55:in `new'
[erro]     app.rb:55:in `<main>'
[info] NEW TWEET

@ghost ghost assigned scowalt Mar 5, 2012

Member

scowalt commented Mar 5, 2012

In general, this error happens when the Face API can't pull the image from the server to analyze it. In this specific example, the API may have been confused by the lack of an image file extension at the end of the link. This appears to be a recurring pattern

Member

mcginty commented Mar 5, 2012

Hmm. Should we look into tricking it with some URL demonry? Can potentially append a &x=.jpg to make the string be a legitimate url, and end in a legitimate image extension. Might be worth looking into, but not sure if it's totally worth the trouble.

Member

mcginty commented Mar 5, 2012

Err, ?x=.jpg, not &x=.jpg

Member

scowalt commented Mar 5, 2012

In general, strings without the file extension tend to be .PNG files. I'm going to try appending .png to any file that's not a .JPG. This should take care of a fair portion of these errors

Member

mcginty commented Mar 5, 2012

Great, let's hope it works!

Member

scowalt commented Mar 5, 2012

Adding the .png tag to an image in this manor makes twitter very unhappy. For example:

http://a0.twimg.com/profile_images/1863592888/4llF2iLb
http://a0.twimg.com/profile_images/1863592888/4llF2iLb.png

Not sure where to go from here

scowalt added a commit that referenced this issue Mar 5, 2012

Member

scowalt commented Mar 5, 2012

This issue should be resolved with the latest commit. I'm not quite sure how that tag works, but I was even able to add it to the end of .jpg url's without issue

@scowalt scowalt closed this Mar 5, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment