8000 Fix KeyError when looking up handlers on legacy models by dominikschubert · Pull Request #8584 · localstack/localstack · GitHub
[go: up one dir, main page]

Skip to content

Fix KeyError when looking up handlers on legacy models #8584

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 28, 2023

Conversation

dominikschubert
Copy link
Member
@dominikschubert dominikschubert commented Jun 28, 2023

Currently the logs get spammed with KeyErrors caused by the stack cleanup and its delete action lookups on the GenericBaseModels.

Example:

2023-06-28T09:20:35.957 ERROR --- [  asgi_gw_10] localstack.services.cloudformation.engine.template_deployer : Last cycle failed to delete resource with id Version. Final exception: 'delete'
Traceback (most recent call last):
  File "/tmp/workspace/repo/localstack/services/cloudformation/engine/template_deployer.py", line 881, in delete_stack
    executor.deploy_loop(resource_provider_payload)  # noqa
  File "/tmp/workspace/repo/localstack/services/cloudformation/resource_provider.py", line 558, in deploy_loop
    event = self.execute_action(payload)
  File "/tmp/workspace/repo/localstack/services/cloudformation/resource_provider.py", line 602, in execute_action
    return resource_provider.delete(request)
  File "/tmp/workspace/repo/localstack/services/cloudformation/resource_provider.py", line 421, in delete
    return self.create_or_delete(request)
  File "/tmp/workspace/repo/localstack/services/cloudformation/resource_provider.py", line 449, in create_or_delete
    func_details = func_details[LEGACY_ACTION_MAP[request.action]]
KeyError: 'delete'

This now behaves as previously before the introduction of the LegacyResourceProvider by simply ignoring the resource action and assuming a SUCCESS state immediately if get_deploy_templates doesn't contain the requested handler.

@dominikschubert dominikschubert requested a review from pinzon June 28, 2023 10:03
@dominikschubert dominikschubert self-assigned this Jun 28, 2023
@dominikschubert dominikschubert added the semver: patch Non-breaking changes which can be included in patch releases label Jun 28, 2023
@coveralls
Copy link

Coverage Status

coverage: 82.649% (-0.005%) from 82.654% when pulling 9aefde1 on fix-cfn-delete-warnings into bee5f76 on master.

@github-actions
Copy link

LocalStack Community integration with Pro

       2 files         2 suites   1h 20m 28s ⏱️
2 166 tests 1 828 ✔️ 338 💤 0
2 167 runs  1 828 ✔️ 339 💤 0

Results for commit 9aefde1.

@dominikschubert dominikschubert requested a review from dfangl June 28, 2023 12:38
@thrau thrau merged commit 1987e57 into master Jun 28, 2023
@thrau thrau deleted the fix-cfn-delete-warnings branch June 28, 2023 12:52
@dfangl dfangl added this to the 2.2 milestone Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: patch Non-breaking changes which can be included in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0