Modify

Opened 4 years ago

Last modified 15 months ago

#8473 new defect

Problem with Trac 0.12.2 and GitPlugin (BrowserModule)

Reported by: tss.soft@… Owned by: hvr
Priority: normal Component: GitPlugin
Severity: major Keywords:
Cc: stuge Trac Release: 0.12

Description (last modified by rjollos)

Today, I reinstalled Trac and GitPlugin and now I get the following warning:

Warning: Error with navigation contributor "BrowserModule" 

The Browse Source tab is missing. With Trac 0.12.2rc1 there was no Problem.

Attachments (0)

Change History (26)

comment:1 in reply to: ↑ description ; follow-up: Changed 4 years ago by anonymous

Replying to tss.soft@googlemail.com:

Today, I reinstalled Trac and GitPlugin and now I get the following warning: Warning: Error with navigation contributor "BrowserModule"

The "Browse source" tab is missing. With Trac 0.12.2rc1 there was no Problem.

same problem to me. Anybody know this solution?

comment:2 in reply to: ↑ 1 Changed 4 years ago by aksfkb@…

Replying to anonymous:

Replying to tss.soft@googlemail.com:

Today, I reinstalled Trac and GitPlugin and now I get the following warning: Warning: Error with navigation contributor "BrowserModule"

The "Browse source" tab is missing. With Trac 0.12.2rc1 there was no Problem.

same problem to me. Anybody know this solution?

This is on mine too, quick questions to narrow it down: how did you initialize your repos (bare or standard) and did you upgrade trac or start from fresh? (I have a bare and upgraded. This works fine without either on my test machine)

comment:3 Changed 4 years ago by kowalskif

  • Summary changed from Problem with Trac 0.12.2 and BrowserModule to Problem with Trac 0.12.2 and GitPlugin (BrowserModule)

Same problem here. fresh trac-0.12 install (using egg), fresh gitplugin install (also using egg) on ubuntu maverick 64-bits. I am only using Git bare repositories. I have several Git repositories in my (unique) project.

This post contains a handful of error log message:

http://stackoverflow.com/questions/5183049/trouble-with-a-git-bare-repository-after-upgrading-trac-from-0-11-to-0-12

comment:4 Changed 4 years ago by rjollos

  • Description modified (diff)

comment:5 Changed 4 years ago by kowalskif

I activated the logs: here are the results: it seems like Trac is complaining due to the lack of SVN configuration. This normal for me: I do not have an SVN repository here: only Git bare repos.

Log:

Mar 21 10:02:41 sisyphus Trac[env] INFO: -------------------------------- environment startup [Trac 0.12.2] --------------------------------
Mar 21 10:02:42 sisyphus Trac[env] WARNING: base_url option not set in configuration, generated links may be incorrect
Mar 21 10:02:42 sisyphus Trac[git_fs] INFO: detected GIT version 1.7.0.4
Mar 21 10:02:42 sisyphus Trac[svn_fs] INFO: Failed to load Subversion bindings
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/versioncontrol/svn_fs.py", line 267, in __init__
    _import_svn()
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/versioncontrol/svn_fs.py", line 68, in _import_svn
    from svn import fs, repos, core, delta
ImportError: No module named svn
Last edited 19 months ago by jun66j5 (previous) (diff)

comment:6 Changed 4 years ago by kowalskif

Dis-regard my previous post about missing subversion bindings: this is a separated error on Ubuntu, which is resolved by installing the missing dependencies.

$  sudo apt-get install python-subversion
$  sudo service apache2 reload

The BrowserModule error remains, but there is nothing in the logs that provides more feedback.

comment:7 Changed 4 years ago by kowalskif

Finally, purging any {{repository_*}}} from trac.ini and restarting Apache completely seems to have fixed my problem. no more BrowserModule-related warning message.

[trac]
- repository_dir =
- repository_sync_per_request = (default)
- repository_type = svn
+ repository_sync_per_request =
% sudo service apache2 restart

comment:8 Changed 4 years ago by aksfkb@…

We must have been working on two similar, but different problems: your solution doesn't work. We long since purged all of them and on adding *_sync_per_* nothing changes. We don't use apache either, instead we are on tracd still.

comment:9 follow-up: Changed 4 years ago by anonymous

  • I've got the same issue if I setup myproject directory to:
    /srv/​git/myproject
    
  • But it works if I use the .git diretory:
    /srv/​git/​myproject/​.git
    
  • I can now browse source from both svn and git

comment:10 Changed 4 years ago by anonymous

The workaround is complete for those who need an intermediary:

http://stackoverflow.com/questions/5183049/trouble-with-a-git-bare-repository-after-upgrading-trac-from-0-11-to-0-12

Not a fix though.

comment:11 Changed 4 years ago by eothred

  • Cc eothred added; anonymous removed

So, I am new to Trac and have almost no idea what I am doing, but I was wondering if you also get this error in the timeline?

Oops…
Trac detected an internal error:

TypeError: 'NoneType' object is not subscriptable

Looking at the back trace I noticed that git_fs.py is initializing a Repository with a None as the params dictionary, whereas the api.py expects the params dictionary to contain both name and id. Am I just using wrong version of the plugin/trac perhaps?

comment:12 follow-up: Changed 4 years ago by eothred

  • Cc anonymous added; eothred removed

I am quite embarrassed, I answered my own question while writing. Apparently I managed to use the plugin from the 0.11 branch, with trac 0.12.. I tried just now and the error messages have all disappeared. Sorry for the spam!

comment:13 in reply to: ↑ 12 Changed 4 years ago by rjollos

Replying to eothred:

Apparently I managed to use the plugin from the 0.11 branch, with trac 0.12..

To avoid this possibility in the future, it might be useful to add a <0.12 or <0.12dev condition to the install_requires parameter in setup.py.

comment:14 Changed 4 years ago by ekampp@…

I still get this problem, and I have checked that I'm running both trac 0.12 and the appropriate plugin for git, but I still get the error: Warning: Error with navigation contributor "BrowserModule"

comment:15 in reply to: ↑ 9 ; follow-up: Changed 3 years ago by robguttman

Replying to anonymous:

  • I've got the same issue if I setup myproject directory to:
    /srv/​git/myproject
    
  • But it works if I use the .git diretory:
    /srv/​git/​myproject/​.git
    
  • I can now browse source from both svn and git

This worked for me as well. Thank you!

comment:16 Changed 3 years ago by anonymous

Didn't work for me. I had bare git repositories anyway - i.e. ../myproject.git. Anyone have a clue how to support multiple (bare) git repositories with Trac v0.12.2?

comment:17 Changed 3 years ago by trac@…

  • Priority changed from normal to high
  • Severity changed from major to critical

I'm having the same problem, on normal checkouts of the remote repository, the ".git" directory of the remote checkout, and bare (mirror) repositories cloned from the remote checkout. It makes the plugin impossible to use, therefore raising severity...

comment:18 Changed 3 years ago by trac@…

  • Priority changed from high to normal
  • Severity changed from critical to major

Actually, my problem was again related to trac 0.12 and an older trac-git, both from Debian Wheezy. Commented on this Debian bug which describes the problem: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=634826

comment:19 Changed 3 years ago by sven@…

same problem on openSUSE 11.3 and 11.4.

Tack-Hacks ticket#8682 provides a working patch: http://trac-hacks.org/ticket/8682 -> maybe merge these tickets?

openSUSE-Ticket: https://bugzilla.novell.com/show_bug.cgi?id=697156

Please implement.

comment:20 Changed 3 years ago by thucdat@…

I run trac 0.12 on windows 7, the timeline tab shows changes I made to the git repository, but when I click on the browser tab, I got:

Trac detected an internal error:

WindowsError: (5, 'Access is denied')

There was an internal error in Trac. It is recommended that you notify your local Trac administrator with the information needed to reproduce the issue.

To that end, you could a ticket.

The action that triggered the error was:

GET: /browser

comment:21 Changed 2 years ago by anonymous

Hey, just in case anyone is still having this problem and nothing else is working I needed a different solution that most people.

I am using Track and the Git plugin, and my git repos are hosted on the same server as trac, but I use gitosis.

After reading through some source code and the debug logs the solution is stupid simple.

For me the git control files were not visible to the user that is running trac (www-data). Or rather the directories that contain the files were not executable.

To fix this you need to change into the directory of your gitosis user (lets assume /home/git) then:

cd /home/git/repositories sudo chmod 755 testRepository.git

where testRepository.git is the repos that you want in trac. Optionally you can of course just use * instead of a repository name.

Hopefully this is of some help to someone!

Cheers!

comment:22 Changed 2 years ago by stuge

  • Cc stuge added; anonymous removed

comment:23 in reply to: ↑ 15 ; follow-up: Changed 15 months ago by whatrevolution@…

Replying to robguttman:

Replying to anonymous:

  • I've got the same issue if I setup myproject directory to:
    /srv/​git/myproject
    
  • But it works if I use the .git diretory:
    /srv/​git/​myproject/​.git
    
  • I can now browse source from both svn and git

This worked for me as well. Thank you!

Confirmed again that this is a solution in some cases. Standard git repo (not bare) requires that Trac is pointed at the repository database (.git directory), and not the user working directory from which that was made.

comment:24 in reply to: ↑ 23 ; follow-up: Changed 15 months ago by whatrevolution@…

Replying to whatrevolution@…:

Replying to robguttman:

Replying to anonymous:

  • I've got the same issue if I setup myproject directory to:
    /srv/​git/myproject
    
  • But it works if I use the .git diretory:
    /srv/​git/​myproject/​.git
    
  • I can now browse source from both svn and git

This worked for me as well. Thank you!

Confirmed again that this is a solution in some cases. Standard git repo (not bare) requires that Trac is pointed at the repository database (.git directory), and not the user working directory from which that was made.

However, a follow-up thought: Shouldn't the BrowserModule (or earlier in the Trac stack, maybe up-stream) be noticing that the user has erred, and is pointing the BrowseModule and Trac at a non-git directory? There, I think, lies a real defect.

comment:25 in reply to: ↑ 24 ; follow-up: Changed 15 months ago by whatrevolution@…

Replying to whatrevolution@…:

Replying to whatrevolution@…:

Replying to robguttman:

Replying to anonymous:

  • I've got the same issue if I setup myproject directory to:
    /srv/​git/myproject
    
  • But it works if I use the .git diretory:
    /srv/​git/​myproject/​.git
    
  • I can now browse source from both svn and git

This worked for me as well. Thank you!

Confirmed again that this is a solution in some cases. Standard git repo (not bare) requires that Trac is pointed at the repository database (.git directory), and not the user working directory from which that was made.

However, a follow-up thought: Shouldn't the BrowserModule (or earlier in the Trac stack, maybe up-stream) be noticing that the user has erred, and is pointing the BrowseModule and Trac at a non-git directory? There, I think, lies a real defect.

This information is already in TracGit troubleshooting: http://trac.edgewall.org/wiki/TracGit#Troubleshooting

We just need the error message to be made more informative.

comment:26 in reply to: ↑ 25 Changed 15 months ago by rjollos

Replying to whatrevolution@…:

Replying to whatrevolution@…:

Replying to whatrevolution@…:

Replying to robguttman:

Replying to anonymous:

  • I've got the same issue if I setup myproject directory to:
    /srv/​git/myproject
    
  • But it works if I use the .git diretory:
    /srv/​git/​myproject/​.git
    
  • I can now browse source from both svn and git

This worked for me as well. Thank you!

Confirmed again that this is a solution in some cases. Standard git repo (not bare) requires that Trac is pointed at the repository database (.git directory), and not the user working directory from which that was made.

However, a follow-up thought: Shouldn't the BrowserModule (or earlier in the Trac stack, maybe up-stream) be noticing that the user has erred, and is pointing the BrowseModule and Trac at a non-git directory? There, I think, lies a real defect.

This information is already in TracGit troubleshooting: http://trac.edgewall.org/wiki/TracGit#Troubleshooting

We just need the error message to be made more informative.

The version of the plugin on trac-hacks isn't being maintained, but the plugin has been integrated into Trac as of version 1.0, and is being maintained there. trac:#11297 should address the issue you describe.

Add Comment

Modify Ticket

Action
as new The owner will remain hvr.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.