adhocteam / nytimes-library

A collaborative documentation site, powered by Google Docs.
https://nyt-library-demo.herokuapp.com/
Apache License 2.0
1 stars 1 forks source link

Content Library: many searches causing 500s #72

Closed gunsch closed 1 year ago

gunsch commented 2 years ago

i.e. https://content-library.adhoc.pizza/search?q=accessibility&types=

triggers a 500 :(

timwright12 commented 2 years ago

Not sure hoe helpful this is for debugging, but in testing this a little further and there are some substrings in "accessibility" that throw the 500 error as well:

Fail (500 error):

Pass (returns):

Single letters that throw a 500 error:

timwright12 commented 2 years ago

Error from the log:

    error: {
      errors: [
        {
          domain: 'global',
          reason: 'invalid',
          message: 'Invalid Value',
          locationType: 'parameter',
          location: 'pageToken'
        }
      ],
      code: 400,
      message: 'Invalid Value'
    }
bkjohnson commented 1 year ago

So far it seems like what's used in a deployment doesn't match code that's used when running things locally. I removed this entire chunk from the handlePage function which handles when the /search page is hit:

https://github.com/adhocteam/nytimes-library/blob/b4cb37120482ca26e1a785a2429bcfb6c362bfcb/custom/routes/pages.js#L33-L62

Locally I end up with something like this (notice the "hello" in the query params):

The server running locally with the `/search` page open in the browser. The query string in the URL shows that "hello" was the search term, but the page shows that an empty string was used.

But when I deploy the code to a dev environment using gcloud, nothing changes. I still get the 500 error on search terms that I would get it on previously, and I still get search results on terms that worked previously.

timwright12 commented 1 year ago

@bkjohnson maybe some heavy caching that needs to be cleared out?