Skip to content
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

fix(wasm): add a startup check for missing filters #13764

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

flrgh
Copy link
Contributor

@flrgh flrgh commented Oct 16, 2024

Summary

This adds a check during init that will prevent Kong from starting if any filter chain entities are found in the database using a filter that is not installed. Example:

Error: ./kong/cmd/start.lua:99: nginx: [error] init_by_lua error: /path/to/kong/init.lua:750: [wasm]: found one or more filter chain entities with filters that are not enabled/installed:
filter chain: 9e0b56d6-0e8c-469f-bf15-142debdd5d05, filter: #1 (response_transformer)
filter chain: 9e0b56d6-0e8c-469f-bf15-142debdd5d05, filter: #3 (response_transformer)

Previously, this condition would not be caught until the Wasm state is built during init_worker. This change brings Wasm more in line with the behavior of the plugins iterator.

Checklist

  • The Pull Request has tests
  • A changelog file has been created under changelog/unreleased/kong or skip-changelog label added on PR if changelog is unnecessary. README.md
  • There is a user-facing docs PR against https://github.com/Kong/docs.konghq.com - PUT DOCS PR HERE

Issue reference

KAG-2636

@github-actions github-actions bot added core/proxy cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee core/wasm Everything relevant to [proxy-]wasm labels Oct 16, 2024
@team-gateway-bot team-gateway-bot added the author/community PRs from the open-source community (not Kong Inc) label Oct 16, 2024
@flrgh flrgh force-pushed the fix/wasm-no-start-with-missing-filters branch from 4bbc597 to 5f02827 Compare October 16, 2024 16:41
This adds a check during `init` that will prevent Kong from starting if
any filter chain entities are found in the database using a filter that
is not installed. Example:

> Error: ./kong/cmd/start.lua:99: nginx: [error] init_by_lua error: /path/to/kong/init.lua:750: [wasm]: found one or more filter chain entities with filters that are not enabled/installed:
> filter chain: 9e0b56d6-0e8c-469f-bf15-142debdd5d05, filter: #1 (response_transformer)
> filter chain: 9e0b56d6-0e8c-469f-bf15-142debdd5d05, filter: #3 (response_transformer)

Previously, this condition would not be caught until the Wasm state is
built during `init_worker`. This change brings Wasm more in line with the
behavior of the plugins iterator.
@flrgh flrgh force-pushed the fix/wasm-no-start-with-missing-filters branch from 5f02827 to 8f107b2 Compare October 23, 2024 16:49
@flrgh flrgh requested review from brentos and locao October 23, 2024 19:43
@locao locao merged commit 9a5353e into master Oct 23, 2024
26 checks passed
@locao locao deleted the fix/wasm-no-start-with-missing-filters branch October 23, 2024 21:38
@team-gateway-bot
Copy link
Collaborator

Successfully created cherry-pick PR for master:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author/community PRs from the open-source community (not Kong Inc) cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee core/proxy core/wasm Everything relevant to [proxy-]wasm size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants