Skip to content

Scheduler /history endpoint throws 500 Server Error #3415

@adblair

Description

@adblair

Problem

The /history endpoint in the scheduler web UI fails with a 500 error.

Steps to reproduce

Using Python 3.13:

> pip install 'luigi==3.8.0' 'sqlalchemy<1.4'
...

> cat << EOF > luigi.cfg
[scheduler]
record_task_history = True

[task_history]
db_connection = sqlite:///history.sqlite
EOF

> luigid
...

Then visit http://localhost:8082/history

Expected behaviour

Task history UI is shown.

Actual behaviour

"500: Internal Server Error" is shown.

Logs from luigid:

2026-04-08 15:22:19,391 tornado.application[87851] ERROR: Uncaught exception GET /history (::1)
HTTPServerRequest(protocol='http', host='localhost:8082', method='GET', uri='/history', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
  File "/Users/arthurb/.virtualenvs/temp/lib/python3.13/site-packages/tornado/web.py", line 1878, in _execute
    result = method(*self.path_args, **self.path_kwargs)
  File "/Users/arthurb/.virtualenvs/temp/lib/python3.13/site-packages/luigi/server.py", line 236, in get
    self.render("recent.html", tasks=tasks)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/arthurb/.virtualenvs/temp/lib/python3.13/site-packages/tornado/web.py", line 1025, in render
    html = self.render_string(template_name, **kwargs)
  File "/Users/arthurb/.virtualenvs/temp/lib/python3.13/site-packages/tornado/web.py", line 1157, in render_string
    template_path = self.get_template_path()
  File "/Users/arthurb/.virtualenvs/temp/lib/python3.13/site-packages/luigi/server.py", line 160, in get_template_path
    return importlib.resources.files("templates").name
           ^^^^^^^^^^^^^^^^^^^
AttributeError: module 'importlib' has no attribute 'resources'
2026-04-08 15:22:19,397 tornado.access[87851] ERROR: 500 GET /history (::1) 13.44ms

Notes

It looks like the relevant change was fc62c36, so this affects 3.7.3+. Should be an easy fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions