snarfed / bridgy

📣 Connects your web site to social media. Likes, retweets, mentions, cross-posting, and more...
https://brid.gy
Creative Commons Zero v1.0 Universal
723 stars 52 forks source link

received a comment from Instagram with no author #342

Closed kylewm closed 9 years ago

kylewm commented 9 years ago

Very odd, I got an IG comment from Bridgy with no author

original: http://instagram.com/p/xw9Dtqo1BP/ bridgy: https://brid-gy.appspot.com/comment/instagram/kylewm2/896484861876064335_504077259/896499121335260096

kylewm commented 9 years ago

nothing exciting in the logs, and the output from the API looks normal


{
  "meta": {
    "code": 200
  },
  "data": {
    "attribution": null,
    "tags": [
      "catonaleash"
    ],
    "type": "image",
    "location": null,
    "comments": {
      "count": 1,
      "data": [
        {
          "created_time": "1421091045",
          "text": "#theterrorof1212",
          "from": {
            "username": "adriennefriend",
            "profile_picture": "https://igcdn-photos-e-a.akamaihd.net/hphotos-ak-xaf1/t51.2885-19/10540320_549254438513380_1691539553_a.jpg",
            "id": "1439500080",
            "full_name": "adrienne"
          },
          "id": "896499121335260096"
        }
      ]
    },
I 18:31:39.825 2015-01-12  200     521 B   381ms /comment/instagram/kylewm2/896484861876064335_504077259/896499121335260096
  63.82.2.194 - - [12/Jan/2015:18:31:39 -0800] "GET /comment/instagram/kylewm2/896484861876064335_504077259/896499121335260096 HTTP/1.1" 200 521 - "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:34.0) Gecko/20100101 Firefox/34.0" "brid-gy.appspot.com" ms=381 cpu_ms=70 cpm_usd=0.000134 instance=00c61b117c4cba92e9dfaf215f60b02112f5e5a8 app_engine_release=1.9.17
    I 18:31:39.470 Fetching instagram:kylewm2 comment ('896484861876064335_504077259', '896499121335260096')
    I 18:31:39.473 Fetching https://api.instagram.com/v1/media/896484861876064335_504077259?access_token=5040..., kwargs {}
    I 18:31:39.696 Fetching https://api.instagram.com/v1/media/896484861876064335_504077259?access_token=5040..., kwargs {}
    I 18:31:39.807 starting posse post discovery with syndicated http://instagram.com/p/xw9Dtqo1BP/
    D 18:31:39.819 posse post discovery found relationship(s) http://instagram.com/p/xw9Dtqo1BP/ -> https://kylewm.com/2015/01/wth-she-darted-under-the-car-when-i-wasn-t-looking
    I 18:31:39.822 After original post discovery, urls are: set([u'https://kylewm.com/2015/01/wth-she-darted-under-the-car-when-i-wasn-t-looking'])
kylewm commented 9 years ago

oh wow, but I did happen to notice a HTTP 500 Internal Server Error polling my instagram account. Seems likely related.

E 18:28:31.442 2015-01-12  500     176 B   572ms /_ah/queue/poll
  0.1.0.2 - - [12/Jan/2015:18:28:31 -0800] "POST /_ah/queue/poll HTTP/1.1" 500 176 "http://www.brid.gy/_ah/queue/poll" "AppEngine-Google; (+http://code.google.com/appengine)" "www.brid.gy" ms=572 cpu_ms=233 cpm_usd=0.000056 queue_name=poll task_name=15729741887416455401 instance=00c61b117c5804bf6bbd2cfefe1e2d7a0abd47a7 app_engine_release=1.9.17
    D 18:28:30.873 Params: UnicodeMultiDict([(u'last_polled', u'2015-01-13-02-14-08'), (u'source_key', u'aglzfmJyaWQtZ3lyFgsSCUluc3RhZ3JhbSIHa3lsZXdtMgw')])
    I 18:28:30.877 Source: Kyle Mahan (Instagram) kylewm2, http://www.brid.gy/instagram/kylewm2
    D 18:28:30.877 Using ETag None, last activity id 896484861876064335_504077259
    I 18:28:30.880 Fetching https://api.instagram.com/v1/users/self/media/recent/?access_token=5040..., kwargs {}
    W 18:28:31.153 Error 500, response body: Internal Server Error
    W 18:28:31.153 Error 500, response body: Internal Server Error
    E 18:28:31.411 HTTP Error 500: Internal Server Error
      Traceback (most recent call last):
        File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1511, in __call__
          rv = self.handle_exception(request, response, e)
        File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1505, in __call__
          rv = self.router.dispatch(request, response)
        File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1253, in default_dispatcher
          return route.handler_adapter(request, response)
        File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1077, in __call__
          return handler.dispatch()
        File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 547, in dispatch
          return self.handle_exception(e, self.app.debug)
        File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 545, in dispatch
          return method(*args, **kwargs)
        File "/base/data/home/apps/s~brid-gy/3.381426751488396480/tasks.py", line 113, in post
          source_updates.update(self.poll(source))
        File "/base/data/home/apps/s~brid-gy/3.381426751488396480/tasks.py", line 165, in poll
          cache=cache)
        File "/base/data/home/apps/s~brid-gy/3.381426751488396480/instagram.py", line 68, in get_activities_response
          return self.as_source.get_activities_response(*args, group_id=SELF, **kwargs)
        File "/base/data/home/apps/s~brid-gy/3.381426751488396480/activitystreams/instagram.py", line 166, in get_activities_response
          raise e
      HTTPError: HTTP Error 500: Internal Server Error
kylewm commented 9 years ago

oops I was incorrectly addressing the "user" field instead of the "from" field to determine comment authors. fixed in https://github.com/snarfed/activitystreams-unofficial/commit/2e08205e132c6286d8ccc826d1c76b7991c16071

I do not think this is related to the 500 Internal Server Error. Maybe spurious?