ampproject / error-reporting

Contains production error tracking issues.
Apache License 2.0
2 stars 5 forks source link

🚨 Error: Unexpected token f in JSON at position 7610 #96

Closed ampprojectbot closed 3 years ago

ampprojectbot commented 3 years ago

Details

Error report: link First seen: Jul 12, 2021 Frequency: ~ 1,484/day

Stacktrace

Error: Unexpected token f in JSON at position 7610
    at unexpected-token-f-in-json-at-position-7610.js:1:1

/cc @ampproject/release-on-duty

rsimha commented 3 years ago

I took a peek at the referrer URL for this error and discovered that the error is due to non-escaped quotes. For example...

Referrer URL: link

Console error: image

Offending code: (note unescaped quote in the caption text)

            {
              "type": "small",
              "msid":  "84047177",
              "title": "Signs you're the MOM among your friends",
              "caption": "In every group of friends, we find different individuals. One maybe the "food guy" , some maybe the "among us people", but one friend who we find in every group is "MOM" friend. Here are few signs that you are the mom friend of your group. ",
              "url": "https://timesofindia.indiatimes.com/life-style/relationships/web-stories/signs-youre-the-mom-among-your-friends/photostory/84047177.cms",
              "image": "https://timesofindia.indiatimes.com/photo/84047177.cms",
              "image_thumb": "https://static.toiimg.com/thumb/msid-84047177,width=600,resizemode=3/84047177.jpg",
              "author": "Timesofindia",
              "published_date": "2021-07-03T10:00:00+05:30",
              "image_credit":"Timesofindia"
            }

Could someone from @ampproject/wg-stories comment on whether this is a problem with the published page itself, or whether there's a missing escaping step in one of AMP's components?

gmajoulet commented 3 years ago

It's publisher related. I'm surprised the error isn't caught, I just checked and there's a bunch of try/catch supposed to handle that. @mszylkowski this is low priority but if you have 10 minutes can you look into this? I'm tempted to close but I'll let you do it.

mszylkowski commented 3 years ago

Agree with @gmajoulet, the publisher has fixed the error within 1 day, and it makes sense that this error is thrown so they can also see that the JSON is not properly formatted (either in their own logs or on the story directly). Didn't investigate why the error is not being caught properly, but unless we start seeing multiple errors like this one on this repo, it has pretty low impact. Will close. If we see more errors like these, we can fix them with user errors.