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

An empty host is not detected by validation #948

Open
Hemiun opened this issue Dec 13, 2024 · 1 comment · May be fixed by luraproject/lura#744
Open

An empty host is not detected by validation #948

Hemiun opened this issue Dec 13, 2024 · 1 comment · May be fixed by luraproject/lura#744
Assignees

Comments

@Hemiun
Copy link

Hemiun commented Dec 13, 2024

Version of KrakenD you are using
2.8.0

Is your feature request related to a problem? Please describe.
There isn't some validation for missed host in backend section of the configuration. We only find out about the problem after the first call. According to the documentation, the service should not be running:

An array with all the available hosts to [load balance](https://www.krakend.io/docs/throttling/load-balancing/#balancing-egress-traffic-to-upstream) requests, including the schema (when possible) schema://host:port. E.g.: https://my.users-ms.com. If you are in a platform where hosts or services are balanced (e.g., a K8S service), write a single entry in the array with the service name/balancer address. Defaults to the host declaration at the configuration’s root level, and the service fails starting when there is none.

In fact, the service starts without any worning or error.
I belive that the host is critical to launching the service and the user user should be aware of the problem as early as possible and not during query execution.

Describe the solution you'd like
I propose

  • Consider adding a warning at startup time
  • Consider implementing more stringent verification of the configuration (check command)
  • Describe actual behavior in documentaion

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
configuration example
Steps:

  1. Check config
krakend check -c krakend.json
Syntax OK!
  1. Run gateway
krakend run -c krakend.json
  1. Send request
GET http://<address>/api-without-backend
[GIN] 2024/12/13 - 16:53:26 | 500 |     264.166µs |   <address> | GET      "/api-without-backend"
@thedae thedae self-assigned this Dec 13, 2024
@thedae
Copy link
Member

thedae commented Dec 13, 2024

Hi @Hemiun thanks for reporting this issue, great catch!

We've logged this internally and will be working on a fix soon. You can expect this to be addressed as a patch release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants