Skip to content

FIX pyrit initializer config in ARM templates must be comma-separated - #1955

Merged
behnam-o merged 5 commits into
microsoft:mainfrom
behnam-o:fix-copyrit-startup
Jun 9, 2026
Merged

FIX pyrit initializer config in ARM templates must be comma-separated#1955
behnam-o merged 5 commits into
microsoft:mainfrom
behnam-o:fix-copyrit-startup

Conversation

@behnam-o

@behnam-o behnam-o commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

In startup.sh, the initializers passed in an env var are expected to be comma-separated, but in our ARM templates, they are not. This causes crashes like this when for the container app:

Connecting to stream...
2026-06-08T18:23:32.50309  Connecting to the container 'pyrit-gui'...
2026-06-08T18:23:32.61244  Successfully Connected to container: 'pyrit-gui' [Revision: 'copyrit-test1--0000094', Replica: 'copyrit-test1--0000094-6c4d75bc8c-djbqz']
2026-06-08T18:22:13.1916813Z stderr F     return await anext(self.gen)
2026-06-08T18:22:13.1916831Z stderr F            ^^^^^^^^^^^^^^^^^^^^^
2026-06-08T18:22:13.1916850Z stderr F   File "/opt/venv/lib/python3.11/site-packages/fastapi/routing.py", line 216, in merged_lifespan
2026-06-08T18:22:13.1917523Z stderr F     async with original_context(app) as maybe_original_state:
2026-06-08T18:22:13.1917590Z stderr F   File "/usr/lib/python3.11/contextlib.py", line 204, in __aenter__
2026-06-08T18:22:13.1917644Z stderr F     return await anext(self.gen)
2026-06-08T18:22:13.1917666Z stderr F            ^^^^^^^^^^^^^^^^^^^^^
2026-06-08T18:22:13.1917684Z stderr F   File "/app/pyrit/backend/main.py", line 55, in lifespan
2026-06-08T18:22:13.1917702Z stderr F     await config.initialize_pyrit_async()
2026-06-08T18:22:13.1917721Z stderr F   File "/app/pyrit/setup/configuration_loader.py", line 550, in initialize_pyrit_async
2026-06-08T18:22:13.1917741Z stderr F     resolved_initializers = self.resolve_initializers()
2026-06-08T18:22:13.1917759Z stderr F                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-06-08T18:22:13.1917776Z stderr F   File "/app/pyrit/setup/configuration_loader.py", line 472, in resolve_initializers
2026-06-08T18:22:13.1917800Z stderr F     initializer_class = registry.get_class(config.name)
2026-06-08T18:22:13.1917820Z stderr F                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-06-08T18:22:13.1917840Z stderr F   File "/app/pyrit/registry/class_registries/base_class_registry.py", line 212, in get_class
2026-06-08T18:22:13.1917860Z stderr F     raise KeyError(f"'{name}' not found in registry. Available: {available}")
2026-06-08T18:22:13.1918066Z stderr F KeyError: "'target airt' not found in registry. Available: airt, load_default_datasets, preload_scenario_metadata, scenario_objective_list, scenario_technique, scorer, simple, target"
2026-06-08T18:22:13.1918102Z stderr F 
2026-06-08T18:22:13.1918128Z stderr F ERROR:    Application startup failed. Exiting.

@varunj-msft

Copy link
Copy Markdown
Contributor

Nice catch on the root cause! Should we apply the same comma fix to parameters.example.json, parameters.demo.json, and the two stale doc mentions in README.md and DEPLOY_NEW_INSTANCE.md? Looks like the manual az deployment path would still hit the same crash otherwise

@behnam-o
behnam-o added this pull request to the merge queue Jun 9, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 9, 2026
@behnam-o
behnam-o added this pull request to the merge queue Jun 9, 2026
Merged via the queue into microsoft:main with commit 58505b6 Jun 9, 2026
47 checks passed
@behnam-o
behnam-o deleted the fix-copyrit-startup branch June 9, 2026 22:55
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.

2 participants