Skip to content
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

Dependency type 'CONDA' is not allowed to be with empty sha1 #67

Open
yashali opened this issue Mar 9, 2022 · 3 comments
Open

Dependency type 'CONDA' is not allowed to be with empty sha1 #67

yashali opened this issue Mar 9, 2022 · 3 comments

Comments

@yashali
Copy link

yashali commented Mar 9, 2022

I have set "conda.resolveDependencies=true" for whitesource scan with Unified Agent and also have this environment.yml in my repository:

channels:
  - pytorch
  - defaults
  - akode
  - conda-forge
  - bashtage
dependencies:
  - _libgcc_mutex=0.1
  - _openmp_mutex=4.5
  - ca-certificates=2021.10.8
  - ld_impl_linux-64=2.36.1
  - libffi=3.4.2
  - libgcc-ng=11.2.0
  - libgomp=11.2.0
  - libnsl=2.0.0
  - libstdcxx-ng=11.2.0
  - libzlib=1.2.11
  - ncurses=6.3
  - openssl=3.0.0
  - pip=22.0.3
  - python=3.8.12
  - python_abi=3.8
  - readline=8.1
  - setuptools=60.9.3
  - sqlite=3.37.0
  - tk=8.6.12
  - wheel=0.37.1
  - xz=5.2.5
  - zlib=1.2.11
  - pip:
    - pvt-py-pkg==1.1.1

I get this error while uploading the scan results to server:

[ERROR] [2022-03-09 09:11:00,752 +0000] - Failed to send request to WhiteSource server: Illegal arguments: Invalid dependency info, DependencyInfo@8556f1ec[groupId= null,artifactId= xz,version= 5.2.5,filename= xz-5.2.5-h7b6447c_0,dependencyType= CONDA ]  Dependency type 'CONDA' is not allowed to be with empty sha1
[DEBUG] [2022-03-09 09:11:00,752 +0000] - Failed to send request to WhiteSource server: Illegal arguments: Invalid dependency info, DependencyInfo@8556f1ec[groupId= null,artifactId= xz,version= 5.2.5,filename= xz-5.2.5-h7b6447c_0,dependencyType= CONDA ]  Dependency type 'CONDA' is not allowed to be with empty sha1
org.whitesource.agent.client.WssServiceException: Illegal arguments: Invalid dependency info, DependencyInfo@8556f1ec[groupId= null,artifactId= xz,version= 5.2.5,filename= xz-5.2.5-h7b6447c_0,dependencyType= CONDA ]  Dependency type 'CONDA' is not allowed to be with empty sha1
	at org.whitesource.agent.client.WssServiceClientImpl.extractResultData(WssServiceClientImpl.java:492)
	at org.whitesource.agent.client.WssServiceClientImpl.service(WssServiceClientImpl.java:339)
	at org.whitesource.agent.client.WssServiceClientImpl.updateInventory(WssServiceClientImpl.java:199)
	at org.whitesource.agent.client.WhitesourceService.update(WhitesourceService.java:371)
	at org.whitesource.request.ProjectsSender.update(ProjectsSender.java:791)
	at org.whitesource.request.ProjectsSender.sendRequest(ProjectsSender.java:296)
	at org.whitesource.request.ProjectsSender.sendProjects(ProjectsSender.java:165)
	at org.whitesource.fs.Main.sendScanResults(Main.java:209)
	at org.whitesource.fs.Main.main(Main.java:95)
[INFO] [2022-03-09 09:11:00,752 +0000] - Support token: 03e500d6fae8d4cf897be53ab3c1b80311646817060686

Looks like following is the reason why the above error occurs :

[DEBUG] [2022-03-09 09:10:31,594 +0000] - CondaDependencyResolver - calcSha1 - failed to calculate sha1 for xz:5.2.5
java.io.FileNotFoundException: /opt/conda/miniconda/pkgs/xz-5.2.5-h7b6447c_0 (Is a directory)
	at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(FileInputStream.java:212)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:154)
	at org.whitesource.agent.hash.HashCalculator.calculateHash(HashCalculator.java:172)
	at org.whitesource.agent.hash.HashCalculator.calculateSHA1(HashCalculator.java:161)
	at org.whitesource.agent.DependencyCalculator.calculateSHA1(DependencyCalculator.java:140)
	at org.whitesource.agent.dependency.resolver.conda.CondaDependencyResolver.calcSha1(CondaDependencyResolver.java:379)
	at org.whitesource.agent.dependency.resolver.conda.CondaDependencyResolver.createDepInfo(CondaDependencyResolver.java:370)
	at org.whitesource.agent.dependency.resolver.conda.CondaDependencyResolver.createAllDepInfos(CondaDependencyResolver.java:343)
	at org.whitesource.agent.dependency.resolver.conda.CondaDependencyResolver.buildCondaTree(CondaDependencyResolver.java:274)
	at org.whitesource.agent.dependency.resolver.conda.CondaDependencyResolver.collect(CondaDependencyResolver.java:155)
	at org.whitesource.agent.dependency.resolver.conda.CondaDependencyResolver.resolveDependencies(CondaDependencyResolver.java:126)
	at org.whitesource.agent.dependency.resolver.DependencyResolutionService.resolveDependenciesOfResolver(DependencyResolutionService.java:382)
	at org.whitesource.agent.dependency.resolver.DependencyResolutionService.resolveDependencies(DependencyResolutionService.java:207)
	at org.whitesource.agent.FileSystemScanner.createProjects(FileSystemScanner.java:255)
	at org.whitesource.fs.scanOrigins.GeneralScanOrigin.getProjects(GeneralScanOrigin.java:189)
	at org.whitesource.fs.scanOrigins.GeneralScanOrigin.scan(GeneralScanOrigin.java:98)
	at org.whitesource.fs.scanOrigins.ScanOrigin.runOriginScan(ScanOrigin.java:36)
	at org.whitesource.fs.FileSystemAgent.createProjects(FileSystemAgent.java:176)
	at org.whitesource.fs.Main.scanProjects(Main.java:116)
	at org.whitesource.fs.Main.main(Main.java:90)


Seems to me that "/opt/conda/miniconda/pkgs/xz-5.2.5-h7b6447c_0" is expected to be a file as per

try (InputStream inputStream = new FileInputStream(resourceFile);

Do we need to handle such a case? Or am I missing something?

@LenaKleyner
Copy link

Hi @yashali ,

Could you please open a support ticket with all the relevant information (the Unified Agent execution command, its settings, and the output log)?

Thanks!

Lena

@yashali
Copy link
Author

yashali commented Mar 9, 2022

This is the command that I used:

curl -LJO https://github.com/whitesource/unified-agent-distribution/releases/latest/download/wss-unified-agent.jar
java -jar "wss-unified-agent.jar" -projectVersion project_name -c "python.config" -apiKey $WHITESOURCE_API_KEY -userKey $WHITESOURCE_USER_KEY

This is the python.config file:

projectName=name
log.level=debug
log.files.maxFilesCount=2
productName=name
wss.connectionTimeoutMinutes=1
wss.url=https://app.whitesourcesoftware.com/agent
checkPolicies=true
forceCheckAllDependencies=true
forceUpdate=false
forceUpdate.failBuildOnPolicyViolation=true
requireKnownSha1=false
generateScanReport=true
fileSystemScan=false
resolveAllDependencies=false
python.resolveDependencies=true
python.ignorePipInstallErrors=true
includes=**/*.py **/*.zip **/*.tar.gz **/*.egg **/*.whl
excludes=**/*.html **/*.jar
case.sensitive.glob=false
followSymbolicLinks=true

Where do I open the support ticket, please?

@LenaKleyner
Copy link

LenaKleyner commented Mar 9, 2022

Hi @yashali, tickets can be opened in the support portal. If you don't currently have an account to log into the support portal, kindly reach out to one of your admins.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants