-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failing to scan repository with FossID: Cannot deserialize value of type java.util.LinkedHashMap<java.lang.String,java.lang.String>
#8462
Comments
@nnobelis could you please look into this? |
@alexandruz any insights what might have changed in FOSSID'S data model? |
@realbigflo Unfortunately, we cannot log the requests to FossID as they contain credentials. We are also running this version and we don't get the the error. If you want, reach me internally and we can look at this problem together. |
While debugging with @nnobelis we figured out, the problem is caused by an access problem of Fossid for the specific git repository. I thought initially, that the ssh key was added correctly to the bitbucket instance but unfortunately this wasn't the case. This is the request that should be send to the FossID instance: curl --header "Content-Type: application/json" --request POST --data "{\"action\":\"create\",\"group\":\"scans\",\"data\":{\"username\":\"username\",\"key\":\"mykey\",\"project_code\":\"test_project\",\"scan_code\":\"test_ssh_cred_fail\",\"scan_name\":\"test_ssh_cred_fail\",\"git_repo_url\":\"ssh git repo url\",\"git_branch\":\"develop\"}}" <fossid REST endpoint> {"operation":"scans_create",
"status":"0",
"data":[{"code": "RequestData.Base.issue_with_executing_command",
"message":"Field git_repo_url: there was an issue executing command: timeout 200 git ls-remote 'ssh git repo' 2>&1. Exit status: 128. Output: Repository not found The requested repository does not exist, or you do not have permission to access it. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.",
"message_parameters":{"fieldname":"git_repo_url",
"cmd":"timeout 200 git ls-remote 'ssh git repo' 2>&1",
"exitStatus":128,
"out":"Repository not found The requested repository does not exist, or you do not have permission to access it. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists."}
}],
"error":"RequestData.Base.issues_while_parsing_request",
"message":"These issues were found while parsing the request:",
"message_parameters":[]
} After correcting the authentication issue, the result of the request looks like: {"operation":"scans_create",
"status":"1",
"data":{"scan_id":23732},
"message":"Scan test_ssh_cred_fail has been created."
} The data field in the failure case is an array with a single element (map) while in the good case, it is only a map. |
Thanks a lot @realbigflo : Yeah, it seems they changed the syntax of the error response, with even more polymorphism :( |
@sschuberth Could you maybe assign the issue to me ? |
Under some rare circumstances, `createScan` can return an error message as data payload instead of the scan id. This commit changes the function's signature to make it polymorphic. Fixes oss-review-toolkit#8462. Signed-off-by: Nicolas Nobelis <[email protected]>
@sschuberth I started to work on it here: #8541 Unfortunately, the exception is still present: the polymorphic deserializer currently allows to process multiple responses for the same function: T, [T], { "xxx", T }. Unfortunately, in this case, the responses are either
I still need to work this out. |
As I don't see how to fix this without an ugly hack, I asked our OPS to create a ticket at FossID support. |
Any update here @nnobelis? |
Unfortunately no progress at all. I guess we'll have to wait for the promised OpenApi-conform new API. In the meantime, I will ask our ops regarding the support ticket. |
When trying to create a scan with FossID (workbench version: 2023.3.0) ORT scan step fails.
I tried different internal repositories all failing with the same pattern. Is there anything I can provide as debug more than the traceback? Is there any option to increase the debug output even further to get the details of the API calls that are made towards FossID (assuming, that there is a mismatch between what ORT gets and what is expected)?
The text was updated successfully, but these errors were encountered: