- Revenera Community
- :
- Code Insight
- :
- Code Insight Forum
- :
- Re: Unable to download project report using REST API
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Unable to download project report using REST API
I am seeing 502 error when I am trying to download the project report using REST API.
I tried to isolate the cases for which this might be happening, and narrowed to 2 particular requests, that are throwing the 502 error.
Response Error :
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
<title>502 Proxy Error</title>
</head>
<body>
<h1>Proxy Error</h1>
<p>The proxy server received an invalid
response from an upstream server.<br />
The proxy server could not handle the request
<em><a href="/codeinsight/api/project/generateReport">GET /codeinsight/api/project/generateReport</a></em>.
<p>
Reason: <strong>Error reading from remote server</strong></p>
</p>
</body>
</html>
Few Observations
- When I try to login into the portal and download the reports for the above mentioned projectId, they get downloaded successfully.
- These reports are slightly larger in size (4.69Mb). And there might be a timeout set on the Http GET request, which is preventing these reports from getting downloaded.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @rhiremath,
The API you are using has been deprecated. Please refer to our latest API documentation for more details:
https://codeinsightapi-2023r1.redoc.ly/tag/Deprecated-APIs#operation/generateReport_1
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
@tphamda : Thanks for pointing me to the new documentation. I am looking at - https://codeinsightapi-2023r1.redoc.ly/tag/Project-API#operation/downloadReport
- I do know how to get the project_id. But what is report_id? How do I get that?
- I want to download the project_report for a certain project. How do I do this?
- Also, how do I get the taskId?
- Basically, if I want to achieve : https://flexeraipbunew.marvell.com/codeinsight/api/project/generateReport?projectId=1151&reportType=PROJECT , in the newer API version, how do I do it? Its not very clear from the documentation.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi Team,
I am trying to find same api for flexnet version 6.14.1 can you help in sharing api document for 6.14.1 version or getting report api please I did not find anything on net.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @Vasantha_vassu,
The REST API documentation for 6.14.1 is available as part of the installation. You can find it under: <CODEINSIGHT_ROOT>/docs/SwaggerDocs.html
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
I actually do agree. Reaching to the API reference is not intuitive. It took me a while to reach it. Maybe something to be considered.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @tphamda
Thank for your response, I found the api doc but did not find the specific api to get the report can please help me to find that.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @Vasantha_vassu,
The REST API for v6 does not have the same capabilities as v7. To generate a report for v6, you can instead use scriptRunner with the Report Script Utility that I attached. I have also attached instructions on how to use the script. This will generate reports in the <Install Dir>\scriptRunner\bin\ directory.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
The report IDs for the default reports are as follows:
- Project Report: 1
- Audit Report: 2
- Notices Report: 3
(Note: If you have a custom report added, the report ID will be mentioned when you register the report.) You can also use the Get Report By ID API to find out which ID is mapped to which report:
https://codeinsightapi-2023r1.redoc.ly/tag/Reports#operation/getReport
Overall, you will want to first generate the report with:
https://codeinsightapi-2023r1.redoc.ly/tag/Project-API#operation/generateReport
The success response of the generate call is the taskId which should be used during the download. You can then check the response's status code – if it is 200, then the task is complete, and you can proceed to downloading the report. To download the report, you can use the Download Report API:
https://codeinsightapi-2023r1.redoc.ly/tag/Project-API#operation/downloadReport
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
@tphamda : Thanks for the response. It is helpful.
The way, we have designed right now, we are generating the project report using the older API.
For download, we are designing a separate flow with the new API. So, I do not have have a direct access to the "taskId ", because I am not doing it as a part of the same codebase.
So, is there a way of doing one of the following:
- Can I find the taskId of a generated report of a certain project by some other means (API)?
- Can I download the report without the taskId, by mentioning something like reportType=PROJECT (Like the older API) ?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
@rhiremath, unfortunately, I am not aware of other API methods to get the taskId from the latest report generated. If it helps at all, all task IDs are available in the DB, specifically under the PSE_SCHEDULER_TASKS table.
However, we do have an existing request for downloading a report for a project using only the projectId and reportID, which will use the latest report generated. If you are interested in this feature, please open a new support case with us.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
@tphamda : Thanks for the response. Just wanted to verify if the new REST APIs will work for the Flexera Installation that we have presently. The vession is : v2020 R2 (7.12.0 Build 96)
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
@rhiremath, the new APIs were added in version 2021 R1, so you will need to upgrade to use them. You can find the relevant release notes here:
https://docs.revenera.com/fnci2021r1/rn/Content/helplibrary/New_APIs.htm
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Thanks @tphamda . So a follow up question on that. Would upgrading the installation to "2021 R1" break the previous version of APIs? Basically, would the previous APIs keep working once we upgrade?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
@rhiremath, the previous APIs may still function (they have not been changed other than marked as deprecated), but there were existing memory and performance issues with the previous APIs. In short, we will not be able to assist with any issues you run into with the previous APIs.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi, I have a few follow up questions on the same installation of Flexera that we have right now.
Our current installation is : v2020 R2 (7.12.0 Build 96)
In the above ticket you specified that we can upgrade to: 2021 R1
But I also see that there is an installation : 2023.R2, which seems to be the latest.
Can you please provide recommendation on which version I should upgrade to.
I have the following requirements because of which I want to upgrade:
+ I would like the upgraded REST APIs since the older version APIs are not working as expected.
+ I would like SPDX support. I our current installation, SPDX support does not work. Is there a solution to this issue?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
In addition to the above queries, one of our engineers evaluated 2021R3, and had the following observations. Are these issues fixed in the latest release?:
************************
- Does not distinguish between SPDX GPL-2.0 and GPL-2.0-or-later.
- Similar to above, Flexera generally has issues detecting correct GPL license version. For example, detecting as “v2 or later” when it’s just v2, scenarios like that.
- Because version detection is not very accurate, user has to manually go through all files.
- I think there were false positives for Apple MIT License.
************************
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
@rhiremath, for detection issues, the first thing to check is to make sure you have the latest Electronic Update applied. You can check the Last Data Update under the Menu button (hamburger icon). You can also view the release notes for each Electronic Update here:
If you are not on the latest update, you will need to update through the Administration page and then perform a full rescan. If you already have the latest update applied, we would need to investigate each discrepancy. I would recommend opening a support case for this and providing the associated files being scanned so that we can reproduce the issue on our end. Additionally, you can also provide us with the component ID so that we can check if the issue is in our data library.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @rhiremath,
We would recommend upgrading to the latest version, 2023 R2.
For SPDX support, we have a number of custom reports available for download, including an SPDX Report (refer to the README on how to install):
https://github.com/flexera-public/sca-codeinsight-reports-spdx
You can find more available reports here:
https://github.com/flexera-public?q=sca-codeinsight-reports
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Thanks for your inputs and suggestions @tphamda . We are now looking to upgrade our Flexera Installations so that we can make use of the latest upgrades, APIs and fixes.
Can you please share the latest API documentation with me as well?
In addition to this, I would need assistance in few of the Flexera operations. For eg, If I want to make the all the files from an advanced search criteria to be a part of a new inventory using REST API, how can I do about doing this? Is there a team that assists with such use cases?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @rhiremath,
You can find our latest API docs here: https://codeinsightapi-2023r2.redoc.ly/
Regarding your request for assistance, custom implementation as well as training is handled by our Services team. Please note that a services engagement would incur a cost, but let us know if you would be interested in this.
![](/skins/images/8C9D13A71C7F7695F3262372C0172D68/responsive_peak/images/icon_anonymous_message.png)