Closed t-naumenko closed 7 months ago
we got similar error before when scanoss terminated LVPS with due to no code files in pull request. Fixed with this commit: https://github.com/Samsung/LPVS/commit/58644dc9fa2548864fe5edac007933bab90fac6c
$ mkdir empty_dir
$ scanoss-py scan -t --no-wfp-output --all-extensions -o scan-output.json empty_dir/
Writing results to scan-output.json...
Searching empty_dir/ for files to fingerprint...
U Root: empty_dir/, Dirs: [], Files []
Warning: No files found to scan in folder: empty_dir/
According to scanoss code, the scann is finished successfully without terminating.
in contrast to issue description, I have different behavior:
2024-02-15T11:06:22.585+02:00 INFO 45191 --- [ main] c.l.service.LPVSQueueProcessorService : PROCESS Webhook id = 7
2024-02-15T11:06:22.586+02:00 INFO 45191 --- [ LPVS-ASYNC::2] com.lpvs.service.LPVSQueueService : GitHub queue processing...
2024-02-15T11:06:22.736+02:00 ERROR 45191 --- [ LPVS-ASYNC::2] com.lpvs.service.LPVSGitHubService : Can't authorize getPullRequestFiles(): {"message":"Bad credentials","documentation_url":"https://docs.github.com/rest"}
2024-02-15T11:06:22.752+02:00 WARN 45191 --- [ LPVS-ASYNC::2] com.lpvs.service.LPVSQueueService : Files are not found. Probably pull request is not exists.
2024-02-15T11:06:22.930+02:00 ERROR 45191 --- [ LPVS-ASYNC::2] com.lpvs.service.LPVSGitHubService : Can't authorize commentResults(): {"message":"Bad credentials","documentation_url":"https://docs.github.com/rest"}
2024-02-15T11:06:23.074+02:00 ERROR 45191 --- [ LPVS-ASYNC::2] com.lpvs.service.LPVSGitHubService : Can't authorize org.kohsuke.github.HttpException: {"message":"Bad credentials","documentation_url":"https://docs.github.com/rest"}
2024-02-15T11:06:23.098+02:00 ERROR 45191 --- [ LPVS-ASYNC::2] com.lpvs.service.LPVSQueueService : Can't authorize commentResults() java.lang.Exception: Files are not found. Probably pull request does not exist. Terminating.
java.lang.Exception: Files are not found. Probably pull request does not exist. Terminating.
at com.lpvs.service.LPVSQueueService.processWebHook(LPVSQueueService.java:265)
@m-rudyk You have an error "message":"Bad credentials" Please check application.properties.
Scanoss successfully finished but exit code is 1 in case of empty dir. Need to add checker if files are present in folder before running scan. If not - exit scan without terminating. solution prepared.
Bug Report
Description: There is an exception arises in lpvs docker container when triggering webhook by openning Pull Request with empty commit
Steps to Reproduce:
Expected Behavior: Result with no potential risks or notification on Pull Request page about impossibility of scanning process due to any changes in empty commit
Test Environment Configuration: Please complete the following information):
Additional context Logs from container: