You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "FrankLin8310 (via GitHub)" <gi...@apache.org> on 2026/02/02 02:55:44 UTC

[I] bug: pass_host is reset to default value "pass" when editing upstream nodes [apisix-dashboard]

FrankLin8310 opened a new issue, #3294:
URL: https://github.com/apache/apisix-dashboard/issues/3294

   ### Issue description
   
   When editing upstream nodes in APISIX Dashboard (adding, removing, or modifying nodes), the `pass_host` field is automatically reset to the default value `"pass"`, instead of preserving the previously configured value (e.g., `"node"`).
   
   This causes serious issues when the backend is a Kubernetes Ingress or reverse proxy that relies on the Host header for routing - requests fail with `404 Not Found` because the wrong Host header is sent.
   
   **Environment:**
   - APISIX version: 3.2.2 LTS
   - APISIX Dashboard version: 3.0.1
   - etcd version: 3.5.7
   
   **Related Issues:**
   - #3270 (Discovery Args are dropped when edit upstream) - Similar pattern
   - #3269 (Plugin config is dropped when edit Route) - Similar pattern
   
   ### Expected behavior
   
   When editing upstream nodes, the `pass_host` field should retain its previously configured value (e.g., `"node"`), not be reset to the default value `"pass"`.
   
   ### How to Reproduce
   
   1. Create an upstream via Admin API or Dashboard with:
      - Node: `my-service.my-namespace.svc:80` (domain-based)
      - `pass_host: "node"`
   
   2. Verify the upstream works correctly (backend receives proper Host header)
   
   3. Edit the upstream in Dashboard - add or modify a node
   
   4. Save the upstream
   
   5. Check the configuration via Admin API:
      curl -s http://127.0.0.1:9180/apisix/admin/upstreams/{id} -H 'X-API-KEY: xxx'
   
   6. Observe that `pass_host` has been reset to `"pass"` instead of remaining `"node"`
   
   ### Screenshots
   
   _No response_
   
   ### Environment
   
   - apisix version (cmd: `apisix version`):
   - OS (cmd: `uname -a`):
   - OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`):
   - etcd version, if have (cmd: run `etcd --version`):
   - apisix-dashboard version, if have:
   - Browser version, if have:
   
   
   ### Additional context
   
   _No response_


-- 
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: notifications-unsubscribe@apisix.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: pass_host is reset to default value "pass" when editing upstream nodes [apisix-dashboard]

Posted by "DSingh0304 (via GitHub)" <gi...@apache.org>.
DSingh0304 commented on issue #3294:
URL: https://github.com/apache/apisix-dashboard/issues/3294#issuecomment-3839962667

   I will try to reproduce it and raise a PR...


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: pass_host is reset to default value "pass" when editing upstream nodes [apisix-dashboard]

Posted by "DSingh0304 (via GitHub)" <gi...@apache.org>.
DSingh0304 commented on issue #3294:
URL: https://github.com/apache/apisix-dashboard/issues/3294#issuecomment-3895424439

   > Hi [@FrankLin8310](https://github.com/FrankLin8310), the old version of the dashboard is [no longer maintained](https://github.com/apache/apisix-dashboard/issues/2981). I just tried the reproduction steps in the new version, and it works normally.
   > 
   > Hi [@DSingh0304](https://github.com/DSingh0304), based on which version did you reproduce this problem?
   
   I originally noticed the pattern in the code (no defaultValues in useForm() + shouldUnregister: true) and treated it as a potential issue based on the original report. I wasn't able to reliably reproduce the reset on the new dashboard so your finding is consistent with mine.
   
   The PR is more of a defensive improvement; it aligns with React Hook Form's recommended pattern for edit forms and adds E2E coverage for preserving pass_host. Happy to retitle it if you'd prefer it framed that way or we can close the issue.


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: pass_host is reset to default value "pass" when editing upstream nodes [apisix-dashboard]

Posted by "Baoyuantop (via GitHub)" <gi...@apache.org>.
Baoyuantop commented on issue #3294:
URL: https://github.com/apache/apisix-dashboard/issues/3294#issuecomment-3894547131

   Hi @FrankLin8310, the old version of the dashboard is [no longer maintained](https://github.com/apache/apisix-dashboard/issues/2981). I just tried the reproduction steps in the new version, and it works normally.
   
   Hi @DSingh0304, based on which version did you reproduce this problem?


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org