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.36k stars 748 forks source link

Unable to get history and annontate works (Bugzilla #3401) #582

Closed vladak closed 5 years ago

vladak commented 11 years ago

status NEW severity critical in component webapp for 0.11 Reported in version unspecified on platform ANY/Generic Assigned to: Trond Norbye

Original attachment names and IDs:

On 2008-09-11 14:52:23 +0000, Emilio Monti wrote:

When using an external repository the history and annontate links are dim.

This is due to "HistoryGuru.getInstance().hasHistory(resourceFile)" returning false. That is due to "getRepository(file)" returning null. That is due to "RuntimeEnvironment.getInstance().getRepositories()" being an empty map. Basically, it seems that "WebappListener" is not correctly initing the "HistoryParser" instance calling its addRepositories method. In the current stable release of OpenGrok this was done calling "HistoryGuru.getInstance().addExternalRepositories(source)" in "WebappListener".

This could have happened because of this change: http://cvs.opensolaris.org/source/diff/opengrok/trunk/src/org/opensolaris/opengrok/web/WebappListener.java?r2=/opengrok/trunk/src/org/opensolaris/opengrok/web/WebappListener.java@423&r1=/opengrok/trunk/src/org/opensolaris/opengrok/web/WebappListener.java@290

Solution: Add a call to HistoryGuru.getInstance().addRepositories(source); in WebappListener.

On 2008-09-16 01:47:59 +0000, Trond Norbye wrote:

I believe this will work if you use the configuration file. Could you please verify that this doesn't work with Perforce repositories? (This is the way it works for all other SCM repositories so I would be surprised if it doesn't work for Perforce).

Create a config file by running OpenGrok like:

java -jar opengrok.jar -S -W configuration.xml

On 2008-09-19 09:22:36 +0000, Zach Carter wrote:

Created attachment 506 my configuration.xml

On 2008-09-19 09:23:22 +0000, Zach Carter wrote:

(In reply to comment # 1)

Create a config file by running OpenGrok like:

java -jar opengrok.jar -S -W configuration.xml <all of the other options you normally use>

This doesn't work for me. I'll attach my configuration.xml

On 2008-09-19 09:49:23 +0000, Trond Norbye wrote:

Your configuration file does not include any repository objects, so that is the reason it isn't working. What is the SCM system you are using?

On 2008-09-19 10:04:25 +0000, Zach Carter wrote:

(In reply to comment # 4)

Your configuration file does not include any repository objects, so that is the reason it isn't working. What is the SCM system you are using?

Perforce.

I've done all I know to do to set it up (.p4config file exists and points to the correct client, p4 user is logged in, p4 binary is available).

On 2008-09-20 04:10:52 +0000, Trond Norbye wrote:

Could you post the output of:

java -jar opengrok.jar -s /your/source/root -d /your/data/root -v -S -c /your/ctags -n

On 2008-09-22 16:54:32 +0000, Zach Carter wrote:

(In reply to comment # 6)

Could you post the output of:

java -jar opengrok.jar -s /your/source/root -d /your/data/root -v -S -c /your/ctags -n

[zcarter@mott opengrok-0.7beta]$ java -jar opengrok.jar -s /data/opengrok/source -d /data/opengrok/data -v -S -c /usr/bin/ctags 2>&1 | tee /var/tmp/indexing.out Scanning for repositories... Done searching for repositories (4086s) Sep 22, 2008 3:52:33 PM org.opensolaris.opengrok.index.Indexer doIndexerExecution INFO: Starting indexExecution [zcarter@mott opengrok-0.7beta]$

On 2008-09-23 03:17:48 +0000, Trond Norbye wrote:

The output from the commands shows that it is not able to detect the existence of the repositories. To detect the Perforce repositories OpenGrok will try to run the p4 binary and parse the output. Could you try to run the following command from /data/opengrok/source/ and post the output?

p4 dirs /data/opengrok/source/

On 2008-09-23 10:13:52 +0000, Zach Carter wrote:

(In reply to comment # 8)

The output from the commands shows that it is not able to detect the existence of the repositories. To detect the Perforce repositories OpenGrok will try to run the p4 binary and parse the output. Could you try to run the following command from /data/opengrok/source/ and post the output?

p4 dirs /data/opengrok/source/

It doesn't work unless I add a wildcard like this: /data/opengrok/source//*

[zcarter@mott parkcity]$ pwd /data/opengrok/source/parkcity [zcarter@mott parkcity]$ p4 dirs /data/opengrok/source/parkcity Path '/data/opengrok/source/parkcity/...' is not under client's root '/data/opengrok/source/parkcity/f5_build'. [zcarter@mott parkcity]$ p4 dirs /data/opengrok/source/parkcity/*|head //depot/project/parkcity/f5_build//hotfix/README

...

On 2008-11-07 05:05:06 +0000, Trond Norbye wrote:

We discovered a couple of days ago that the perforce client use the PWD environment variable, and that is not updated by the system call chdir(2). We have added a fix to this in the mercurial repository. If you still have this problem, could you try the latest version?

On 2008-11-13 08:51:50 +0000, Zach Carter wrote:

(In reply to comment # 10)

We discovered a couple of days ago that the perforce client use the PWD environment variable, and that is not updated by the system call chdir(2). We have added a fix to this in the mercurial repository. If you still have this problem, could you try the latest version?

The latest version still is not exactly working. It detects the perforce repository, adds some information about it into the configuration.xml file, and it seems to scan the repository while indexing. I can see lots of p4 commands being run. However, in the webapp the History and Annotate links are still dimmed out.

On 2009-07-26 22:41:22 +0000, Harshit wrote:

(In reply to comment # 11)

(In reply to comment # 10)

We discovered a couple of days ago that the perforce client use the PWD environment variable, and that is not updated by the system call chdir(2). We have added a fix to this in the mercurial repository. If you still have this problem, could you try the latest version?

The latest version still is not exactly working. It detects the perforce repository, adds some information about it into the configuration.xml file, and it seems to scan the repository while indexing. I can see lots of p4 commands being run. However, in the webapp the History and Annotate links are still dimmed out.

We are facing the same problem with CVS. The History and Annotate links are disabled. And according to me these are the coolest features of OpenGrok!

Please help.

Thanks.

On 2010-05-20 22:40:59 +0000, Mike wrote:

I have the same problem with Perforce. The History and Annotate links are dimmed out.

When I run OpenGrok, it can contact Perforce (I know because I am watching the Perforce server log) and it generates a History Cache, but the cache appears to contain no Perforce metadata. Here's an example of the contents of a History Cache file:

less CISOLOG.gz <?xml version="1.0" encoding="UTF-8"?>

Should there be some sort of p4 metadata in the History Cache files?

Failing the ability of getting the History Cache working, is there a way to make OpenGrok run live querying of Perforce (which browsing) to be able to annotate?

On 2010-05-25 00:19:06 +0000, Mike wrote:

Just following up and adding that I am having this problem with OpenGrok 0.9.

On 2010-05-26 20:46:25 +0000, Mark Bickford wrote:

I also experienced the problem using Subversion 1.5 with the svn server on a remote machine. I eventually fixed it by deleting the data directory, running with the following set of options in run.sh, and finally bouncing the webapp:

java -Xms512M -Xmx512M -XX:MaxPermSize=256M -Djava.util.logging.config.file=/home/opengroklogging.properties -jar /home/opengrok/lib/opengrok.jar -v -S -H -r on -c /usr/bin/ctags -s ${SRC_ROOT} -d ${DATA_ROOT} -W /home/opengrok/data/configuration.xml

(Note: I realize that the logging param has a typo; I have since fixed it).

On 2010-05-31 15:05:20 +0000, Lubos Kosco wrote:

redispatching this bug ... accidentally saw it, but since opengrok-dev@opensolaris.org wasn't cced I doubt that dev team saw these updates ...

let's get this bug closed, it seems to be open too long ;)

On 2011-01-05 18:54:49 +0000, sb wrote:

For which release is this one targeted? I thought it would be listed in 0.10 but don't see it here...

http://opensolaris.org/jive/thread.jspa?messageID=506796

On 2011-01-05 21:57:55 +0000, Lubos Kosco wrote:

(In reply to comment # 17)

For which release is this one targeted? I thought it would be listed in 0.10 but don't see it here...

http://opensolaris.org/jive/thread.jspa?messageID=506796

not there, seems this bug needs more love ... we can try to target it for the next release, but I leave that up to trond

On 2011-01-06 09:02:36 +0000, Trond Norbye wrote:

Is there anyone that is facing this problem right now with some spare time so that I can get more information about the setup and hopefully figure out what's wrong?

On 2011-01-06 17:33:00 +0000, Zach Carter wrote:

(In reply to comment # 19)

Is there anyone that is facing this problem right now with some spare time so that I can get more information about the setup and hopefully figure out what's wrong?

Sure, let me know at z.carter@f5.com. We are running opengrok 0.9 on a CentOS server with perforce.

I could probably reproduce it in a test environment as well.

On 2012-04-10 16:42:58 +0000, Fadel Wanssa wrote:

I am using version 0.11.1. I have the same problem with perforce repository, it is generating the history cache, but the history and Annotate tabs are dimmed.

Is there a workaround for this issue?

Is this going to be fixed soon?

tarzanek commented 11 years ago

att 506:

<?xml version="1.0" encoding="UTF-8"?> 
<java version="1.6.0_06" class="java.beans.XMLDecoder"> 
 <object class="org.opensolaris.opengrok.configuration.Configuration"> 
  <void property="dataRoot"> 
   <string>/data/opengrok/data</string> 
  </void> 
  <void property="projects"> 
   <void method="add"> 
    <object class="org.opensolaris.opengrok.configuration.Project"> 
     <void property="description"> 
      <string>parkcity</string> 
     </void> 
     <void property="path"> 
      <string>/parkcity</string> 
     </void> 
    </object> 
   </void> 
  </void> 
  <void property="sourceRoot"> 
   <string>/data/opengrok/source</string> 
  </void> 
  <void property="verbose"> 
   <boolean>true</boolean> 
  </void> 
 </object> 
</java> 
RabihAntoun commented 8 years ago

Make sure tomcat has a perforce ticket.

use in the indexation command: -r dirbased if you are syncing the code locally from perforce.

Make sure tomcat:tomcat is the owner of the indexed files and the history will show again.

As for the annotate and history make sure your tomcat is launched with java 64b and with an XMX of minimum 4GB as it fails on heap space when trying to get the p4 information from the server.

tulinkry commented 5 years ago

There's a suggested workaround/solution and no reaction for years. A candidate for closing.