hanzhenfang commented on issue #13325:
URL: https://github.com/apache/apisix/issues/13325#issuecomment-4660280967

   I also reproduction for this issue with APISIX `3.16.0` in `standalone` YAML 
mode. The important conditions are `enable_admin: false`, `proxy_mode: 
"http&stream"`, YAML config provider, `stream_proxy.tcp`, and an xRPC Redis 
`stream_route`.
   
   `docker-compose.yaml`:
   
   ```yaml
   name: issue-13325
   
   services:
     apisix:
       image: apache/apisix:3.16.0-debian
       container_name: issue-13325-apisix
       restart: "no"
       volumes:
         - ./config.yaml:/usr/local/apisix/conf/config.yaml:ro
         - ./apisix.yaml:/usr/local/apisix/conf/apisix.yaml:ro
       ports:
         - "19080:9080"
         - "19101:9101"
         - "19090:9090"
   ```
   
   `config.yaml`:
   
   ```yaml
   apisix:
     node_listen:
       - 9080
     enable_admin: false
     proxy_mode: "http&stream"
     stream_proxy:
       tcp:
         - 9101
   
   xrpc:
     protocols:
       - name: redis
   
   deployment:
     role: data_plane
     role_data_plane:
       config_provider: yaml
   
   control:
     ip: 0.0.0.0
     port: 9090
   ```
   
   `apisix.yaml`:
   
   ```yaml
   stream_routes:
     - id: 1
       server_port: 9101
       protocol:
         name: redis
       upstream:
         type: roundrobin
         nodes:
           "127.0.0.1:6379": 1
   #END
   ```
   
   Reproduction steps:
   
   ```sh
   docker compose up -d
   docker compose exec -T apisix apisix version
   docker logs --since 5m issue-13325-apisix 2>&1 | rg -n 'unknown protocol 
\[redis\]|property "faults"'
   docker compose down
   ```
   
   Observed APISIX version:
   
   ```text
   3.16.0
   ```
   
   Observed error:
   
   ```text
   [error] ... [lua] config_yaml.lua:333: failed to check item data of 
[stream_routes] err:unknown protocol [redis] ...
   ```
   
   A real Redis upstream is not required for this reproduction because the 
failure happens while APISIX loads and validates `apisix.yaml`, before any TCP 
traffic is proxied to the upstream. In this setup, `proxy_mode: "http&stream"` 
starts both HTTP and stream worker initialization paths. The YAML provider is 
initialized in the HTTP worker as well, so the HTTP worker validates 
`stream_routes`. However, with `enable_admin: false`, the HTTP-side xRPC 
initialization returns before registering the Redis protocol schema, so 
validating `protocol.name: redis` fails with `unknown protocol [redis]`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to