backstage / community-plugins

Community plugins for Backstage
Apache License 2.0
157 stars 176 forks source link

🐛 Entity-feedback: Entity Feedback Plugin: GET /ratings/:entityRef returns 404 in production, but /ratings?ownerRef works #1523

Open bchemsed1 opened 2 days ago

bchemsed1 commented 2 days ago

Plugin Name

Entity-feedback

📜 Description

The Entity Feedback plugin is experiencing inconsistent behavior in our production environment (EKS cluster behind a proxy). GET requests using query parameters work as expected, but requests using path parameters for entity references return a 404 error.

Request URL:
https://developer.ec1.aws.aztec.cloud/api/entity-feedback/ratings/component%3Adefault%2Fbuildon
Request Method:
GET
Status Code:
404 Not Found
Remote Address:
44.***.109.***:443
Request URL:
https://developer.ec1.aws.aztec.cloud/api/entity-feedback/ratings?ownerRef=group%3Adefault%2Fcore
Request Method:
GET
Status Code:
200 OK
Remote Address:
44.***.109.***:443

👍 Expected behavior

Both requests should return 200 OK with the appropriate data.

👎 Actual Behavior with Screenshots

The request with the entity reference in the path returns a 404 Not Found, while the request with the ownerRef query parameter works correctly.

👟 Reproduction steps

  1. Deploy Backstage with Entity Feedback plugin to production environment
  2. Make a GET request to /api/entity-feedback/ratings?ownerRef=group:default/core
    • Result: Returns 200 OK with expected data
  3. Make a GET request to /api/entity-feedback/ratings/component:default/buildon-sandbox
    • Result: Returns 404 Not Found

📃 Provide the context for the Bug.

👀 Have you spent some time to check if this bug has been raised before?

🏢 Have you read the Code of Conduct?

Are you willing to submit PR?

None

kuangp commented 2 days ago

Hmm going to need a bit more info to try to debug this - do you see any log messages in the backend that corresponds to that 404 request? can you also provide what Backstage and plugin versions you're on?

bchemsed1 commented 2 days ago

Hello @kuangp,

We are currently using Backstage version 1.22.19.

Here are all the logs I see when I try to interact with the plugin:

2024-10-14T13:54:06.616Z backstage info ::ffff:1.240.163.118 - - [14/Oct/2024:13:54:06 +0000] "GET /api/entity-feedback/ratings/component:default/buildon HTTP/1.1" 404 - "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36 Edg/129.0.0.0" type=incomingRequest
2024-10-14T13:54:32.954Z backstage info ::ffff:1.240.163.118 - - [14/Oct/2024:13:54:32 +0000] "GET /api/entity-feedback/ratings/component:default/buildon HTTP/1.1" 404 - "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36 Edg/129.0.0.0" type=incomingRequest
2024-10-14T13:55:12.092Z backstage info ::ffff:1.240.163.118 - - [14/Oct/2024:13:55:12 +0000] "POST /api/entity-feedback/ratings/component:default/buildon HTTP/1.1" 404 - "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36 Edg/129.0.0.0" type=incomingRequest
2024-10-14T13:55:16.026Z backstage info ::ffff:1.240.163.118 - - [14/Oct/2024:13:55:16 +0000] "POST /api/entity-feedback/ratings/component:default/buildon HTTP/1.1" 404 - "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36 Edg/129.0.0.0" type=incomingRequest
2024-10-14T13:55:46.721Z backstage info ::ffff:1.240.163.118 - - [14/Oct/2024:13:55:46 +0000] "GET /api/entity-feedback/ratings?ownerRef=group%3Adefault%2Fcore HTTP/1.1" 200 2 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36 Edg/129.0.0.0" type=incomingRequest

Let me know it you need to more info

bchemsed1 commented 2 days ago

Sorry forgot the plugins versions: The frontend is on : @backstage-community/plugin-entity-feedback": "^0.3.5 And the backend: @backstage-community/plugin-entity-feedback-backend": "^0.3.1