rust-lang/crates.io

internal server error when searching "using"

Virv12 opened this issue · 2 comments

Current Behavior

Searching on crates.io "using" sometimes fails with "Unfortunately something went wrong while loading the search results. Feel free to try again, or let the crates.io team know if the problem persists.".

Expected Behavior

I expect to receive the list of results for the search.

Steps To Reproduce

  1. Open crates.io
  2. Search "using"
  3. Repeat until the bug happens (I haven't found a reliable way to reproduce the bug)

Environment

  • Browser: Mozilla Firefox 125.0.3
  • OS: Arch Linux

Anything else?

The bug is also reproducible using curl (version 8.7.1) but again, it's not reproducible reliably.

$ curl -i 'https://crates.io/api/v1/crates?page=1&per_page=10&q=using'
HTTP/2 500
content-type: application/json
content-length: 47
server: Cowboy
report-to: {"group":"heroku-nel","max_age":3600,"endpoints":[{"url":"https://nel.heroku.com/reports?ts=1714613192&sid=af571f24-03ee-46d1-9f90-ab9030c2c74c&s=grlcbrCy8RyTNH
hlRHOj7r0XxB7mPOnJys3NmceVue8%3D"}]}
reporting-endpoints: heroku-nel=https://nel.heroku.com/reports?ts=1714613192&sid=af571f24-03ee-46d1-9f90-ab9030c2c74c&s=grlcbrCy8RyTNHhlRHOj7r0XxB7mPOnJys3NmceVue8%3D
nel: {"report_to":"heroku-nel","max_age":3600,"success_fraction":0.005,"failure_fraction":0.05,"response_headers":["Via"]}
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: *
date: Thu, 02 May 2024 01:26:41 GMT
via: 1.1 vegur, 1.1 b4d7638ad0954d68fd3ef6e7a67ce27e.cloudfront.net (CloudFront)
vary: accept-encoding
x-cache: Error from cloudfront
x-amz-cf-pop: FCO50-C2
x-amz-cf-id: 8-o6zRq-Wdt247LL5cxj8ByqaIo9xZkYaUTQrEIjLC_BzziZ-59LnQ==

{"errors":[{"detail":"Internal Server Error"}]}%

the internal server errors are unfortunately caused by performance issues with our database. we are looking into ways to improve the performance but have only made minor progress so far.

we've upgraded our database server to give it a bit more resources. it seems that this might have helped. the performance of some search queries is still not great, but at least it's causing a lot less errors at this point :)