dub-registry icon indicating copy to clipboard operation
dub-registry copied to clipboard

Internal Server Error caused by searching

Open dokutoku opened this issue 3 years ago • 7 comments

Some search terms may cause server errors. For example, a search for excel-d resulted in the following message.

500 - Internal Server Error

Internal Server Error

Internal error information:
vibe.db.mongo.connection.MongoDriverException@/root/.dub/packages/vibe-d-0.9.2/vibe-d/mongodb/vibe/db/mongo/cursor.d(304): Query failed. Does the database exist?
----------------
??:? [0x555f217e44c5]
??:? [0x555f2180ab36]
??:? [0x555f217ef2ed]
/root/ldc2-1.22.0-linux-x86_64/bin/../import/std/exception.d:517 [0x555f212647e5]
/root/ldc2-1.22.0-linux-x86_64/bin/../import/std/exception.d:437 [0x555f21257315]
/root/.dub/packages/vibe-d-0.9.2/vibe-d/mongodb/vibe/db/mongo/cursor.d:304 [0x555f212b957d]
/mnt/c/Users/soenke/develop/0-dlang/dub-registry/source/app.d:462 [0x555f212ba020]
/mnt/c/Users/soenke/develop/0-dlang/dub-registry/source/app.d:322 [0x555f212b9e47]
/mnt/c/Users/soenke/develop/0-dlang/dub-registry/source/app.d:367 [0x555f212e0e06]
/root/.dub/packages/vibe-d-0.9.2/vibe-d/mongodb/vibe/db/mongo/cursor.d:233 [0x555f212b906d]
/root/.dub/packages/vibe-d-0.9.2/vibe-d/mongodb/vibe/db/mongo/cursor.d:60 [0x555f211e84dd]
/root/ldc2-1.22.0-linux-x86_64/bin/../import/std/algorithm/iteration.d:615 [0x555f212dfef8]
/root/ldc2-1.22.0-linux-x86_64/bin/../import/std/array.d:138 [0x555f211e2bf2]
/mnt/c/Users/soenke/develop/0-dlang/dub-registry/source/dubregistry/dbcontroller.d:333 [0x555f2119ac60]
/mnt/c/Users/soenke/develop/0-dlang/dub-registry/source/dubregistry/registry.d:103 [0x555f211688d3]
/mnt/c/Users/soenke/develop/0-dlang/dub-registry/source/dubregistry/web.d:476 [0x555f21168837]
/root/.dub/packages/vibe-d-0.9.2/vibe-d/web/vibe/web/web.d:1043 [0x555f21210e3a]
/root/.dub/packages/vibe-d-0.9.2/vibe-d/web/vibe/web/web.d:214 [0x555f21210a43]
router.d:218 [0x555f21651db4]
router.d:674 [0x555f216543d6]
router.d:607 [0x555f21651a86]
router.d:211 [0x555f2165183e]
server.d:2272 [0x555f21659a85]
server.d:247 [0x555f21657ebe]
server.d:239 [0x555f2165777b]
server.d:2028 [0x555f21661dce]
task.d:706 [0x555f2174d435]
task.d:724 [0x555f2174a011]
task.d:433 [0x555f217497fe]
??:? [0x555f217e55d8]

dokutoku avatar Jan 28 '21 09:01 dokutoku

it appears to be the presence of - in the query string

thewilsonator avatar May 03 '21 08:05 thewilsonator

Maybe this will be solved using the new experimental search?

I haven't tested tho

Imperatorn avatar May 12 '21 11:05 Imperatorn

as mentioned in #498 quoting seems to work: "excel-d"

WebFreak001 avatar May 20 '21 22:05 WebFreak001

as mentioned in #498 quoting seems to work: "excel-d"

I encountered this issue with glfw-d, adding the quotes worked as well (both double and single, the later being a non-exact search).

After a quick search, it may have something to do with how MongoDB treats hyphens as a negator (see: https://docs.mongodb.com/manual/text-search/#term-exclusion).

Searching for glfw -d, glfw -dynamic both worked as per the above documentation.

summer-alice avatar Jun 21 '21 01:06 summer-alice

I would like to add that the query d-properties also caused this error response.

andrewlalis avatar Oct 17 '21 10:10 andrewlalis

searching for d gives the same error:

https://code.dlang.org/search?q=d (500)
https://code.dlang.org/search?q=a+b+c+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z (works)
https://code.dlang.org/search?q=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z (does not work)

huglovefan avatar Mar 02 '22 19:03 huglovefan

I think the issue there is that there are too many matches (breaks the mongodb call somehow)

WebFreak001 avatar Mar 02 '22 19:03 WebFreak001