Edgewall Software
Modify

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#13432 closed defect (invalid)

Git "browse source" lists nonsense names after update to 1.4

Reported by: jiri@… Owned by:
Priority: normal Milestone:
Component: plugin/git Version: 1.4.3
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I updated from version 1.2.X (don't remember the exact version) to 1.4.3. I have several projects, each with a single "(default)" git repo set in the config file. I use git repositories on the same server, located in /srv/git/projectname. I have Git 2.32.0, and Python 2.7.18.

When I go to the Browse Source tab, the "Name" column contains nonsense names which seem to be gradually concatenated from the list of actual filenames. Clicking on the triangle next to a directory shows a new line saying "Error". Clicking on the name leads to a "No node XXX at revision YYY" error page.

The repositories can be cloned just fine. I've tried git fsck, trac-admin resync, and turning off repo cache to no avail. There is nothing suspicious in the debug log.

I've attached an example screenshot of the bug. The actual files and directories in this repository are:

2.7K	CMakeLists.txt
23K	.cproject
4.0K	doc/
4.0K	examples/
4.0K	.git/
65	.gitignore
11K	install-libs.sh
806	.project
4.0K	.settings/
4.0K	src/
4.0K	test/
4.0K	tools/

Attachments (1)

Screenshot from 2021-10-15 04-02-35.png (240.4 KB ) - added by jiri@… 3 years ago.
browse source screenshot

Download all attachments as: .zip

Change History (13)

by jiri@…, 3 years ago

browse source screenshot

comment:1 by Jun Omae, 3 years ago

Weird. Unable to reproduce it on Ubuntu 20.04 with Git 2.32.0 and 2.33.0.

  • Try git fsck
  • Try Git 2.33.1 (latest)

Please provide System Information and installed plugins from your about page.

comment:2 by anonymous, 3 years ago

OK. Tried with git 2.33.1, re-run git fsck, even restarted the whole server, but the issue still persists.

Installed plugins (all live in the virtualenv's site-packages /venv/trac/lib/python2.7/site-packages, installed via pip):

MathJaxPlugin 0.1.5
TracBreadCrumbsNav 0.5.0.dev0
TracMasterTickets 4.0.4
TracTags 0.12.1
TracXMLRPC 1.1.9

comment:3 by Jiří Vyskočil <jiri@…>, 3 years ago

I've also tried disabling all the plugins through the Admin page. Makes no difference either.

in reply to:  description ; comment:5 by Ryan J Ollos, 3 years ago

Replying to jiri@…:

I updated from version 1.2.X (don't remember the exact version) to 1.4.3.

Did you refresh static resources?

in reply to:  5 comment:6 by anonymous, 3 years ago

Replying to Ryan J Ollos:

Replying to jiri@…:

I updated from version 1.2.X (don't remember the exact version) to 1.4.3.

Did you refresh static resources?

I did. Just tried deleting cgi-bin and htdocs and deploying again to make sure there weren't any leftovers. It's still the same.

FIY, this is a low-traffic instance which hosts just half a dozen small projects. I've been running it for over 10 years, with regular updates since version 0.12 maybe older. It runs on Apache FCGI. The static files are in /var/www/trac/htdocs and /var/www/trac/cgi-bin, the projects live under /var/www/trac/sites. Templates, eggs, cache, and other stuff in the respective folders under /var/www/trac. I don't know if there are some newer recommendations on the directory structure for the recent Trac versions. The project sites are virtually identical except for their names and connected git repositories. All plugins, configs and templates are shared, and authentication is handled by Apache. Overall it feels like a pretty simple setup to me (and it worked flawlessly until the last update), but maybe there were some non-obvious changes that got missed over the years.

comment:7 by Jiří Vyskočil <jiri@…>, 3 years ago

This is the contents of the virtualenv:

(trac)$ pip freeze
appdirs==1.4.4
bpyutils==0.2.0
Genshi==0.7.5
install==1.3.0
Jinja2==2.11.3
MarkupSafe==1.1.1
packaging==20.9
pipupgrade==1.10.1
psycopg2-binary==2.8.6
Pygments==2.5.2
pyparsing==2.4.7
six==1.16.0
Trac==1.4.3
TracBreadCrumbsNav==0.5.0.dev0
TracMasterTickets==4.0.4
TracMathJax==0.1.7
TracTags==0.12.1
TracXMLRPC==1.1.9

comment:8 by Jun Omae, 3 years ago

Could you please provide output of the following code with your virtualenv?

  • If the output is wrong, tracopt.versioncontro.git.* has something wrong.
  • If the output is correct, template renderrer might have something wrong.
from trac.env import Environment
from trac.versioncontrol.api import RepositoryManager

env = Environment('/path/to/tracenv')  # replace with your TracEnv path
rm = RepositoryManager(env)
repos = rm.get_repository('')
root_node = repos.get_node('', '601d136647')
for node in root_node.get_entries():
    print('{}\t{}'.format(node.content_length, node.path))

in reply to:  8 comment:9 by Jiří Vyskočil <jiri@…>, 3 years ago

Replying to Jun Omae:

  • If the output is wrong, tracopt.versioncontro.git.* has something wrong.

The issue seems to be with tracopt.versioncontro.git.*:

(trac)$ python trac-git-test.py 
22745	./
65	.cproject.gitignore
806	.cproject.gitignore.project
None	.cproject.gitignore.project.settings
2674	.cproject.gitignore.project.settingsCMakeLists.txt
None	.cproject.gitignore.project.settingsCMakeLists.txtdoc
None	.cproject.gitignore.project.settingsCMakeLists.txtdocexamples
11245	.cproject.gitignore.project.settingsCMakeLists.txtdocexamplesinstall-libs.sh
None	.cproject.gitignore.project.settingsCMakeLists.txtdocexamplesinstall-libs.shsrc
None	.cproject.gitignore.project.settingsCMakeLists.txtdocexamplesinstall-libs.shsrctest
None	.cproject.gitignore.project.settingsCMakeLists.txtdocexamplesinstall-libs.shsrctesttools

comment:10 by Jun Omae, 3 years ago

Milestone: 1.4.4
Owner: set to Jun Omae
Status: newassigned

Thanks for the feedback. Hmmm, that's pretty bad….

comment:11 by Jiří Vyskočil <jiri@…>, 3 years ago

Thanks for the pointer. There seems to be something wrong with my git installation.

I've looked up the command issued by PyGIT, it's git ls-tree -zl <commit>.

On the server, I get:

(trac)$ git ls-tree -zl 601d1366475f765acaf31eb327e33bcca63a086a
100644 blob
420eb4fb5b5e13911d7369f3f715594a6c1d5fb4   22745	./100644 blob 
a76943fbfcdee3fb548de6303ffa8aee2d3030e8      65	.cproject.gitignore100644 blob 
bfa7f9e48a96bc6d430da61b60805f9b9e45d7aa     806	.cproject.gitignore.project040000 tree 
aba29d83ffec42f5869c3dfe1a1be8ddc55e0cef       -	.cproject.gitignore.project.settings100644 blob 
208df79c66a5455d274a27267fce276ea5244357    2674	.cproject.gitignore.project.settingsCMakeLists.txt040000 tree 
2addc5042610363541828a63c015d62889eb7bcd       -	.cproject.gitignore.project.settingsCMakeLists.txtdoc040000 tree 
e460624cb3cc343a33028dd35334588082218853       -	.cproject.gitignore.project.settingsCMakeLists.txtdocexamples100755 blob 
7859dc94026b6705ddd57470a058185e5c51ce2f   11245	.cproject.gitignore.project.settingsCMakeLists.txtdocexamplesinstall-libs.sh040000 tree 
4ca4a4bd1115e52997e5efa38cdc0e434cea0870       -	.cproject.gitignore.project.settingsCMakeLists.txtdocexamplesinstall-libs.shsrc040000 tree 
3579ae0c85e856d56da533c3b9aba816833cea4b       -	.cproject.gitignore.project.settingsCMakeLists.txtdocexamplesinstall-libs.shsrctest040000 tree 
125e8177c1d6a99fdaa0b9e41eacc0f508ba5315       -	.cproject.gitignore.project.settingsCMakeLists.txtdocexamplesinstall-libs.shsrctesttools

In a local cloned repo, I get:

$ git ls-tree -zl 601d1366475f765acaf31eb327e33bcca63a086a
100644 blob
420eb4fb5b5e13911d7369f3f715594a6c1d5fb4   22745	.cproject100644 blob 
a76943fbfcdee3fb548de6303ffa8aee2d3030e8      65	.gitignore100644 blob 
bfa7f9e48a96bc6d430da61b60805f9b9e45d7aa     806	.project040000 tree 
aba29d83ffec42f5869c3dfe1a1be8ddc55e0cef       -	.settings100644 blob 
208df79c66a5455d274a27267fce276ea5244357    2674	CMakeLists.txt040000 tree 
2addc5042610363541828a63c015d62889eb7bcd       -	doc040000 tree 
e460624cb3cc343a33028dd35334588082218853       -	examples100755 blob 
7859dc94026b6705ddd57470a058185e5c51ce2f   11245	install-libs.sh040000 tree 
4ca4a4bd1115e52997e5efa38cdc0e434cea0870       -	src040000 tree 
3579ae0c85e856d56da533c3b9aba816833cea4b       -	test040000 tree 
125e8177c1d6a99fdaa0b9e41eacc0f508ba5315       -	tools

(I've added newlines for better readability)

comment:12 by Jiří Vyskočil <jiri@…>, 3 years ago

Milestone: 1.4.4
Resolution: invalid
Status: assignedclosed

OK. This is not a Trac bug. I pinned it down to git ls-tree not working correctly when compiled with gcc link time optimizations turned on. I filled a bug report at the gentooLTO bugtracker, then I found out it has already been reported as a regression in gcc 11.2

Thank you all for the help!

comment:13 by Jun Omae, 3 years ago

Owner: Jun Omae removed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.