TraceBrowser quickly displays file contents before disappearing

26 views
Skip to first unread message

Joe-Paul Swinski

unread,
Jun 15, 2018, 12:32:07 PM6/15/18
to Trac Users
I installed the latest version of trac 1.2.2 using easy_install and I was able to get everything up and running without any issues.  I am using a git repository and I am able to browse the repository directories, commits, and use the difference tool.

What I am not able to do is display the contents of a normal text file (this includes c, cpp, h, txt, and any other text file).  When I click on a file in the TracBrowser, the contents of the file are briefly displayed (in the normal line numbered, non-highlighted view) and then it disappears and only meta information is displayed: file mode, last commit, file size, etc.

I am using the default trac.ini file with the exception that I added entries for the git repository.  I have also played with the [mimeviewer] properties with no effect.  For instance, I changed mime_map to include text/plain:c and I also changed mime_map_patterns to include test files like text/plain:Makefile and it still behaves the same way.

Any clues or pointers?

Thanks for your help

RjOllos

unread,
Jun 15, 2018, 12:37:41 PM6/15/18
to Trac Users


On Friday, June 15, 2018 at 9:32:07 AM UTC-7, Joe-Paul Swinski wrote:
I installed the latest version of trac 1.2.2 using easy_install and I was able to get everything up and running without any issues.  I am using a git repository and I am able to browse the repository directories, commits, and use the difference tool.

What is your Git version?
 
What I am not able to do is display the contents of a normal text file (this includes c, cpp, h, txt, and any other text file).  When I click on a file in the TracBrowser, the contents of the file are briefly displayed (in the normal line numbered, non-highlighted view) and then it disappears and only meta information is displayed: file mode, last commit, file size, etc.

That's very odd.

Any associated errors in the log?

Are you running TracStandalone, or using a different web server?

Joe-Paul Swinski

unread,
Jun 15, 2018, 1:13:20 PM6/15/18
to trac-...@googlegroups.com
Hi, thank you for the response and the help!

The git version is 2.7.4.  

I am using the stand alone server (tracd), and nothing stands out to me in the log file.

Here is the full log output (with some IPs and paths retracted) associated with just the request to display the file contents.

2018-06-15 13:01:20,075 Trac[env] WARNING: base_url option not set in configuration, generated links may be incorrect
2018-06-15 13:01:20,075 Trac[main] DEBUG: Dispatching <RequestWithSession "GET '/browser/escdtn/cfs/apps/bm/src/bm_app.c'">
2018-06-15 13:01:20,078 Trac[main] DEBUG: Chosen handler is <Component trac.versioncontrol.web_ui.browser.BrowserModule>
2018-06-15 13:01:20,087 Trac[git_fs] INFO: detected GIT version 2.7.4
2018-06-15 13:01:20,088 Trac[PyGIT] DEBUG: PyGIT.Storage instance for '/..../escdtn.git' is constructed
2018-06-15 13:01:20,088 Trac[PyGIT] DEBUG: requested weak PyGIT.Storage instance for '/..../escdtn.git'
2018-06-15 13:01:20,088 Trac[git_fs] DEBUG: enabled CachedRepository for '/..../escdtn.git'
2018-06-15 13:01:20,089 Trac[session] DEBUG: Retrieving session for ID u'admin'
2018-06-15 13:01:20,105 Trac[PyGIT] DEBUG: Detected changes in git repository '/..../escdtn.git'
2018-06-15 13:01:20,105 Trac[PyGIT] DEBUG: triggered rebuild of commit tree db for '/..../escdtn.git'
2018-06-15 13:01:20,114 Trac[PyGIT] DEBUG: rebuilt commit tree db for '/..../escdtn.git' with 94 entries (took 8.6 ms)
2018-06-15 13:01:20,128 Trac[api] DEBUG: action controllers for ticket workflow: ['ConfigurableTicketWorkflow']
2018-06-15 13:01:20,136 Trac[chrome] DEBUG: Prepare chrome data for request
2018-06-15 13:01:20,142 Trac[browser] DEBUG: Rendering preview of node bm_app.c@None with mime-type text/x-csrc; charset=utf-8
2018-06-15 13:01:20,143 Trac[api] DEBUG: Trying to render HTML preview using PygmentsRenderer [lineno]
2018-06-15 13:01:20,284 Trac[main] DEBUG: Rendering response from handler
2018-06-15 13:01:20,734 Trac[main] DEBUG: Dispatching <RequestWithSession "GET '/chrome/site/your_project_logo.png'">
2018-06-15 13:01:20,735 Trac[main] DEBUG: Chosen handler is <Component trac.web.chrome.Chrome>
2018-06-15 13:01:20,789 Trac[main] DEBUG: Dispatching <RequestWithSession "GET '/chrome/common/topbar_gradient.png'">
2018-06-15 13:01:20,790 Trac[main] DEBUG: Chosen handler is <Component trac.web.chrome.Chrome>
2018-06-15 13:01:20,793 Trac[main] DEBUG: Dispatching <RequestWithSession "GET '/chrome/common/topbar_gradient2.png'">
2018-06-15 13:01:20,794 Trac[main] DEBUG: Chosen handler is <Component trac.web.chrome.Chrome>
2018-06-15 13:01:20,811 Trac[chrome] WARNING: File your_project_logo.png not found in any of ['/..../trac/htdocs']
2018-06-15 13:01:20,811 Trac[main] WARNING: [....] HTTPNotFound: 404 Not Found (File your_project_logo.png not found), <RequestWithSession "GET '/chrome/site/your_project_logo.png'">, referrer 'http://..../browser/escdtn/cfs/apps/bm/src/bm_app.c'
2018-06-15 13:01:20,812 Trac[chrome] DEBUG: Prepare chrome data for request
2018-06-15 13:01:20,815 Trac[session] DEBUG: Retrieving session for ID u'admin'
2018-06-15 13:01:20,822 Trac[PyGIT] DEBUG: requested weak PyGIT.Storage instance for '/..../escdtn.git'
2018-06-15 13:01:20,822 Trac[git_fs] DEBUG: enabled CachedRepository for '/..../escdtn.git'
2018-06-15 13:01:20,988 Trac[session] DEBUG: Retrieving session for ID u'admin'
2018-06-15 13:01:21,015 Trac[session] DEBUG: Retrieving session for ID u'admin'



--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+...@googlegroups.com.
To post to this group, send email to trac-...@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.

RjOllos

unread,
Jun 15, 2018, 1:40:11 PM6/15/18
to Trac Users
The log shows that you have enabled [git] cached_repository. Did you run resync on the repository after adding?

Please also share the [git] and [repositories] sections of your trac.ini.

- Ryan

Joe-Paul Swinski

unread,
Jun 15, 2018, 2:09:31 PM6/15/18
to trac-...@googlegroups.com
Hi Ryan,

Looking through the trac.log I found something - I had a plugin in the plugin directory called ReadmeRendererPlugin-0.2-py2.7.egg and even though it was not being enabled in the ini file, it was still being loaded.  I removed the egg file from the directory and everything started working right away.

I had been working on this for a while, and the pointer to enable the log and look through it was the tip I needed.  Thank you!

JP


--

Ryan Ollos

unread,
Jun 15, 2018, 2:33:26 PM6/15/18
to Trac Users
On Fri, Jun 15, 2018 at 11:09 AM Joe-Paul Swinski <jswi...@gmail.com> wrote:
Hi Ryan,

Looking through the trac.log I found something - I had a plugin in the plugin directory called ReadmeRendererPlugin-0.2-py2.7.egg and even though it was not being enabled in the ini file, it was still being loaded.  I removed the egg file from the directory and everything started working right away.

I had been working on this for a while, and the pointer to enable the log and look through it was the tip I needed.  Thank you!

JP

Good find! Plugins are auto-enabled from the Environment plugins directory:

That plugin had a few problems, but the 0.3 version should work:

- Ryan 

RjOllos

unread,
Jun 27, 2018, 11:26:40 PM6/27/18
to Trac Users


On Friday, June 15, 2018 at 11:33:26 AM UTC-7, RjOllos wrote:


On Fri, Jun 15, 2018 at 11:09 AM Joe-Paul Swinski <jswi...@gmail.com> wrote:
Hi Ryan,

Looking through the trac.log I found something - I had a plugin in the plugin directory called ReadmeRendererPlugin-0.2-py2.7.egg and even though it was not being enabled in the ini file, it was still being loaded.  I removed the egg file from the directory and everything started working right away.

[...] 

JP

[...]
 
That plugin had a few problems, but the 0.3 version should work:

- Ryan 

Possibly related to your reported issue:

- Ryan 
Reply all
Reply to author
Forward
0 new messages