Page MenuHomePhabricator

Deleting ENC projects is broken
Open, MediumPublic

Description

Deleting a Puppet ENC project fails because it tries to resolve the project name for the project ID:

2026-02-05 12:25:34.708 189710 ERROR uwsgi_file__usr_local_lib_python3_13_dist-packages_puppet-enc [None req-c331e2dd-7e5a-4ac8-a10c-004eda907d3a novaadmin admin - - default default] Exception on /v1/admin/project/checkuser-beta-wiki [DELETE]: KeyError: 'checkuser-beta-wiki'
2026-02-05 12:25:34.708 189710 ERROR uwsgi_file__usr_local_lib_python3_13_dist-packages_puppet-enc Traceback (most recent call last):
2026-02-05 12:25:34.708 189710 ERROR uwsgi_file__usr_local_lib_python3_13_dist-packages_puppet-enc   File "/usr/lib/python3/dist-packages/flask/app.py", line 1511, in wsgi_app
2026-02-05 12:25:34.708 189710 ERROR uwsgi_file__usr_local_lib_python3_13_dist-packages_puppet-enc     response = self.full_dispatch_request()
2026-02-05 12:25:34.708 189710 ERROR uwsgi_file__usr_local_lib_python3_13_dist-packages_puppet-enc   File "/usr/lib/python3/dist-packages/flask/app.py", line 919, in full_dispatch_request
2026-02-05 12:25:34.708 189710 ERROR uwsgi_file__usr_local_lib_python3_13_dist-packages_puppet-enc     rv = self.handle_user_exception(e)
2026-02-05 12:25:34.708 189710 ERROR uwsgi_file__usr_local_lib_python3_13_dist-packages_puppet-enc   File "/usr/lib/python3/dist-packages/flask/app.py", line 917, in full_dispatch_request
2026-02-05 12:25:34.708 189710 ERROR uwsgi_file__usr_local_lib_python3_13_dist-packages_puppet-enc     rv = self.dispatch_request()
2026-02-05 12:25:34.708 189710 ERROR uwsgi_file__usr_local_lib_python3_13_dist-packages_puppet-enc   File "/usr/lib/python3/dist-packages/flask/app.py", line 902, in dispatch_request
2026-02-05 12:25:34.708 189710 ERROR uwsgi_file__usr_local_lib_python3_13_dist-packages_puppet-enc     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
2026-02-05 12:25:34.708 189710 ERROR uwsgi_file__usr_local_lib_python3_13_dist-packages_puppet-enc            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
2026-02-05 12:25:34.708 189710 ERROR uwsgi_file__usr_local_lib_python3_13_dist-packages_puppet-enc   File "/usr/local/lib/python3.13/dist-packages/puppet-enc.py", line 786, in delete_project
2026-02-05 12:25:34.708 189710 ERROR uwsgi_file__usr_local_lib_python3_13_dist-packages_puppet-enc     project_name = project_name_for_id(project)
2026-02-05 12:25:34.708 189710 ERROR uwsgi_file__usr_local_lib_python3_13_dist-packages_puppet-enc   File "/usr/local/lib/python3.13/dist-packages/puppet-enc.py", line 161, in project_name_for_id
2026-02-05 12:25:34.708 189710 ERROR uwsgi_file__usr_local_lib_python3_13_dist-packages_puppet-enc     return convertDict[project_id]
2026-02-05 12:25:34.708 189710 ERROR uwsgi_file__usr_local_lib_python3_13_dist-packages_puppet-enc            ~~~~~~~~~~~^^^^^^^^^^^^
2026-02-05 12:25:34.708 189710 ERROR uwsgi_file__usr_local_lib_python3_13_dist-packages_puppet-enc KeyError: 'checkuser-beta-wiki'
2026-02-05 12:25:34.708 189710 ERROR uwsgi_file__usr_local_lib_python3_13_dist-packages_puppet-enc

Probably we need to update ENC to store the project ID in a new database table so that mapping is available after a project has been deleted from openstack.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change #1239965 had a related patch set uploaded (by Majavah; author: Majavah):

[operations/puppet@production] openstack: encapi: Store project names in database

https://gerrit.wikimedia.org/r/1239965

taavi triaged this task as Medium priority.Wed, Feb 18, 11:55 AM

Change #1239965 merged by Majavah:

[operations/puppet@production] openstack: encapi: Store project names in database

https://gerrit.wikimedia.org/r/1239965