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

Search Returns 500 Error #59

Open
sixcircuit opened this issue Aug 26, 2019 · 7 comments · May be fixed by #228
Open

Search Returns 500 Error #59

sixcircuit opened this issue Aug 26, 2019 · 7 comments · May be fixed by #228
Labels
bug Something isn't working

Comments

@sixcircuit
Copy link

sixcircuit commented Aug 26, 2019

Thanks for building this and providing it to the world for free.

Context (Environment)

Heroku

Expected Behavior

Get some search results

Actual Behavior

We get the standard app 500 page.

The logs just say:

 error: Error when searching for test, Error: <HTML>
 <HEAD>
 <TITLE>Bad Request</TITLE>
 </HEAD>
 <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
 <H1>Bad Request</H1>
 <H2>Error 400</H2>
 </BODY>
 </HTML>

To Reproduce

You'd have to login to our site, but I'm happy to do any debugging you suggest.

Additional Information

We use a shared folder, not a team drive.
Everything else seems to work.
I didn't setup the indexes (the optional step)
I searched around and couldn't find any info anywhere about this.

@sixcircuit sixcircuit added the bug Something isn't working label Aug 26, 2019
@afischer
Copy link
Member

Hi @sixcircuit, thanks for the bug report! A few questions: Is the error page being shown for all searches on your site, or just specific queries?

That 400 looks like it may be being returned from the Google API — could you check your GCP API console and see if there are any 4xx errors being reported?

Thanks!

@sixcircuit
Copy link
Author

sixcircuit commented Aug 26, 2019 via email

@sixcircuit
Copy link
Author

Hi Again.

My boss did some debugging:

I played with it today. I took everything out and added it back in one folder at a time. I didn’t have any search problems until I added the last two folders. I played around with what folders were in vs out and it didn’t seem like any one folder was causing problems with search. The problem arose when all 8 folders were in. There were some words that I could search and other words that I couldn’t search when 7 of the 8 folders were in. I didn’t encounter any search issues when adding folders 1-6. Are you aware of any capacity constraints that could be causing the search problem?

Thanks for any help.

@afischer
Copy link
Member

Interesting... Would you mind sharing what those search terms/folder names were? Do those folders or files have any special characters in them?

It would be great to create a reproducible way of triggering this error.

@ghost
Copy link

ghost commented Sep 4, 2019

My Library has 8 folders. When all 8 of the folders are in, I cannot search the four terms below. When any combination of 7 folders are in, I can search the terms with no problem. I only have 7 folders in at the moment so that I can use it, but I can add the 8th if it'd be helpful for recreating the issue.

Invisalign
Composite
Style guide
SPP

@MennoTammens
Copy link

We have a similar problem.
The search function lists all folders and adds these to the final query as:

(
  '1234567890ABCDEFGHIJKLMNOP' in parents or 
  '134567890ABCDEFGHIJKLMNOPQ' in parents or 
  '14567890ABCDEFGHIJKLMNOPQR' in parents or 
  '1567890ABCDEFGHIJKLMNOPQRS' in parents or 
  '167890ABCDEFGHIJKLMNOPQRST' in parents
)

https://github.com/nytimes/library/blob/master/server/search.js#L93

When the number of folderIds grows too large, this error comes from the Drive API:

status: 413,
statusText: 'Request Entity Too Large'

The limit seems to be around 100 folderIds

@tarekrached
Copy link
Contributor

We are also seeing this with a lot of folder ids, same situation as @MennoTammens

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants