-
-
Notifications
You must be signed in to change notification settings - Fork 595
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
Deleted projects still returned by search api #1605
Comments
Thanks for reporting. Are there any errors in the logs? |
Sounds like a possible defect. |
Which logs should I ask our IT team to send me? Further information: The results were as follows: In the results, the two items show different names. This is due to me trying to clarify which distinct product - all under the same name but built specifically for different OEMs - in the project list. The first import just showed 650 items all called PRODUCTNAME. I deleted them and tried with PRODUCTNAME (OEM), which seems to help. However, I was also trying to get my import to detect the first PRODUCTNAME (OEM) and add the one I was about to import as a child project. This was after trying to detect PRODUCTNAME (OEM) and issue an update to provide a new VERSION and sBom. |
I guess one thing that would be wonderful would be a script to clear all the projects and metrics in the MySQL db and then do a single 'correct' import. |
Some 'interesting' things in the dptrack_apiserver.log file:
Then, from 3:21pm on 9th May I see many, many of: Does this point to anything? |
Yes, likely a performance issue on the DT server. It appears that there's a backlog of components being analyzed and hasn't been able to keep up. As a result, when project deletion is requested, its failing due to components in that project being in the queue for being analyzed. Some of this will get better with 4.5 and further improvements in 4.6, but optimizing the type of host DT is running on along with optimizing the database instance can go a long way. Because of this, I'd recommend deletion from the database directlt. |
OK, thanks for that update. In my earlier comment, #1605 (comment), I included the output of the API, including a uuid of That uuid is not in the db, but the api still returns it. I've perused the code and it seems to refer to an indexing service. What is this? Is it possible that I've stuffed the index server somehow and need to refresh it? Is the api not going directly to the db but some sort of index that I've managed to break? |
Good observation! DT uses Lucene for searches. It's file-based, the indexes are located at As far as the actual problem goes: Modifications to the index must be committed in order to take effect. It looks like project deletions are currently written to the index, but never committed. I'll submit a PR for this. Another issue is that operations on the index are performed asynchronously in a thread pool of size 1. I think this is done to avoid race conditions. However, the same thread is also busy with mirroring the NVD (and in v4.5.0 EPSS as well). This means index operations are delayed until NVD mirroring is completed, which can take a rather long time, depending on your internet connection and CPU/RAM. |
Fixes DependencyTrack#1605 Signed-off-by: nscuro <[email protected]>
Ok, thanks for the suggestion. I’ll give it a go in the morning and update you on the results.
… On 11 May 2022, at 20:00, Niklas ***@***.***> wrote:
Good observation! DT uses Lucene for searches. It's file-based, the indexes are located at /data/.dependency-track/index/ (assuming you've deployed DT as container). To resolve the current situation, delete the index directory and restart DT. Indexes will be recreated on startup.
As far as the actual problem goes: Modifications to the index must be committed in order to take effect. It looks like project deletions are currently written to the index, but never committed. I'll submit a PR for this.
Another issue is that operations on the index are performed asynchronously in a thread pool of size 1. I think this is done to avoid race conditions. However, the same thread is also busy with mirroring the NVD (and in v4.5.0 EPSS as well). This means index operations are delayed until NVD mirroring is completed, which can take a rather long time, depending on your internet connection and CPU/RAM.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.
|
" To resolve the current situation, delete the index directory and restart DT. Indexes will be recreated on startup." This appears to have worked. Thanks for your help - and for responding so quickly. |
@IanBUK Thank you for reporting! :) |
Signed-off-by: nscuro <[email protected]>
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Ive got Dependency Track v 4.4.2 set up with a MySQL db, and have been round a loop of importing projects and then deleting them - both vis the api. This has been in attempting to work out a parent/child relationship. Now, when I search with the API for a project, I get all the deleted instances - as shown by their UUIDs. For example, create projectX, version 1.0, 1.2 and 1.3. via the api. Next delete them via the api. Now, add them again via the api. Now, search for projectX via the api. I get six records, two for each version, each with different UUIDs. If I call GetProject with these UUIDs, I get a "project not found" error, and if I use the console, they're not shown.
The text was updated successfully, but these errors were encountered: