Open nellshamrell opened 3 years ago
This is likely a bug in the service, due to an error in preview call to the service. The same preview call in the local dev environment is successful, and the issue is not reproducible. The failing service call in Dev deployment is: Post call to: https://dev-api.clearlydefined.io/definitions/go/golang/github.com/dgrijalva/jwt-go/v3.2.0+incompatible?matchCasing=false&preview=true body: {described: {releaseDate: "2022-06-04"}}
error response:
{"error":{"code":"404","message":"An error has occurred","innererror":{"status":404,"name":"Error","message":"Not Found","stack":"Error: Not Found\n at requestHandler (/opt/service/app.js:212:17)\n at Layer.handle [as handle_request] (/opt/service/node_modules/express/lib/router/layer.js:95:5)\n at trim_prefix (/opt/service/node_modules/express/lib/router/index.js:317:13)\n at /opt/service/node_modules/express/lib/router/index.js:284:7\n at Function.process_params (/opt/service/node_modules/express/lib/router/index.js:335:12)\n at next (/opt/service/node_modules/express/lib/router/index.js:275:10)\n at /opt/service/node_modules/express/lib/router/index.js:635:15\n at next (/opt/service/node_modules/express/lib/router/index.js:260:14)\n at Function.handle (/opt/service/node_modules/express/lib/router/index.js:174:3)\n at router (/opt/service/node_modules/express/lib/router/index.js:47:12)"}}}
@MichaelTsengLZ The issue can be produced on both dev and production servers, but I was not able to reproduce this in the local dev environment. The post preview call to the local service is successful in the dev environment; whereas the post call failed in for the dev deployment. This is where the root cause is suspected to be. Is there a way to find out the version for the production or dev server?
@qtomlinson Normally, if you could not reproduce locally with local config, try to run the server nodejs app with dev config. The dev environment is already up-to-date. If the dev environment has an issue, then I think you could just run the master branch with dev config. BTW, do you have access to those Dev Azure App Service? https://portal.azure.com/#@clearlydefinedoutlook.onmicrosoft.com/resource/subscriptions/e05584a1-ed97-4676-aec9-d82ba4c36c93/resourceGroups/clearlydefined-dev/providers/Microsoft.Web/sites/clearlydefined-api-dev/appServices
BTW, do you have access to those Dev Azure App Service? https://portal.azure.com/#@clearlydefinedoutlook.onmicrosoft.com/resource/subscriptions/e05584a1-ed97-4676-aec9-d82ba4c36c93/resourceGroups/clearlydefined-dev/providers/Microsoft.Web/sites/clearlydefined-api-dev/appServices
I don't have access to the Dev Azure App Service.
My findings are noted here and hopefully add value to whoever works on this in the future.
@qtomlinson I think the issue is that locally you may use localhost:4000/definitions/go/golang/github.com%2fdgrijalva/jwt-go/v3.2.0+incompatible?matchCasing=false&preview=true
which will be handled by this route. However, one dev and prod, the Cloudfare will translate that %2f
in the URL to /
then the original route doesn't work.
Two options:
Agreed. Not a fan of Option 2.
The preview definition call is already a POST call. Can potentially, introduce a new API:
Post: /definitions/preview
Post body:
{
"coordinates": "go/golang/github.com%2fdgrijalva/jwt-go/v3.2.0+incompatible",
"curation": {"described": {"releaseDate": "2022-06-04"}}
}
The coordinates in the post body is currently a string (to be consistent with the rest of the apis), but can be extended to an object if necessary in the future. This is an additional API in definitions, not in conflict with any exiting API, and therefore no need for api versioning here.
I can confirm the issue and behavior originally described by Nell is still reproducible. Not yet fixed. https://clearlydefined.io/definitions/go/golang/github.com%2fdgrijalva/jwt-go/v3.2.0+incompatible
Example: Making a change here https://clearlydefined.io/definitions/go/golang/github.com%2fdgrijalva/jwt-go/v3.2.0+incompatible to the declared or file licenses does not show up in the UI/UX and the "Contribute" button is still not functional.