Skip to content

Conversation

@sannya-singal
Copy link
Contributor

Motivation

Change error code from 500 to 501 in case the plugin is not part of the active license agreement.

Eg: localstack.aws.api.core.CommonServiceException: exception while calling cloudtrail.CreateTrail: plugin localstack.aws.provider:cloudtrail:pro is disabled, reason: This feature is not part of the active license agreement should return 501.

Changes

Set status code to 501 if when creating the error response in the handler.

Tests

This was tested by manually intervening the license activation process in the core repo by not updating, validating and saving the license file.

Related

Fixes FLC-97

@sannya-singal sannya-singal self-assigned this Nov 6, 2025
@sannya-singal sannya-singal requested a review from thrau as a code owner November 6, 2025 07:12
@sannya-singal sannya-singal added semver: patch Non-breaking changes which can be included in patch releases docs: skip Pull request does not require documentation changes notes: skip Pull request does not have to be mentioned in the release notes labels Nov 6, 2025
@sannya-singal sannya-singal marked this pull request as draft November 6, 2025 07:12
@sannya-singal sannya-singal requested review from k-a-il and removed request for thrau November 6, 2025 07:26
@sannya-singal sannya-singal marked this pull request as ready for review November 6, 2025 07:27
@github-actions
Copy link

github-actions bot commented Nov 6, 2025

Test Results - Preflight, Unit

22 278 tests  ±0   20 526 ✅ ±0   15m 42s ⏱️ +18s
     1 suites ±0    1 752 💤 ±0 
     1 files   ±0        0 ❌ ±0 

Results for commit 347c382. ± Comparison against base commit 3262ccd.

@github-actions
Copy link

github-actions bot commented Nov 6, 2025

Test Results (amd64) - Acceptance

7 tests  ±0   5 ✅ ±0   3m 28s ⏱️ +2s
1 suites ±0   2 💤 ±0 
1 files   ±0   0 ❌ ±0 

Results for commit 347c382. ± Comparison against base commit 3262ccd.

@github-actions
Copy link

github-actions bot commented Nov 6, 2025

Test Results (amd64) - Integration, Bootstrap

    5 files  ±0      5 suites  ±0   2h 41m 24s ⏱️ + 2m 4s
5 268 tests ±0  4 739 ✅ ±0  529 💤 ±0  0 ❌ ±0 
5 274 runs  ±0  4 739 ✅ ±0  535 💤 ±0  0 ❌ ±0 

Results for commit 347c382. ± Comparison against base commit 3262ccd.

@github-actions
Copy link

github-actions bot commented Nov 6, 2025

LocalStack Community integration with Pro

    2 files  ±0      2 suites  ±0   2h 0m 9s ⏱️ +32s
4 894 tests ±0  4 525 ✅ ±0  369 💤 ±0  0 ❌ ±0 
4 896 runs  ±0  4 525 ✅ ±0  371 💤 ±0  0 ❌ ±0 

Results for commit 347c382. ± Comparison against base commit 3262ccd.

Comment on lines +226 to +233
if (
hasattr(exception, "reason")
and "not part of the active license agreement"
in str(getattr(exception, "reason", "")).lower()
):
status_code = 501
else:
status_code = 501 if config.FAIL_FAST else 500
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great to check if original logic is still correct, let's discuss it tomorrow 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs: skip Pull request does not require documentation changes notes: skip Pull request does not have to be mentioned in the release notes 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.

3 participants