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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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
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 4bbc597 to 5f02827 Compare October 16, 2024 16:41
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.

2 participants