DependencyTrack / DependencyTrack/dependency-track

An error occurred uncompressing NVD payload

Open
#835 0 comments 2 reactions 0 assignees View on GitHub
in triage
Dominant language
Java
Stars
4.2k
Forks
811
Avg merge
8h 39m
Merged PRs (30d)
237

Description

### Current Behavior:

Using the executable WAR. When I run:

`java -Xmx12G -jar dependency-track-embedded.war -port 8081`

as shown in the examples in https://docs.dependencytrack.org/getting-started/deploy-exewar/, for each (from 2002 to 2020) of the nvdcve json files, I get this error in the dependency-track.log for each file:

```
2020-11-16 02:42:37,181 [] INFO [org.dependencytrack.tasks.NistMirrorTask] Uncompressing nvdcve-1.1-2002.json.gz
2020-11-16 02:42:37,187 [] ERROR [org.dependencytrack.tasks.NistMirrorTask] An error occurred uncompressing NVD payload
java.nio.file.NoSuchFileException: /home/dilla/.dependency-track/nist/nvdcve-1.1-2002.json
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
at java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:434)
at java.nio.file.Files.newOutputStream(Files.java:216)
at org.dependencytrack.tasks.NistMirrorTask.uncompress(NistMirrorTask.java:243)
at org.dependencytrack.tasks.NistMirrorTask.doDownload(NistMirrorTask.java:190)
at org.dependencytrack.tasks.NistMirrorTask.getAllFiles(NistMirrorTask.java:111)
at org.dependencytrack.tasks.NistMirrorTask.inform(NistMirrorTask.java:92)
at alpine.event.framework.BaseEventService.lambda$publish$0(BaseEventService.java:99)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
```

### Steps to Reproduce:

When the log file says, "java.nio.file.NoSuchFileException: /home/dilla/.dependency-track/nist/nvdcve-1.1-2002.json", that's because there is no user "dilla" on the host.

There is a user "dogzilla" however. That's the user running the java -jar command.

So if I create a directory mkdir -p /home/dilla/.dependency-track/nist and re-run the java -jar command it works! If delete the /home/dilla/.dependency-track/nist, then it fails with the errors previously posted in this report.

It looks like the code is truncating the "ogz" in dogzilla to make a non-existent user "dilla".

### Expected Behavior:

### Environment:

```
2020-11-16 02:41:33,776 [] INFO [alpine.Config] --------------------------------------------------------------------------------
2020-11-16 02:41:33,781 [] INFO [alpine.Config] OS Name: Linux
2020-11-16 02:41:33,781 [] INFO [alpine.Config] OS Version: 3.10.0-1127.13.1.el7.x86_64
2020-11-16 02:41:33,781 [] INFO [alpine.Config] OS Arch: amd64
2020-11-16 02:41:33,782 [] INFO [alpine.Config] CPU Cores: 2
2020-11-16 02:41:33,782 [] INFO [alpine.Config] Java Vendor: Oracle Corporation
2020-11-16 02:41:33,782 [] INFO [alpine.Config] Java Version: 8.0.251
2020-11-16 02:41:33,782 [] INFO [alpine.Config] Java Home: /opt/java/jdk1.8.0_251/jre
2020-11-16 02:41:33,782 [] INFO [alpine.Config] Java Temp: /tmp
2020-11-16 02:41:33,782 [] INFO [alpine.Config] User: dogzilla
2020-11-16 02:41:33,782 [] INFO [alpine.Config] User Home: /home/dogzilla
2020-11-16 02:41:33,782 [] INFO [alpine.Config] --------------------------------------------------------------------------------
2020-11-16 02:41:33,782 [] INFO [alpine.Config] Initializing Configuration
2020-11-16 02:41:33,783 [] INFO [alpine.Config] System property alpine.application.properties not specified
2020-11-16 02:41:33,783 [] INFO [alpine.Config] Loading application.properties from classpath
2020-11-16 02:41:33,784 [] INFO [alpine.Config] --------------------------------------------------------------------------------
2020-11-16 02:41:33,785 [] INFO [alpine.Config] Application: Dependency-Track
2020-11-16 02:41:33,785 [] INFO [alpine.Config] Version: 3.8.0
2020-11-16 02:41:33,785 [] INFO [alpine.Config] Built-on: 2020-03-22T23:00:24Z
2020-11-16 02:41:33,785 [] INFO [alpine.Config] --------------------------------------------------------------------------------
2020-11-16 02:41:33,785 [] INFO [alpine.Config] Framework: Alpine
2020-11-16 02:41:33,785 [] INFO [alpine.Config] Version : 1.7.2
2020-11-16 02:41:33,785 [] INFO [alpine.Config] Built-on: 2020-03-16T20:49:51Z
2020-11-16 02:41:33,785 [] INFO [alpine.Config] --------------------------------------------------------------------------------
```

### Additional Details:

(e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)

See above. For some reason the code in the WAR is trying to write to /home/dilla. There's no such user on my host. The account I'm using is /home/dogzilla.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.