Help setting up Trac 1.6

73 views
Skip to first unread message

Jean-Marc Lasgouttes

unread,
Mar 4, 2024, 11:21:30 AMMar 4
to trac-...@googlegroups.com
Dear trac users,

I am currently trying to migrate an old trac 0.12.3 trac instance
(www.lyx.org/trac) on CentOS 6, to something more modern.

We have elected to base our new server on Ubuntu Noble (the next LTS
release), which may be a bit optimistic.

So, this is both a fresh installation and an upgrade, since I move the
files to a new environment.

I did my best to follow TracInstall and TracUpgrade, and I have
something that seems to work with tracd, but I get an Internal Server
Error when trying to access to trac in the proper way.

My apache2 configuration snippet is:

<Location /trac>
SetHandler mod_python
PythonInterpreter main_interpreter
PythonHandler trac.web.modpython_frontend
PythonOption TracEnv /home/lyx/www/trac
PythonOption TracUriRoot /trac
PythonOption PYTHON_EGG_CACHE /var/trac/lyx/egg-cache
# For Apache 2.2
<IfModule !mod_authz_core.c>
Order allow,deny
Allow from all
</IfModule>
# For Apache 2.4
<IfModule mod_authz_core.c>
Require all granted
</IfModule>
</Location>

and when I try to load the page, I get very weird errors in apache logs,
which do not make sense to me.

Does this ring a bell to anybody?
Sorry for the long message, I probably give too much information and
miss the useful information at the same time.

JMarc

[Mon Mar 04 14:49:52.948702 2024] [:error] [pid 7673] [client
128.93.65.20:45406] PythonHandler trac.web.modpython_frontend: Traceback
(most recent call last):
[Mon Mar 04 14:49:52.948761 2024] [:error] [pid 7673] [client
128.93.65.20:45406] PythonHandler trac.web.modpython_frontend: File
"/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2787,
in _dep_map\n return self.__dep_map\n ^^^^^^^^^^^^^^
[Mon Mar 04 14:49:52.948768 2024] [:error] [pid 7673] [client
128.93.65.20:45406] PythonHandler trac.web.modpython_frontend: File
"/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2902,
in __getattr__\n raise AttributeError(attr)
[Mon Mar 04 14:49:52.948774 2024] [:error] [pid 7673] [client
128.93.65.20:45406] PythonHandler trac.web.modpython_frontend:
AttributeError: _Distribution__dep_map
[Mon Mar 04 14:49:52.948779 2024] [:error] [pid 7673] [client
128.93.65.20:45406] PythonHandler trac.web.modpython_frontend: \nDuring
handling of the above exception, another exception occurred:\n
[Mon Mar 04 14:49:52.948783 2024] [:error] [pid 7673] [client
128.93.65.20:45406] PythonHandler trac.web.modpython_frontend: Traceback
(most recent call last):
[Mon Mar 04 14:49:52.948789 2024] [:error] [pid 7673] [client
128.93.65.20:45406] PythonHandler trac.web.modpython_frontend: File
"/usr/lib/python3/dist-packages/mod_python/apache.py", line 402, in
HandlerDispatch\n result = obj(req)\n ^^^^^^^^
[Mon Mar 04 14:49:52.948797 2024] [:error] [pid 7673] [client
128.93.65.20:45406] PythonHandler trac.web.modpython_frontend: File
"/usr/lib/python3/dist-packages/trac/web/modpython_frontend.py", line
149, in handler\n pkg_resources.require('Trac==%s' % VERSION)
[Mon Mar 04 14:49:52.948813 2024] [:error] [pid 7673] [client
128.93.65.20:45406] PythonHandler trac.web.modpython_frontend: File
"/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 968, in
require\n needed = self.resolve(parse_requirements(requirements))\n
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[Mon Mar 04 14:49:52.948822 2024] [:error] [pid 7673] [client
128.93.65.20:45406] PythonHandler trac.web.modpython_frontend: File
"/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 834, in
resolve\n new_requirements = dist.requires(req.extras)[::-1]\n
^^^^^^^^^^^^^^^^^^^^^^^^^
[Mon Mar 04 14:49:52.948830 2024] [:error] [pid 7673] [client
128.93.65.20:45406] PythonHandler trac.web.modpython_frontend: File
"/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2822,
in requires\n dm = self._dep_map\n ^^^^^^^^^^^^^
[Mon Mar 04 14:49:52.948838 2024] [:error] [pid 7673] [client
128.93.65.20:45406] PythonHandler trac.web.modpython_frontend: File
"/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2789,
in _dep_map\n self.__dep_map =
self._filter_extras(self._build_dep_map())\n
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[Mon Mar 04 14:49:52.948845 2024] [:error] [pid 7673] [client
128.93.65.20:45406] PythonHandler trac.web.modpython_frontend: File
"/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2804,
in _filter_extras\n invalid_marker(marker) or not
evaluate_marker(marker)\n ^^^^^^^^^^^^^^^^^^^^^^
[Mon Mar 04 14:49:52.948853 2024] [:error] [pid 7673] [client
128.93.65.20:45406] PythonHandler trac.web.modpython_frontend: File
"/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1459,
in invalid_marker\n evaluate_marker(text)
[Mon Mar 04 14:49:52.948861 2024] [:error] [pid 7673] [client
128.93.65.20:45406] PythonHandler trac.web.modpython_frontend: File
"/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1477,
in evaluate_marker\n return marker.evaluate()\n ^^^^^^^^^^^^^^^^^
[Mon Mar 04 14:49:52.948885 2024] [:error] [pid 7673] [client
128.93.65.20:45406] PythonHandler trac.web.modpython_frontend: File
"/usr/lib/python3/dist-packages/pkg_resources/_vendor/packaging/markers.py",
line 243, in evaluate\n current_environment = default_environment()\n
^^^^^^^^^^^^^^^^^^^^^
[Mon Mar 04 14:49:52.948892 2024] [:error] [pid 7673] [client
128.93.65.20:45406] PythonHandler trac.web.modpython_frontend: File
"/usr/lib/python3/dist-packages/pkg_resources/_vendor/packaging/markers.py",
line 186, in default_environment\n "python_full_version":
platform.python_version(),\n ^^^^^^^^^^^^^^^^^^^^^^^^^
[Mon Mar 04 14:49:52.948899 2024] [:error] [pid 7673] [client
128.93.65.20:45406] PythonHandler trac.web.modpython_frontend: File
"/usr/lib/python3.12/platform.py", line 1158, in python_version\n return
_sys_version()[1]\n ^^^^^^^^^^^^^^
[Mon Mar 04 14:49:52.948904 2024] [:error] [pid 7673] [client
128.93.65.20:45406] PythonHandler trac.web.modpython_frontend: File
"/usr/lib/python3.12/platform.py", line 1108, in _sys_version\n raise
ValueError(
[Mon Mar 04 14:49:52.948910 2024] [:error] [pid 7673] [client
128.93.65.20:45406] PythonHandler trac.web.modpython_frontend:
ValueError: failed to parse CPython sys.version: '3.12.2'


phep

unread,
Mar 4, 2024, 3:27:51 PMMar 4
to trac-...@googlegroups.com, Jean-Marc Lasgouttes

Hi,

Le 04/03/2024 à 17:20, Jean-Marc Lasgouttes a écrit :
[Mon Mar 04 14:49:52.948910 2024] [:error] [pid 7673] [client 128.93.65.20:45406] PythonHandler trac.web.modpython_frontend: ValueError: failed to parse CPython sys.version: '3.12.2'

This reminds me of this Debian bug. This is the kind of problem that moved us away from mod_python a dozen years ago.

Is there any particular reason to stick with mod_python instead of, say, mod_wsgi ?

(by the way, happy to see Lyx is still doing well. I had a lot of good time with it in a previous job ;-)).

HTH,

phep

Jean-Marc Lasgouttes

unread,
Mar 4, 2024, 5:19:13 PMMar 4
to phep, trac-...@googlegroups.com
Le 04/03/2024 à 20:19, phep a écrit :
> Hi,
>
> Le 04/03/2024 à 17:20, Jean-Marc Lasgouttes a écrit :
>> [Mon Mar 04 14:49:52.948910 2024] [:error] [pid 7673] [client
>> 128.93.65.20:45406] PythonHandler trac.web.modpython_frontend:
>> ValueError: failed to parse CPython sys.version: '3.12.2'
>
> This reminds me of this Debian bug
> <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1040933>. This is the
> kind of problem that moved us away from mod_python a dozen years ago.

Hi Phep,

Thanks for your prompt answer.

> Is there any particular reason to stick with mod_python instead of, say,
> mod_wsgi ?

Because I do not know what I am doing? But I realized a few hours ago
than swgi is probably a better choice.

I have yet to make it work, I may ask for more help once I sort it out
(currently apache itself does not start :))/

> (by the way, happy to see Lyx is still doing well. I had a lot of good
> time with it in a previous job ;-)).

It is going slowly, but we're still here!

Best,
Jean-Marc

Martin

unread,
Mar 4, 2024, 6:15:44 PMMar 4
to trac-...@googlegroups.com, Jean-Marc Lasgouttes
On 2024-03-04 20:19, phep wrote:
> Le 04/03/2024 à 17:20, Jean-Marc Lasgouttes a écrit :
> [Mon Mar 04 14:49:52.948910 2024] [:error] [pid 7673] [client 128.93.65.20:45406] PythonHandler trac.web.modpython_frontend:
> ValueError: failed to parse CPython sys.version: '3.12.2'
>
> This reminds me of this Debian bug. This is the kind of problem that moved us away from mod_python a dozen years ago.
>
> Is there any particular reason to stick with mod_python instead of, say, mod_wsgi ?

Also, nginx with gunicorn works well on Debian.
I guess, it will be the same on Ubuntu.
Whatever works for you ;-)

Jean-Marc Lasgouttes

unread,
Mar 6, 2024, 11:21:48 AMMar 6
to Martin, trac-...@googlegroups.com
Le 05/03/2024 à 00:13, Martin a écrit :
> Also, nginx with gunicorn works well on Debian.
> I guess, it will be the same on Ubuntu.
> Whatever works for you ;-)

Thanks for the advice Martin. Unfortunately, the choice is already made:
it is an apache2-based box (but it works now!).

JMarc


Jean-Marc Lasgouttes

unread,
Mar 6, 2024, 11:33:39 AMMar 6
to phep, trac-...@googlegroups.com
Le 04/03/2024 à 23:19, Jean-Marc Lasgouttes a écrit :
> Le 04/03/2024 à 20:19, phep a écrit :
>> Is there any particular reason to stick with mod_python instead of,
>> say, mod_wsgi ?
>
> Because I do not know what I am doing? But I realized a few hours ago
> than swgi is probably a better choice.

Hello,

So, with wsgi, everything seems to work :) Thanks for the tip.

I still have issues, though.

1/ I have added to [components]
tracopt.ticket.deleter.* = enabled
but I fail to see any Delete button in the ticket UI. How does this
work? I do have TRAC_ADMIN permission.


2/ I installed TracKeywordsPlugin, have added to [components]
trackeywords.web_ui.* = enabled
and a (dummy) section

[keywords]
patch = A patch is available for this issue
regression = This bug is new in this version

I see the plugin from the administrative page, but… I do not see any new
keywords UI on the tickets page (I did restart apache).


3/ I have configured 2 git repos, but one of them gives an error (coming
from trac-admin) like
InvalidRepository: "features" is not readable or not a Git repository.

Git seems to think that this is a perfectly valid repo and I
double-checked that it is owned by www-data.

So how can I know what annoys trad-admin?


Sorry for the never-ending stream of questions.

Best,
Jean-Marc

Jean-Marc Lasgouttes

unread,
Mar 7, 2024, 12:08:53 PMMar 7
to trac-...@googlegroups.com
I have a solution to this last question. The repository was recorded not
in trac.ini, but in the database itself, accessible through trac-admin.

This begs a new question:

4/ This is confusing to me. What are the things that are advised to be
configured in trac.ini, and what are those which should be done in the db?

And for good measure, I have a new one:

5/ Our git repository is on a different machine than our web server,
which handles trac. What are the good mechanisms that you might know of
to make sure that trac on www.lyx.org is updated whenever something is
pushed to git.lyx.org?

We have an hourly cron job for now, but it is not very satisfying.

Best regards,
Jean-Marc

Jun Omae

unread,
Mar 7, 2024, 7:46:27 PMMar 7
to trac-...@googlegroups.com, phep
On Thu, Mar 7, 2024 at 1:33 AM Jean-Marc Lasgouttes
<lasgoutte...@free.fr> wrote:
>
> 1/ I have added to [components]
> tracopt.ticket.deleter.* = enabled
> but I fail to see any Delete button in the ticket UI. How does this
> work? I do have TRAC_ADMIN permission.
>
>
> 2/ I installed TracKeywordsPlugin, have added to [components]
> trackeywords.web_ui.* = enabled
> and a (dummy) section
>
> [keywords]
> patch = A patch is available for this issue
> regression = This bug is new in this version
>
> I see the plugin from the administrative page, but… I do not see any new
> keywords UI on the tickets page (I did restart apache).

Check no errors in javascript console.
Both the deleter feature and the trackeywordsplugin work fine on my environment.

--
Jun Omae <jun...@gmail.com> (大前 潤)
Reply all
Reply to author
Forward
0 new messages