bashful icon indicating copy to clipboard operation
bashful copied to clipboard

Panic when used

Open breznik opened this issue 6 years ago • 5 comments

Hi, your tool looks useful, so I wanted to give it a try. I did: go get github.com/wagoodman/bashful

And then I made a simple hello.yaml:

tasks:
  - cmd: echo "Hello, World!"

When i try to run it, I get a panic:

bashful run hello.yaml 
Running 
    • echo "Hello, World!"                                                                                                                                                                                                                                panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1092945]

goroutine 1 [running]:
os.(*File).Name(0x0, 0x22, 0x1446f0d)
	/usr/local/Cellar/go/1.10.1/libexec/src/os/file.go:49 +0x5
github.com/wagoodman/bashful/pkg/runtime/handler.(*TaskLogger).doRegister(0xc420115400, 0xc420099860)

and so on.

Am I doing something wrong?

breznik avatar Jan 28 '19 02:01 breznik

I see nothing that you're doing wrong, and I can't seem to reproduce this yet:

$ bashful  run hello.yaml 
Running 
    • echo "Hello, World!"                                                                                                                                                                                                                                                                                                     
      100.00% Complete  Tasks[1/1] 
$
  • If you try one of the precompiled binaries from the release page do you have any different results?
  • Are you running on mac or linux?
  • What version of go are you using?

wagoodman avatar Feb 05 '19 14:02 wagoodman

  • Tried most recent precompiled binary - worked without any problem
  • Running on mac
  • go v1.10.1

breznik avatar Feb 09 '19 21:02 breznik

try upgrading go to at least v1.11 (or higher), which is when go modules were introduced (and being used here to pin the version of dependencies)

wagoodman avatar Feb 10 '19 13:02 wagoodman

Upgraded to go v1.11.5 on osx, did the go get again, and back to having a panic.

breznik avatar Feb 10 '19 20:02 breznik

Upgraded to go v1.11.5 on osx, did the go get again, and back to having a panic.

My fix: https://github.com/wagoodman/bashful/pull/75

qiangyt avatar Mar 20 '22 17:03 qiangyt