fasten-project / fasten

Analyse package dependency networks at the call graph level
https://www.fasten-project.eu
Apache License 2.0
91 stars 28 forks source link

REST API needs to be adjusted to use the new ingested_artifacts table defined in the FASTEN loader #400

Closed MagielBruntink closed 2 years ago

MagielBruntink commented 2 years ago

Describe the bug

The current version of the REST API still uses the original definition of the ingested_artifacts table. In https://github.com/fasten-project/fasten-docker-deployment/commit/c4f677300bc83bab26de7e30fafff81cd1a5a2bc @proksch changed this table to better suit usage by the FASTEN loader and plugins. Now the REST API needs adjustment otherwise it throws an exception after an ingestion request (when it checks the ingested_artifacts table).

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  Thank you for using jOOQ 3.14.15

2022-02-02 17:26:45.498 DEBUG 1 --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet        : Failed to complete request: org.jooq.exception.DataAccessException: SQL [select "public"."ingested_artifacts"."package_name", "public"."ingested_artifacts"."version" from "public"."ingested_artifacts" where ("public"."ingested_artifacts"."package_name" = ? and "public"."ingested_artifacts"."version" = ?)]; ERROR: column ingested_artifacts.package_name does not exist
  Position: 8
2022-02-02 17:26:45.502 ERROR 1 --- [nio-8080-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.jooq.exception.DataAccessException: SQL [select "public"."ingested_artifacts"."package_name", "public"."ingested_artifacts"."version" from "public"."ingested_artifacts" where ("public"."ingested_artifacts"."package_name" = ? and "public"."ingested_artifacts"."version" = ?)]; ERROR: column ingested_artifacts.package_name does not exist
  Position: 8] with root cause

org.postgresql.util.PSQLException: ERROR: column ingested_artifacts.package_name does not exist
  Position: 8
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2553) ~[postgresql-42.2.20.jar!/:42.2.20]

To Reproduce

Steps to reproduce the behavior:

  1. Clone https://github.com/fasten-project/fasten-docker-deployment/tree/java-priority-lane-test
  2. Run docker-compose --profile java up -d
  3. Browse to http://localhost:9080/api/mvn/packages/org.apache.logging.log4j:log4j-core/2.1 (or another coordinate that was not previously ingested)
  4. Observe the error in docker logs fasten-docker-deployment-fasten-restapi-java-1
proksch commented 2 years ago

I have a meeting with George later today. The issue goes a bit beyond just the ingestion table... I feel like we do not have a clear design directive for the REST API right now. :)

MagielBruntink commented 2 years ago

Has this been resolved with the latest merge of the generalized REST API?

gdrosos commented 2 years ago

Has this been resolved with the latest merge of the generalized REST API?

Apparently not, the Generalized Rest-API PR did not touch the ingestion process.