oracle / opengrok

OpenGrok is a fast and usable source code search and cross reference engine, written in Java
http://oracle.github.io/opengrok/
Other
4.33k stars 746 forks source link

freshly added project cannot be marked as indexed #3893

Open vladak opened 2 years ago

vladak commented 2 years ago

When running indexer with -P -S -H -W ... -U ... , freshly cloned project cannot be marked as indexed because the new configuration has not arrived to the web app yet:

INFO: Done indexing of directory /dpdk-next-net (took 0:03:22)
Feb 11, 2022 10:29:48 PM org.opengrok.indexer.index.IndexDatabase markProjectIndexed
WARNING: Could not notify the webapp that project org.opengrok.indexer.configuration.Project@7425fe98 was indexed: InboundJaxrsResponse{context=ClientResponse{method=PUT, uri=http://localhost:8080/source/api/v1/projects/dpdk-next-net/indexed, status=404, reason=Not Found}}
Feb 11, 2022 10:29:49 PM org.opengrok.indexer.index.IndexDatabase optimize
INFO: Optimizing the index for project dpdk-next-net

This is fixed at the end of the indexing by sending the new configuration to the web app however it can do better than that. prepareIndexer() / addProjects() should do API call to add the project/repositories to the web app so that the mark-as-indexed API call does not fail.

kalpeshsomani007 commented 1 year ago

@vladak how it's fixed in the latest version 1.8.2 also i am facing error

any command need to improve ??

I have followed below command java -jar dist/lib/opengrok.jar -c /usr/local/bin/ctags -s src/hellogitworld -d data -H -P -S -G -W etc/configuration.xml -U http://localhost:8080/source

vladak commented 1 year ago

The issue is still open, so it's not fixed yet. What sort of problem do you see exactly ?

brenwhyte commented 5 months ago

Stumbled across this issue today, least it appears to be the same issue I'm having.

What info do you need to aid in a fix?

vladak commented 5 months ago

Stumbled across this issue today, least it appears to be the same issue I'm having.

What info do you need to aid in a fix?

This is a merely a warning. Even if the project was added in the initial phase of the indexing when it is discovered, it would not be visible in the UI/API until it is indexed. Why do you think it is a problem for your use case ?

Thinking of this issue again, I don't think the indexer should be using API call to the webapp to add the project and repositories as it would be basically duplication of the work the indexer has already done (and sending partial configuration is not possible). If anything, the indexer might use a API call to check whether the project is known in the webapp and do not attempt to mark it as indexed if it is not known. This would make the warning disappear but that's it.

brenwhyte commented 5 months ago

For me at least, it appears if I omit History -H the configuration.xml gets uploaded to the webserver just fine. The indexing appears to be fine.

vladak commented 5 months ago

For me at least, it appears if I omit History -H the configuration.xml gets uploaded to the webserver just fine. The indexing appears to be fine.

Yep, the warning message is innocuous, unless you care a lot about how fast the indexed project appears in the UI.