lemmy
lemmy copied to clipboard
[Bug]: 0.18.0 search is returning "couldnt_find_object" error
Requirements
- [X] Is this a bug report? For questions or discussions use https://lemmy.ml/c/lemmy_support
- [X] Did you check to see if this issue already exists?
- [X] Is this only a single bug? Do not put multiple bugs in one issue.
- [X] Is this a backend issue? Use the lemmy-ui repo for UI / frontend issues.
Summary
Lemmy.ml since 0.18rc6 and now 0.18.0 final release is showing this error on search.
Steps to Reproduce
- visit: https://lemmy.ml/search?q=pg_stat_statements&type=All&listingType=All&page=1&sort=TopAll
- See error on bottom left "toast" messages
- Try to refresh the web page with browser
The error is intermitent, but happening 3 out of 4 times in current testing. Also try logged-in vs. incognito.
Technical Details
Non-mobile web browser client. Logged-in.
Version
BE 0.18.0
Lemmy Instance URL
lemmy.ml
it happens with me too... kinda sucks
For the record, when it was "release candidate 6" (24 hours ago), I described this problem on Lemmy:
https://lemmy.ml/comment/873744
For weeks the front-page crashes on every major Lemmy instance with 'nginx 500' errors and the data replication failures of comments and postings has gone ignored. At first, I had assumed the long-term developers were spot-checking the data and seeing these problems... but I changed my stance after watching it go on for weeks.
8 days ago I made a lot of noise about the 'nginx 500' errors being ignored: https://lemmy.ml/post/1271936
This is impacting the entire federation community reputation. The number of active users, new comments, new postings is really not that high. Yesterday Reddit had a 10,000 comment posting in /r/news about the submarine implosion evidence being found. Lemmy doesn't have postings with more than 1100 comments on Lemmy.ml - and is not holding up to the load.
Why are nginx logs and lemmy_server application logs not being posted by the established players so that we can all get eyes on the internal Rust code faults and causes to these errors?
Ok I've dug into this a bit and it looks like it's the part of the code where it's trying to figure out if the search text is more than just text. EG: if it's a URL or a community (starting with !
) or a user (starting with @
). The problem is that the query for that returns an error if it's not any of those which causes the couldnt_find_object
error. This API endpoint is /resolve_object
.
From my testing, if you put in a random string it will fail every time.
Probably the easiest fix is that we suppress the error and return an empty result as the only usage of this code is in the search function which really doesn't need to know if the API failed to parse the given text. I've created a PR which does this but I'm not convinced it's the right approach. Looking for input there.
The other issue is that it looks like it sends the search query twice when you click search (thus getting two errors each time you click). I've created a separate issue for that.
You do need to be logged in for this bug to occur as the resolve_object
endpoint is only called when you're authenticated (eg: logged in).
Ok, maybe the problem is context, of navigation.
If you open the page from Github here, it errors: https://lemmy.ml/search?q=pg_stat_statements&type=All&listingType=All&page=1&sort=TopAll
But if you are on lemmy.ml website and you click on the search in the upper right and put in your term, you land on the same URL - but no error and it returns results.
SO you can't post or share a Link to Lemmy search?
There is still an error when the page is loaded, it appears as a toast on the bottom left.
Yha, I see the toast, but it isn't the full-page error and I get actual search results. Do you have to go through pre-page navigation like I do to get search output?
The handling is different when you load the page with the query parameters on it but the error is the same (effectively).
I've made a PR in lemmy-ui which kinda fixes it. I'm still looking at a few cases where it doesn't seem to load correctly.