- Revenera Community
- :
- Code Insight
- :
- Code Insight Forum
- :
- 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
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.
Hi @rhiremath,
I believe the Analyzer you are referring to is the legacy Analyzer available in Code Insight v6. In Code Insight v7, the legacy Analyzer has been replaced by CodeAware, which is basically the “next generation” analyzer, and provides much of the same analysis functionality as the legacy Analyzer. The legacy Analyzer is not available in v7, so you will not be able to enable it.
We have just initiated to install the 2023R2 version as you had recommended in your past comments. Would this version have the "CodeAware" ? If yes, do we need to enable it, or does it come built in? Can you share any documentation/API reference on how we can use it?
@rhiremath, Code Insight v7 (which includes 2023 R2) has CodeAware built-in, and CodeAware analyzers will be ran automatically with scans – you do not have to enable it.
@tphamda . Thanks so much for your inputs. Basically, I wanted to understand a few things. Currently this is what I do:
+ I have a few "Advanced Search" criteria that I have already added.
+ I create an inventory say "Inventory A"
+ I run one advanced search criteria, and whatever files get listed there, I right click - > "Add to Inventory" (Inventory A) - PFA a snapshot
+ This is how I am doing manual auditing.
Do you have any inputs as to how I can automate this process using REST API? I think I get the creating inventory part. But How do I list the files from Advanced search and add to inventory using API?
Additionally, Is there a better recommendation you might have of doing a manual Audit?
Appreciate your input.
@rhiremath, using the REST API to get results similar to the Advanced File Search will be more involved. For example, you can first get all scanned files with:
https://codeinsightapi-2023r3.redoc.ly/tag/Project-API#operation/getAllScannedFiles
This will return some details including the file ID, whether the file ha been reviewed, if it contains evidence, etc. If you need further file details to filter, you can get more file details from the file ID by calling:
https://codeinsightapi-2023r3.redoc.ly/tag/Files#operation/getFileDetails
To add a file to inventory, you can use:
https://codeinsightapi-2023r3.redoc.ly/tag/Inventory-API#operation/addFilesToInventory
Regarding auditing recommendations, I can at least point you to our documentation which goes over general usage:
https://docs.revenera.com/fnci2023r3/Content/helplibrary/Analyzing__Auditing__Scan_Results.htm
We also have some videos that cover core concepts here (you will need to be logged in first):
https://learning.revenera.com/series/flexnet-code-insight/getting-started-with-flexnet-code-insight
If you need further hands-on assistance, I would recommend contacting either your Customer Success Manager (CSM) or our Services team, who can provide help on custom scripting and training per your specific requirements. Please note that a Services engagement would incur a cost. Please let us know if you had any questions on this.
Hi @tphamda ,
Our IT team helped us to setup a test evaluation server with the version 2023 R2 like you had recommended.
However, we are not able to use the APIs. Is there any special access that needs to be enabled so that we can access APIs on the new server?
Hi @rhiremath,
Can you confirm if you are on 2023 R2 or our latest version, 2023 R3? The reason I ask is that we have recently discovered an issue with the Download Report API failing with custom reports on 2023 R3 where the following message is returned:
The taskId entered is not mapped to the project or report. Please check and try again.
If you are not on 2023 R3, can you please provide what response you are seeing when running the API calls?
I would also recommend trying the API calls with SWAGGER UI. You can access it in the Web UI by going to the Menu > Help page and clicking on the 'REST API Guide' hyperlink. Here you can click "Try it out" and input the required values. Note that for Authorization, you will need to include Bearer as part of the field value. e.g. Bearer <JWT_TOKEN>.