Re: [Trac] Trac error: upgrade of trac.db.api.DatabaseManager: Unsupported database type "postgres"

"'Joost Kraaijeveld' via Trac Users" <trac-users-/[email protected]> Sat, 22 Feb 2025 15:59:50 +0100
Newsgroups gmane.comp.version-control.subversion.trac.general
Message-ID <[email protected]>
On Sat, 2025-02-22 at 21:23 +0900, Jun Omae wrote:
> * How did you apply the changes?

I download the source version of Debian's Trac 1.6. I copied and pasted
the changes into postgres_backend manually. I compared it with the same
file from https://svn.edgewall.org/repos/trac/branches/1.6-stable .
They were identical. Than I created a Debian .deb file.

1 test failed during the build: 
E: pybuild pybuild:389: test: plugin distutils failed with: exit
code=1: cd /opt/disks/datadisk1/home/jkr/src/debian/trac-
1.6/.pybuild/cpython3_3.13/build; python3.13 -m unittest discover -v

The installation (dpkg -i trac_1.6-3.1_all.deb) was succesfull.

> * Share the stacktrace of the error, again (the lineno should be
> changed if the applying is correct)
There is no stack trace, even if I set the logging to DEBUG. Full log
attached. 

The line saying "2025-02-22 15:49:44,797 Trac[loader] DEBUG: Skipping
"trac.db.postgres = trac.db.postgres_backend": DistributionNotFound:
The 'psycopg2>=2.0 or psycopg2-binary' distribution was not found and
is required by Trac" is wrong. I have psycopg2 2.9.10-1 installed

> * Share your environment information (OS, PostgreSQL version, ...)


Debian Trixie:

Kernel: Linux 6.12.12-amd64 (SMP w/32 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE,
TAINT_UNSIGNED_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8),
LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages trac depends on:
ii  libjs-excanvas                   0.r4~git20200903.44ac99f-1
ii  libjs-jquery                     3.6.1+dfsg+~3.5.14-1
ii  libjs-jquery-timepicker          1.6.3-6
ii  libjs-jquery-ui                  1.13.2+dfsg-1
ii  python3 [python3-supported-max]  3.13.1-2
ii  python3-jinja2                   3.1.5-2
ii  python3-multipart                1.2.1-2
ii  python3-pkg-resources            75.6.0-1
ii  python3-setuptools               75.6.0-1

Versions of packages trac recommends:
ii  apache2 [httpd]     2.4.63-1
ii  python3-babel       2.17.0-1
ii  python3-docutils    0.21.2+dfsg-2
ii  python3-pygments    2.18.0+dfsg-2
ii  python3-subversion  1.14.5-2+b2
ii  python3-tz          2025.1-3

Versions of packages trac suggests:
pn  libapache2-mod-wsgi    <none>
ii  python3-psycopg2       2.9.10-1
ii  python3-textile        1:4.0.2-2
ii  trac-wikiprint         4.0.0+svn18614+really3.0.0+svn18295-1
ii  trac-wysiwyg           0.12.0.7+svn18546-2
ii  trac-xmlrpc            1.2.0+svn18521-2

Version of Postgresql: 17.3-3

-- 
Groeten,

Joost Kraaijeveld

-- 
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+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
To view this discussion visit https://groups.google.com/d/msgid/trac-users/8c55e23808221efaa995e6e2c74239153b3aa001.camel%40Askesis.nl.
trac.log (text/x-log, 8.4 KB)
2025-02-22 15:49:44,753 Trac[env] INFO: -------------------------------- environment startup [Trac 1.6] --------------------------------
2025-02-22 15:49:44,767 Trac[loader] DEBUG: Loading plugin "TracXMLRPC" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,776 Trac[loader] DEBUG: Loading plugin "subcomponents.components_view" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,777 Trac[loader] DEBUG: Loading plugin "subcomponents.web_ui" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,777 Trac[loader] DEBUG: Loading plugin "trac.about" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,777 Trac[loader] DEBUG: Loading plugin "trac.admin.console" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,779 Trac[loader] DEBUG: Loading plugin "trac.admin.web_ui" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,779 Trac[loader] DEBUG: Loading plugin "trac.attachment" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,779 Trac[loader] DEBUG: Loading plugin "trac.db.mysql" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,789 Trac[loader] DEBUG: Skipping "trac.db.mysql = trac.db.mysql_backend [mysql]": DistributionNotFound: The 'PyMySQL' distribution was not found and is required by the application
2025-02-22 15:49:44,789 Trac[loader] DEBUG: Loading plugin "trac.db.postgres" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,797 Trac[loader] DEBUG: Skipping "trac.db.postgres = trac.db.postgres_backend": DistributionNotFound: The 'psycopg2>=2.0 or psycopg2-binary' distribution was not found and is required by Trac
2025-02-22 15:49:44,797 Trac[loader] DEBUG: Loading plugin "trac.db.sqlite" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,797 Trac[loader] DEBUG: Loading plugin "trac.mimeview.patch" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,797 Trac[loader] DEBUG: Loading plugin "trac.mimeview.pygments" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,801 Trac[loader] DEBUG: Loading plugin "trac.mimeview.rst" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,824 Trac[loader] DEBUG: Loading plugin "trac.mimeview.txtl" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,834 Trac[loader] DEBUG: Skipping "trac.mimeview.txtl = trac.mimeview.txtl [textile]": DistributionNotFound: The 'regex>1.0' distribution was not found and is required by textile
2025-02-22 15:49:44,834 Trac[loader] DEBUG: Loading plugin "trac.notification.api" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,834 Trac[loader] DEBUG: Loading plugin "trac.notification.mail" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,834 Trac[loader] DEBUG: Loading plugin "trac.notification.prefs" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,834 Trac[loader] DEBUG: Loading plugin "trac.prefs" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,834 Trac[loader] DEBUG: Loading plugin "trac.search" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,834 Trac[loader] DEBUG: Loading plugin "trac.ticket.admin" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,835 Trac[loader] DEBUG: Loading plugin "trac.ticket.batch" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,835 Trac[loader] DEBUG: Loading plugin "trac.ticket.notification" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,835 Trac[loader] DEBUG: Loading plugin "trac.ticket.query" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,835 Trac[loader] DEBUG: Loading plugin "trac.ticket.report" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,835 Trac[loader] DEBUG: Loading plugin "trac.ticket.roadmap" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,835 Trac[loader] DEBUG: Loading plugin "trac.ticket.web_ui" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,835 Trac[loader] DEBUG: Loading plugin "trac.timeline" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,835 Trac[loader] DEBUG: Loading plugin "trac.versioncontrol.admin" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,836 Trac[loader] DEBUG: Loading plugin "trac.versioncontrol.svn_authz" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,836 Trac[loader] DEBUG: Loading plugin "trac.versioncontrol.web_ui" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,838 Trac[loader] DEBUG: Loading plugin "trac.web.auth" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,838 Trac[loader] DEBUG: Loading plugin "trac.web.main" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,838 Trac[loader] DEBUG: Loading plugin "trac.web.session" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,838 Trac[loader] DEBUG: Loading plugin "trac.wiki.admin" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,839 Trac[loader] DEBUG: Loading plugin "trac.wiki.interwiki" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,839 Trac[loader] DEBUG: Loading plugin "trac.wiki.macros" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,839 Trac[loader] DEBUG: Loading plugin "trac.wiki.web_api" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,839 Trac[loader] DEBUG: Loading plugin "trac.wiki.web_ui" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,839 Trac[loader] DEBUG: Loading plugin "tracopt.perm.authz_policy" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,839 Trac[loader] DEBUG: Loading plugin "tracopt.perm.config_perm_provider" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,839 Trac[loader] DEBUG: Loading plugin "tracopt.ticket.clone" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,839 Trac[loader] DEBUG: Loading plugin "tracopt.ticket.commit_updater" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,840 Trac[loader] DEBUG: Loading plugin "tracopt.ticket.deleter" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,840 Trac[loader] DEBUG: Loading plugin "tracopt.versioncontrol.git.git_fs" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,841 Trac[loader] DEBUG: Loading plugin "tracopt.versioncontrol.svn.svn_fs" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,842 Trac[loader] DEBUG: Loading plugin "tracopt.versioncontrol.svn.svn_prop" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,842 Trac[loader] DEBUG: Loading plugin "tracwysiwyg" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,842 Trac[loader] DEBUG: Loading plugin "wikiprint.formats" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,995 Trac[loader] DEBUG: Loading plugin "wikiprint.web_ui" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,995 Trac[loader] DEBUG: Loading plugin "wikiprint.wikiprint" from "/usr/lib/python3/dist-packages"
2025-02-22 15:49:44,995 Trac[default_workflow] DEBUG: Workflow actions at initialization: defaultdict(<class 'dict'>, {'accept': {'oldstates': ['new', 'assigned', 'accepted', 'reopened'], 'newstate': 'accepted', 'operations': ['set_owner_to_self'], 'permissions': ['TICKET_MODIFY'], 'label': 'accept', 'name': '', 'default': 0}, 'create': {'oldstates': [None], 'newstate': 'new', 'default': 1, 'label': 'create', 'name': '', 'operations': [], 'permissions': []}, 'create_and_assign': {'oldstates': [None], 'newstate': 'assigned', 'label': 'assign', 'operations': ['may_set_owner'], 'permissions': ['TICKET_MODIFY'], 'name': '', 'default': 0}, 'leave': {'oldstates': ['*'], 'newstate': '*', 'default': 1, 'operations': ['leave_status'], 'label': 'leave', 'name': '', 'permissions': []}, 'reassign': {'oldstates': ['new', 'assigned', 'accepted', 'reopened'], 'newstate': 'assigned', 'operations': ['set_owner'], 'permissions': ['TICKET_MODIFY'], 'label': 'reassign', 'name': '', 'default': 0}, 'reopen': {'oldstates': ['closed'], 'newstate': 'reopened', 'operations': ['del_resolution'], 'permissions': ['TICKET_CREATE'], 'label': 'reopen', 'name': '', 'default': 0}, 'resolve': {'oldstates': ['new', 'assigned', 'accepted', 'reopened'], 'newstate': 'closed', 'operations': ['set_resolution'], 'permissions': ['TICKET_MODIFY'], 'label': 'resolve', 'name': '', 'default': 0}, '_reset': {'default': 0, 'label': 'Reset', 'newstate': 'new', 'oldstates': [], 'operations': ['reset_workflow'], 'permissions': ['TICKET_ADMIN']}})

2025-02-22 15:49:44,996 Trac[env] WARNING: Component <Component trac.db.api.DatabaseManager> failed with TracError: Unsupported database type "postgres"
2025-02-22 15:49:44,996 Trac[env] ERROR: Exception caught while checking for upgrade: TracError: Unable to check for upgrade of trac.db.api.DatabaseManager: TracError: Unsupported database type "postgres"