[Bug] Runtime Error: invalid memory address or nil pointer dereference for newJarGetter()
- Dominant language
- Java
- Stars
- 8.7k
- Forks
- 4.7k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 196
Description
I'm getting an error initializing Apache Beam for my Go service deployed to kubernetes. The error in question is:
```panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0xb94949]
goroutine 1 [running]:
github.com/apache/beam/sdks/v2/go/pkg/beam/core/runtime/xlangx/expansionx.newJarGetter()
/go/src/groups/vendor/github.com/apache/beam/sdks/v2/go/pkg/beam/core/runtime/xlangx/expansionx/download.go:50 +0x29
github.com/apache/beam/sdks/v2/go/pkg/beam/core/runtime/xlangx/expansionx.init()
/go/src/groups/vendor/github.com/apache/beam/sdks/v2/go/pkg/beam/core/runtime/xlangx/expansionx/download.go:40 +0x17
```
Looking at the code, it seems like the culprit is `usr` in
```
cacheDir := filepath.Join(usr.HomeDir, jarCache[2:])
```
I am wondering if there is a potential bug or problem with `usr, _ := user.Current()` in the line before.
Contributor guide
Assessment
This issue has not been assessed yet.