Edgewall Software
Modify

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#10460 closed defect (worksforme)

Unable to install TracMercurial globally

Reported by: digimag@… Owned by:
Priority: normal Milestone:
Component: plugin/mercurial Version: 0.12-stable
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I followed the instructions, but the plugin doesn't appear in the "plugins" section, and editing trac.ini manually doesn't make "hg" appear in the repository type list.

Here's exactly what I did:

# svn co http://svn.edgewall.com/repos/trac/plugins/0.12/mercurial-plugin
A    mercurial-plugin/setup.py
[…]
 U   mercurial-plugin
Révision 10874 extraite.
# cd mercurial-plugin/
# python setup.py install
running install
Checking .pth file support in /usr/local/lib/python2.7/dist-packages/
/usr/bin/python -E -c pass
TEST PASSED: /usr/local/lib/python2.7/dist-packages/ appears to support .pth files
running bdist_egg
running egg_info
creating TracMercurial.egg-info
writing requirements to TracMercurial.egg-info/requires.txt
[…]
copying TracMercurial.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/TracMercurial-0.12.0.28dev_r10784-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing TracMercurial-0.12.0.28dev_r10784-py2.7.egg
removing '/usr/local/lib/python2.7/dist-packages/TracMercurial-0.12.0.28dev_r10784-py2.7.egg' (and everything under it)
creating /usr/local/lib/python2.7/dist-packages/TracMercurial-0.12.0.28dev_r10784-py2.7.egg
Extracting TracMercurial-0.12.0.28dev_r10784-py2.7.egg to /usr/local/lib/python2.7/dist-packages
Adding TracMercurial 0.12.0.28dev-r10784 to easy-install.pth file

Installed /usr/local/lib/python2.7/dist-packages/TracMercurial-0.12.0.28dev_r10784-py2.7.egg
Processing dependencies for TracMercurial==0.12.0.28dev-r10784
Searching for Trac==0.12.2
Best match: Trac 0.12.2
Adding Trac 0.12.2 to easy-install.pth file
Installing trac-admin script to /usr/local/bin
Installing tracd script to /usr/local/bin

Using /usr/lib/python2.7/dist-packages
Searching for Genshi==0.6
Best match: Genshi 0.6
Adding Genshi 0.6 to easy-install.pth file

Using /usr/lib/python2.7/dist-packages
Searching for distribute==0.6.16dev-r0
Best match: distribute 0.6.16dev-r0
Adding distribute 0.6.16dev-r0 to easy-install.pth file
Installing easy_install script to /usr/local/bin
Installing easy_install-2.7 script to /usr/local/bin
Installing easy_install-2.6 script to /usr/local/bin

Using /usr/lib/python2.7/dist-packages
Finished processing dependencies for TracMercurial==0.12.0.28dev-r10784

In my trac.ini:

[components]
tracopt.ticket.commit_updater.* = enabled
tracext.* = enabled

Now even if I restart tracd, hg doesn't appear:

http://i.imgur.com/UVlxL.png

Now if I install the egg dir in the plugins directory, everything works fine.

Trac version: ubuntu trac 0.12.2

Attachments (0)

Change History (5)

comment:1 by anonymous, 13 years ago

Update

It seems to be a permission problem.

If I run tracd using root, it works fine.

http://i.imgur.com/KiHAn.png

But now when I reload tracd under www-data, I get this error message:

Error

TracError: IOError: 13 Permission denied

(note that everything related to my trac installation is readable and writable by www-data)

I can only get rid of this error message if I uninstall TracMercurial:

# easy_install -m dist/TracMercurial-0.12.0.28dev_r10784-py2.7.egg
# rm -fr /usr/local/lib/python2.7/dist-packages/TracMercurial*

And after that Trac works fine again (but without mercurial support of course).

Any ideas?

comment:2 by digimag@…, 13 years ago

1. PYTHON_EGG_CACHE

I thought that it was a problem with PYTHON_EGG_CACHE.

But again it does not seem to be the case:

(idenitifed as www-data)

$ export PYTHON_EGG_CACHE=/tmp
$ echo $PYTHON_EGG_CACHE
/tmp
$ tracd …

Results in:

http://i.imgur.com/QCdQT.png

And no egg file in the /tmp directory.

2. Command line tool

Another strange thing is that if I try to invoke trac-admin as a non-root user, no command is recognised:

$ trac-admin . wiki list
Error: Command not found

But it works fine if I do it as a super-user or if I remove the TracMercurial plugin, or if I install it locally.

comment:3 by digimag <digimag@…>, 13 years ago

Solution

I was able to eventually make it work.

The problem was that my root umask was set to 0077.

Doing the same installation after executing umask 0022 fixed everything.

Is it something that should be fixed in Trac or should it figure in documentation?

in reply to:  3 ; comment:4 by Remy Blank, 13 years ago

Milestone: plugin - mercurial
Resolution: worksforme
Status: newclosed

Replying to digimag <digimag@…>:

The problem was that my root umask was set to 0077.

That's a typical InstallationIssue.

Is it something that should be fixed in Trac or should it figure in documentation?

Well, it's not a bug (neither in Trac, nor anywhere else). File written by a user have the umask applied to the permissions. That's a pretty basic fact of *nix system administration.

We already have various hints about permissions (to the environment, the database, trac.ini and the logs) sprinkled throughout the guide, but if you feel mentioning this specific case somewhere would help others avoid it, feel free to add it to the guide.

in reply to:  4 comment:5 by digimag <digimag@…>, 13 years ago

Sorry for InstallationIssue.

Replying to rblank:

Well, it's not a bug (neither in Trac, nor anywhere else). File written by a user have the umask applied to the permissions. That's a pretty basic fact of *nix system administration.

Sure. It's just that umask 0077 shouldn't cause problems, so it's probably better to mention it clearly that it has to be changed during the installation process. I'll do it tomorrow.

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.