Skip to content

Conversation

@cognifloyd
Copy link
Member

@cognifloyd cognifloyd commented Sep 30, 2025

The pythonpath changes in pyproject.toml masked the broken import of apr1. The flat_file backend does not seem to work with v0.4.0 because of this import error. Stevedore just happily skips this bakcend plugin, saying that it is not even available.

You can see some log output from running tools/config_gen.py in pants CI and in legacy ci, and in particular these line:

2025-09-30 01:09:16,189 DEBUG [-] found extension EntryPoint(name='flat_file', value='st2auth_flat_file_backend.flat_file:FlatFileAuthenticationBackend', group='st2auth.backends.backend')
2025-09-30 01:09:16,192 ERROR [-] Could not load 'flat_file': No module named 'apr1'
Traceback (most recent call last):
  File "/home/runner/.cache/pants/named_caches/pex_root/venvs/1/s/9cffbce3/venv/lib/python3.10/site-packages/stevedore/extension.py", line 206, in _load_plugins
    ext = self._load_one_plugin(ep,
  File "/home/runner/.cache/pants/named_caches/pex_root/venvs/1/s/9cffbce3/venv/lib/python3.10/site-packages/stevedore/extension.py", line 240, in _load_one_plugin
    plugin = ep.load()
  ...
  File "/home/runner/.cache/pants/named_caches/pex_root/venvs/1/s/9cffbce3/venv/lib/python3.10/site-packages/st2auth_flat_file_backend/__init__.py", line 18, in <module>
    from .flat_file import FlatFileAuthenticationBackend
  File "/home/runner/.cache/pants/named_caches/pex_root/venvs/1/s/9cffbce3/venv/lib/python3.10/site-packages/st2auth_flat_file_backend/flat_file.py", line 21, in <module>
    import apr1
ModuleNotFoundError: No module named 'apr1'

So, that pythonpath manipulation did not reflect how st2 actually runs the plugins (It does not put the package dir on PYTHONPATH).

I will cut v0.4.1 once this is merged.

@cognifloyd cognifloyd enabled auto-merge (squash) September 30, 2025 01:50
@cognifloyd cognifloyd requested a review from nzlosh September 30, 2025 01:50
@nzlosh
Copy link
Contributor

nzlosh commented Sep 30, 2025

Good catch!

@cognifloyd cognifloyd merged commit f53224a into master Sep 30, 2025
8 checks passed
@cognifloyd cognifloyd deleted the fix-apr1-import branch September 30, 2025 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants