Skip to content

Absence of lib2to3 on ubuntu server causes role to fail #223

@jdavcs

Description

@jdavcs

We still use the lib2to3 module in lib/galaxy/util/template.py; however, it is not included in Debian python distributions (at least 3.12+). As a result, running a fresh galaxy install on ubuntu server 24.04 fails:

TASK [galaxyproject.galaxy : Get current Galaxy DB version] ********************************************************************************************************************************************************************************************************************************************************************************************************************************
fatal: [192.168.1.157]: FAILED! => changed=false 
  cmd:
  - /srv/galaxy/venv/bin/python
  - /srv/galaxy/server/scripts/manage_db.py
  - -c
  - /srv/galaxy/config/galaxy.yml
  - db_version
  delta: '0:00:00.760434'
  end: '2025-02-15 19:51:32.313093'
  failed_when_result: true
  msg: non-zero return code
  rc: 1
  start: '2025-02-15 19:51:31.552659'
  stderr: |-
    Traceback (most recent call last):
      File "/srv/galaxy/server/scripts/manage_db.py", line 12, in <module>
        from galaxy.model.migrations.scripts import LegacyManageDb
      File "/srv/galaxy/server/lib/galaxy/model/__init__.py", line 144, in <module>
        from galaxy.files.templates import (
      File "/srv/galaxy/server/lib/galaxy/files/__init__.py", line 16, in <module>
        from galaxy.files.sources import (
      File "/srv/galaxy/server/lib/galaxy/files/sources/__init__.py", line 37, in <module>
        from galaxy.util.template import fill_template
      File "/srv/galaxy/server/lib/galaxy/util/template.py", line 28, in <module>
        from lib2to3.refactor import RefactoringTool
    ModuleNotFoundError: No module named 'lib2to3'

The package is deprecated and scheduled for removal in 3.13. More context:
galaxyproject/galaxy#16796 (comment)
and galaxyproject/galaxy#18449

I'm not sure what's the right way to handle this. One solution is to install the 2to3 package. This could be added to a task within the role, maybe? If not, should we add a note to the readme?

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