edgexfoundry / app-rfid-llrp-inventory

Apache License 2.0
9 stars 20 forks source link

[LLRP] Discovery command on RRFID gateway gives error with status code 202 #263

Open vyshali-chitikeshi opened 1 year ago

vyshali-chitikeshi commented 1 year ago

🐞 Bug Report

Affected Services [REQUIRED]

The issue is located in: RFID device service ### Is this a regression? Not sure ### Description and Minimal Reproduction [**REQUIRED**] Discovery command on RFID gateway UI gives below error: 'Request failed. Status code of 202' Repro steps: 1. Setup RFID gateway hardware as per documentation 2. Deploy the RFID device and app-inventory service with latest V3 code. 3. Go to http://127.0.0.1:59711/ RFID gateway UI a) Right click on webpage, click on 'inspect' to open browser console b) If CORS is not enabled on consul (by default CORS is disabled), notice that it gives CORS related errors on console but no errors on UI. c) Enable CORS on consul and set corsallowed origin on consul. Find attached consul screesnhtos. d) Restart rfid-device service e) Refresh RFID gateway UI f) Open browser console g) Click on 'Discovery' Actual behavior: It gives request failed error with status code of 202 on UI and also on browser console. Expected behavior: The UI should not complain about the 202 status code In the debug logs it shows 'Discover triggered' message correctly, Find attached debug logs, UI screenshots before and after enabling CORS. ![UI_before_enabling_CORS'](https://github.com/edgexfoundry/device-rfid-llrp-go/assets/60447543/bd27cc43-ae76-4480-a14c-6d74ed9b314d) ![UI_after_enabling_CORS](https://github.com/edgexfoundry/device-rfid-llrp-go/assets/60447543/bcf2752c-ef96-4174-9d4a-0084026303fe) ![CORS_allowed_origin](https://github.com/edgexfoundry/device-rfid-llrp-go/assets/60447543/5d8a70d7-3f54-4a05-82e1-9926ee5983eb) ![Screenshot from 2023-05-30 16-35-17](https://github.com/edgexfoundry/device-rfid-llrp-go/assets/60447543/7ea4869d-c2df-4d26-992a-1c0d578f06c3) [_edgex-device-rfid-llrp_logs (2).txt](https://github.com/edgexfoundry/device-rfid-llrp-go/files/11607598/_edgex-device-rfid-llrp_logs.2.txt) ## πŸ”₯ Exception or Error



🌍 Your Environment

Deployment Environment:

EdgeX Version [REQUIRED]:

Anything else relevant?

ajcasagrande commented 10 months ago

HTTP 202 means Accepted and is a success response. Likely we just are checking for 200 OK only, and instead should check for 2xx or 200 and 202.