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

Validating route headers against Konnect results in "proto: syntax error (line 1:20): unexpected token [" #14299

Open
1 task done
dimimari-flutterint opened this issue Feb 20, 2025 · 2 comments
Labels
konnect pending author feedback Waiting for the issue author to get back to a maintainer with findings, more details, etc...

Comments

@dimimari-flutterint
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Kong version ($ kong version)

Kong Konnect (Data plane nodes 3.8.0.0)

Current Behavior

When validating a route with headers present, the local deck file validate passes while the deck gateway validate throws an error. This behavior is present against Kong Konnect, validating against an on prem Kong control plane does not have the error. When configuring the header from the UI it is accepted and saved, when dumping the config the same syntax is being used. Both deck and postman/curl requests for the same example service and route (see Steps To Reproduce) return the error.

Expected Behavior

The validate should pass.

Steps To Reproduce

Test service

_format_version: "3.0"
services:
- connect_timeout: 60000
  enabled: true
  host: www.example.com
  name: MockService
  path: /path
  port: 443
  protocol: https
  read_timeout: 60000
  retries: 5
  routes:
  - hosts:
    - testhost.com
    headers:
      Test:
        - ~*.+
    https_redirect_status_code: 426
    methods:
    - GET
    name: test_route
    path_handling: v0
    paths:
    - /path1
    - ~/path1/status$
    preserve_host: false
    protocols:
    - http
    - https
    regex_priority: 0
    request_buffering: true
    response_buffering: true
    strip_path: false
    tags:
    - test
  tags:
  - TestService
  write_timeout: 60000

Run deck file validate

deck file validate mockservice.yaml

Run deck gateway validate

deck gateway validate mockservice.yaml --konnect-addr https://us.api.konghq.com --konnect-token <token> --konnect-control-plane-name <cplane>
Error: validate entity 'routes (test_route)': HTTP status 400 (message: "proto: syntax error (line 1:20): unexpected token [")

Anything else?

Running the same on Kong Enterprise 3.4.3.10 does not produce the error.

deck gateway validate mockservice.yaml --kong-addr https://api.kongenterprise.site --headers "kong-admin-token:token" -w <workspace>
@dimimari-flutterint
Copy link
Author

Possibly relates to Kong/gateway-operator#1044

@nowNick
Copy link
Contributor

nowNick commented Feb 22, 2025

@dimimari-flutterint could you run the validate function with more verbose output by adding --verbose 1? It'd be a bit easier to debug.
deck --verbose 1 gateway validate mockservice.yaml (...)

@GGabriele it seems like an issue related to Konnect API - could you take a look?

@nowNick nowNick added the pending author feedback Waiting for the issue author to get back to a maintainer with findings, more details, etc... label Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
konnect pending author feedback Waiting for the issue author to get back to a maintainer with findings, more details, etc...
Projects
None yet
Development

No branches or pull requests

2 participants