
JOliver168889 (Community Member) asked a question.
I'm trying to integrate our Azure DevOps process with Veracode but I'm getting a TypeError stating "Cannot read property 'OldBuildId' of null. I do not see where this property is set or can be made available. I'm including the last handful of response information from my attempt. I've masked the vuser and vpassword to protect our account security.
[command]"C:\Program Files\Java\zulu-8-azure-jdk_8.40.0.25-8.0.222-win_x64\bin\java.exe" -jar D:\a\_tasks\Veracode_6292a058-d4f5-407b-b6c6-815df9ee59d6\2.9.0\VeracodeJavaAPI.jar -action getapplist -vuser XXXXXX -vpassword XXXXX -useragent "VeracodeVSTSExtension/2.9.0 (Node/v6.10.3)"
[19.12.24 18:42:37]
[19.12.24 18:42:37] Server returned HTTP response code: 401 for URL: https://analysiscenter.veracode.com/api/5.0/getapplist.do
[19.12.24 18:42:37] Please make sure that all of the following are true:
##debugResponse Code : 2
[19.12.24 18:42:37] 1. The login credentials are valid.
[19.12.24 18:42:37] 2. The account is an API account with sufficient privilege.
[19.12.24 18:42:37] 3. The account is not locked.
[19.12.24 18:42:37] 4. This machine's internet-facing IP address is not restricted.
##debugClass Name : VeracodeBridge , Method Name : passorfailtask
##debugtask result: Failed
##errorBuild Failed : Error occurred while accessing the Veracode Platform.
##debugProcessed: ##vso[task.issue type=error;]Build Failed : Error occurred while accessing the Veracode Platform.
##debugProcessed: ##vso[task.complete result=Failed;]Build Failed : Error occurred while accessing the Veracode Platform.
##debugError : Error: Exiting from Veracode Scan Task
Error Occurred While Obtaining Application Information
Verify that:
1.The login credentials are correct
2.The account is an API account with the necessary permissions.
3.The account is not locked.
4.The IP address of the Internet-facing machine is not restricted.
5.The VSO agent has the necessary permissions.
6.The port that the VSO agent uses is not restricted.
##debugClass Name : VeracodeBridge , Method Name : passorfailtask
##debugtask result: Failed
##errorBuild Failed : Error occurred while accessing the Veracode Platform.
##debugProcessed: ##vso[task.issue type=error;]Build Failed : Error occurred while accessing the Veracode Platform.
##debugProcessed: ##vso[task.complete result=Failed;]Build Failed : Error occurred while accessing the Veracode Platform.
##debugPromise Rejected While Obtaining Prerequisites
(node:3064) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'OldBuildId' of null
##sectionFinishing: Vericode - Upload and scan: $(build.artifactstagingdirectory)
.png)
I have gotten this to work by creating and integrating with the API credentials. It's likely based on the HTTP401 error that my personal account was not setup to allow for API access. I will speak with our company Admin to verify this, but in either case, I've successfully integrated our Azure DevOps build pipeline with the Veracode service. Thanks.