fod-dev / fod-uploader-java

Java Utility for uploading packages to FoD
MIT License
12 stars 27 forks source link

java.lang.NullPointerException - release not found #95

Open ismo-conguairta opened 2 years ago

ismo-conguairta commented 2 years ago

By using bsi token produces a NullPointerException because the lack of value for the releaseId attribute.

$ java -jar FodUpload-530.jar -ac <apikey> <apisecret> -z <package>.zip -bsi <bsitoken> -ep 1 -rp 0 -pp 0 -n "Packaged using ScanCentral tool"
Authenticating
Authenticated
java.io.IOException: Unexpected code: Response{protocol=http/1.1, code=404, message=Not Found, url=https://api.emea.fortify.com/api/v3/releases/0/static-scans/scan-setup}
    at com.fortify.fod.fodapi.controllers.ReleaseController.getReleaseScanSettings(ReleaseController.java:128)
    at com.fortify.fod.Main.main(Main.java:113)
java.lang.NullPointerException
    at com.fortify.fod.fodapi.controllers.ReleaseController.UpdateScanSettings(ReleaseController.java:196)
    at com.fortify.fod.Main.main(Main.java:113)

The resulting url is https://api.emea.fortify.com/api/v3/releases/0/static-scans/scan-setup where 0 should be the releaseId. In this case I guess 0 stands for null.

krishnareddypadala commented 2 years ago

As a work around use release id (rid) instead of BSI token.

nbs-virendra-singh commented 2 years ago

Even with release id, I am getting same error:

java.io.IOException: Unexpected code: Response{protocol=h2, code=401, message=, url=https://api.emea.fortify.com/api/v3/releases/<my_release_id_5_numeric_digits>/static-scans/scan-setup}
    at com.fortify.fod.fodapi.controllers.ReleaseController.getReleaseScanSettings(ReleaseController.java:128)
    at com.fortify.fod.Main.main(Main.java:113)
java.lang.NullPointerException
    at com.fortify.fod.fodapi.controllers.ReleaseController.UpdateScanSettings(ReleaseController.java:196)
    at com.fortify.fod.Main.main(Main.java:113)
krishnareddypadala commented 2 years ago

code 401 seems to be an authentication error, try new api keys ..