fasten icon indicating copy to clipboard operation
fasten copied to clipboard

/mvn/packages/{pkg}/{pkg_ver}/rcg returns HTTP code 500

Open amottier opened this issue 2 years ago • 8 comments

Describe the bug

If an artifact is not known, and API call to /mvn/packages/{pkg}/{pkg_ver}/rcg will lead to an error 500.

To Reproduce

Steps to reproduce the behavior:

  1. curl https://api.fasten-project.eu/api/mvn/packages/org.jgroups:jgroups/5.1.9.Final/rcg

Expected behavior

Based on the documentation, I expect to get a 201 HTTP code if artifact is not known.

Environment (please complete the following information):

  • OS: Linux Debian 11
  • Java version: 11.0.15

Additional context

Found this issue while doing some test with the FASTEN Maven plugin.

amottier avatar May 24 '22 15:05 amottier

@amottier Thanks for reporting an issue. I would assume that the behavior might have changed in recent major changes to the REST API and the documentation is not updated accordingly. The issue should be investigated further.

mir-am avatar May 24 '22 15:05 mir-am

@mir-am this is not actually related to the documentation because when requesting curl https://api.fasten-project.eu/api/mvn/packages/com.google.guava:guava/24.1-jre/rcg I got an HTTP status code 201.

amottier avatar May 24 '22 15:05 amottier

I would assume that the behavior might have changed in recent major changes

Returning an error 500 for such an API is always the sign of a bug for me.

It feels like some packages are badly analyzed or inserted in the DB and would cause a crash of the generation of the call graph. I remember a long time ago (It's possible I only reported this on gitter) having the following cases for some packages: the very first call was returning a 201 and any following call would return an error 500.

tmortagne avatar May 24 '22 15:05 tmortagne

@mir-am now I'm also getting an error 500 with curl https://api.fasten-project.eu/api/mvn/packages/com.google.guava:guava/24.1-jre/rcg Can you take a look on the server side to see if any logs are available?

amottier avatar May 25 '22 15:05 amottier

@amottier I will investigate the issue ASAP.

mir-am avatar May 25 '22 16:05 mir-am

@amottier Using the provided example above, I could NOT reproduce the issue locally while debugging the REST API in my IDE, i.e., http://localhost:8080/packages/org.jgroups:jgroups/5.1.9.Final/. The possible explanation for this issue is related to #461. The REST was down because of PSQLException at the time of sending the above request to our production cluster.

mir-am avatar May 30 '22 14:05 mir-am

The issue is addressed in #465.

mir-am avatar Jun 02 '22 08:06 mir-am

@mir-am I did again a test with: curl https://api.fasten-project.eu/api/mvn/packages/org.jgroups:jgroups/5.1.9.Final/rcg and I'm getting a 500 error code.

Let me know if I can help with the investigation.

amottier avatar Jul 05 '22 15:07 amottier