fasten
fasten copied to clipboard
/mvn/packages/{pkg}/{pkg_ver}/rcg returns HTTP code 500
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:
-
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 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 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
.
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.
@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 I will investigate the issue ASAP.
@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.
The issue is addressed in #465.
@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.