failure when upgrading from Fedora 34 -> 35

23 views
Skip to first unread message

Ard Vilken

unread,
Jan 2, 2022, 4:45:24 PMJan 2
to Trac Users
Trac worked perfectly under F34 but upon a standard upgrade to 35, no longer works.  F35 uses Python 3.10 which might be part of the problem.  I reinstalled Python 3.9 and made it the system default but the problem still occurred.  On the user screen, it just displays "assertion error" but the full error follows.  This is the error after the F35 upgrade from trac.log:

2021-12-10 06:53:09,030 Trac[main] ERROR: [127.0.0.1] Internal Server Error: <RequestWithSession "GET '/report/1?sort=ticket&asc=0&page=1'">, referrer None
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/trac/web/main.py", line 610, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python3.10/site-packages/trac/web/main.py", line 302, in dispatch
    raise e
  File "/usr/lib/python3.10/site-packages/trac/web/main.py", line 266, in dispatch
    output = chrome.render_template(req, template, data, metadata)
  File "/usr/lib/python3.10/site-packages/trac/web/chrome.py", line 1377, in render_template
    template, data = self.prepare_template(req, filename, data, text,
  File "/usr/lib/python3.10/site-packages/trac/web/chrome.py", line 1480, in prepare_template
    template = self.load_template(filename, text)
  File "/usr/lib/python3.10/site-packages/trac/web/chrome.py", line 1323, in load_template
    return (self.jenv_text if text else self.jenv).get_template(filename)
  File "/usr/lib/python3.10/site-packages/jinja2/environment.py", line 997, in get_template
    return self._load_template(name, globals)
  File "/usr/lib/python3.10/site-packages/jinja2/environment.py", line 958, in _load_template
    template = self.loader.load(self, name, self.make_globals(globals))
  File "/usr/lib/python3.10/site-packages/jinja2/loaders.py", line 137, in load
    code = environment.compile(source, name, filename)
  File "/usr/lib/python3.10/site-packages/jinja2/environment.py", line 750, in compile
    source = self._generate(source, name, filename, defer_init=defer_init)
  File "/usr/lib/python3.10/site-packages/jinja2/environment.py", line 678, in _generate
    return generate(  # type: ignore
  File "/usr/lib/python3.10/site-packages/jinja2/compiler.py", line 117, in generate
    generator.visit(node)
  File "/usr/lib/python3.10/site-packages/jinja2/visitor.py", line 40, in visit
    return f(node, *args, **kwargs)
  File "/usr/lib/python3.10/site-packages/jinja2/compiler.py", line 935, in visit_Template
    self.blockvisit(block.body, block_frame)
  File "/usr/lib/python3.10/site-packages/jinja2/compiler.py", line 449, in blockvisit
    self.visit(node, frame)
  File "/usr/lib/python3.10/site-packages/jinja2/visitor.py", line 40, in visit
    return f(node, *args, **kwargs)
  File "/usr/lib/python3.10/site-packages/jinja2/compiler.py", line 1299, in visit_If
    self.blockvisit(node.body, if_frame)
  File "/usr/lib/python3.10/site-packages/jinja2/compiler.py", line 449, in blockvisit
    self.visit(node, frame)
  File "/usr/lib/python3.10/site-packages/jinja2/visitor.py", line 40, in visit
    return f(node, *args, **kwargs)
  File "/usr/lib/python3.10/site-packages/jinja2/compiler.py", line 1262, in visit_For
    self.blockvisit(node.body, loop_frame)
  File "/usr/lib/python3.10/site-packages/jinja2/compiler.py", line 449, in blockvisit
    self.visit(node, frame)
  File "/usr/lib/python3.10/site-packages/jinja2/visitor.py", line 40, in visit
    return f(node, *args, **kwargs)
  File "/usr/lib/python3.10/site-packages/jinja2/compiler.py", line 1299, in visit_If
    self.blockvisit(node.body, if_frame)
  File "/usr/lib/python3.10/site-packages/jinja2/compiler.py", line 449, in blockvisit
    self.visit(node, frame)
  File "/usr/lib/python3.10/site-packages/jinja2/visitor.py", line 40, in visit
    return f(node, *args, **kwargs)
  File "/usr/lib/python3.10/site-packages/jinja2/compiler.py", line 1582, in visit_AssignBlock
    self.pop_assign_tracking(frame)
  File "/usr/lib/python3.10/site-packages/jinja2/compiler.py", line 813, in pop_assign_tracking
    ref = frame.symbols.ref(name)
  File "/usr/lib/python3.10/site-packages/jinja2/idtracking.py", line 80, in ref
    raise AssertionError(
AssertionError: Tried to resolve a name to a reference that was unknown to the frame ('header')
2021-12-10 06:53:09,031 Trac[perm] DEBUG: No policy allowed anonymous performing TRAC_ADMIN on None


Jun Omae

unread,
Jan 2, 2022, 5:21:09 PMJan 2
to trac-...@googlegroups.com
Please provide "System information" and "Enabled plugins" from about page in your Trac (at least, Jinja2 version).

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/0fddbe09-f3b4-4914-8e05-1e81fc006926n%40googlegroups.com.
--
Jun Omae <jun...@gmail.com> (大前 潤)

Ard Vilken

unread,
Jan 2, 2022, 11:40:51 PMJan 2
to Trac Users
I didn't see anything about enabled plugins but the system information:

Package        Version
Trac         1.5.3
Babel         2.9.1
Jinja2        
pysqlite         2.6.0
Python         3.10.0 (default, Oct 4 2021, 00:00:00) [GCC 11.2.1 20210728 (Red Hat 11.2.1-1)]
pytz         2021.3
setuptools         57.4.0
SQLite         3.36.0

Jinja2 had a blank entry.  Checked to see if jinja was installed and did this:

[~]# sudo dnf install python3-jinja2
Package python3-jinja2-3.0.1-2.fc35.noarch is already installed.
Dependencies resolved.
Nothing to do.

Jun Omae

unread,
Jan 3, 2022, 1:40:03 AMJan 3
to trac-...@googlegroups.com
On Mon, Jan 3, 2022 at 1:40 PM Ard Vilken <ardv...@gmail.com> wrote:
>
> I didn't see anything about enabled plugins but the system information:
>
> Package Version
> Trac 1.5.3
> Babel 2.9.1
> Jinja2
> pysqlite 2.6.0
> Python 3.10.0 (default, Oct 4 2021, 00:00:00) [GCC 11.2.1 20210728 (Red Hat 11.2.1-1)]
> pytz 2021.3
> setuptools 57.4.0
> SQLite 3.36.0
>
> Jinja2 had a blank entry. Checked to see if jinja was installed and did this:
>
> [~]# sudo dnf install python3-jinja2
> Package python3-jinja2-3.0.1-2.fc35.noarch is already installed.
> Dependencies resolved.
> Nothing to do.
> ...
> AssertionError: Tried to resolve a name to a reference that was unknown to the frame ('header')

That is a Jinja2 issue. See https://github.com/pallets/jinja/issues/1427.
Try to upgrade Jinja2 to 3.0.2+ or downgrade to 2.x.

In trunk of Trac, workaround for the issue has been applied.
Trac 1.5.4 has the changes, however is not still released.
See https://trac.edgewall.org/ticket/13404.
Reply all
Reply to author
Forward
0 new messages