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

Exit purge #137

Merged
merged 13 commits into from
Apr 24, 2020
Merged

Exit purge #137

merged 13 commits into from
Apr 24, 2020

Conversation

bhamail
Copy link
Contributor

@bhamail bhamail commented Apr 18, 2020

Minimize places where we call os.Exit(), in preparation for conversion to using Cobra #134

I think this is ready for review.

I was a little concerned about the CI build failing in the logger_test.go. Seemed to be an unrelated change. Rerunning the CI build and it just passed. Boggle. We should keep an eye out in case this is a heisenbug.

BTW, we may have a decision point regarding "--command, -flag" syntax in the near future.

Fixes #78

cc @bhamail / @DarthHater

@DarthHater
Copy link
Member

I'm sure that you still are cranking, but when I run ./nancy iq I get a SIGSEGV: (after usage).

$ ./nancy iq
Usage:
        go list -m all | nancy iq [options]

Options:
  -application string
        Specify application ID for request
  -max-retries int
        Specify maximum number of tries to poll Nexus IQ Server (default 300)
  -server-url string
        Specify Nexus IQ Server URL/port (default "http://localhost:8070")
  -stage string
        Specify stage for application (default "develop")
  -token string
        Specify Nexus IQ token/password for request (default "admin123")
  -user string
        Specify Nexus IQ username for request (default "admin")
  -v    Set log level to Info
  -vv
        Set log level to Debug
  -vvv
        Set log level to Trace
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x14fc90f]

goroutine 1 [running]:
github.com/sonatype-nexus-community/nancy/customerrors.ErrorExit.Error(0x0, 0x0, 0x0, 0x0, 0x2, 0xc000213710, 0xc0001a3a18)
        /go/src/github.com/sonatype-nexus-community/nancy/customerrors/error.go:30 +0x3f
github.com/sirupsen/logrus.(*JSONFormatter).Format(0xc000110040, 0xc0002209a0, 0x10703d2, 0x2, 0x0, 0x1056779, 0xc0001a3d78)
        /go/pkg/mod/github.com/sirupsen/logrus@v1.5.0/json_formatter.go:67 +0x1cd
github.com/sirupsen/logrus.(*Entry).write(0xc0002209a0)
        /go/pkg/mod/github.com/sirupsen/logrus@v1.5.0/entry.go:277 +0x7c
github.com/sirupsen/logrus.Entry.log(0xc00013e070, 0xc000213710, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /go/pkg/mod/github.com/sirupsen/logrus@v1.5.0/entry.go:253 +0x1c2
github.com/sirupsen/logrus.(*Entry).Log(0xc000220930, 0x2, 0xc0001a3f58, 0x1, 0x1)
        /go/pkg/mod/github.com/sirupsen/logrus@v1.5.0/entry.go:289 +0xeb
github.com/sirupsen/logrus.(*Entry).Error(...)
        /go/pkg/mod/github.com/sirupsen/logrus@v1.5.0/entry.go:318
main.main()
        /go/src/github.com/sonatype-nexus-community/nancy/main.go:64 +0x20b

@zendern
Copy link
Contributor

zendern commented Apr 18, 2020

I'm sure that you still are cranking, but when I run ./nancy iq I get a SIGSEGV: (after usage).

$ ./nancy iq
Usage:
        go list -m all | nancy iq [options]

Options:
  -application string
        Specify application ID for request
  -max-retries int
        Specify maximum number of tries to poll Nexus IQ Server (default 300)
  -server-url string
        Specify Nexus IQ Server URL/port (default "http://localhost:8070")
  -stage string
        Specify stage for application (default "develop")
  -token string
        Specify Nexus IQ token/password for request (default "admin123")
  -user string
        Specify Nexus IQ username for request (default "admin")
  -v    Set log level to Info
  -vv
        Set log level to Debug
  -vvv
        Set log level to Trace
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x14fc90f]

goroutine 1 [running]:
github.com/sonatype-nexus-community/nancy/customerrors.ErrorExit.Error(0x0, 0x0, 0x0, 0x0, 0x2, 0xc000213710, 0xc0001a3a18)
        /go/src/github.com/sonatype-nexus-community/nancy/customerrors/error.go:30 +0x3f
github.com/sirupsen/logrus.(*JSONFormatter).Format(0xc000110040, 0xc0002209a0, 0x10703d2, 0x2, 0x0, 0x1056779, 0xc0001a3d78)
        /go/pkg/mod/github.com/sirupsen/logrus@v1.5.0/json_formatter.go:67 +0x1cd
github.com/sirupsen/logrus.(*Entry).write(0xc0002209a0)
        /go/pkg/mod/github.com/sirupsen/logrus@v1.5.0/entry.go:277 +0x7c
github.com/sirupsen/logrus.Entry.log(0xc00013e070, 0xc000213710, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /go/pkg/mod/github.com/sirupsen/logrus@v1.5.0/entry.go:253 +0x1c2
github.com/sirupsen/logrus.(*Entry).Log(0xc000220930, 0x2, 0xc0001a3f58, 0x1, 0x1)
        /go/pkg/mod/github.com/sirupsen/logrus@v1.5.0/entry.go:289 +0xeb
github.com/sirupsen/logrus.(*Entry).Error(...)
        /go/pkg/mod/github.com/sirupsen/logrus@v1.5.0/entry.go:318
main.main()
        /go/src/github.com/sonatype-nexus-community/nancy/main.go:64 +0x20b

re: this Hopefully Jeffry will NOT look at this over the weekend. 😄
@bhamail I believe the answer is yeah not going to happen 😝

@bhamail
Copy link
Contributor Author

bhamail commented Apr 20, 2020

re: this Hopefully Jeffry will NOT look at this over the weekend. 😄
@bhamail I believe the answer is yeah not going to happen 😝

The was a snowballs chance.... ;)

Fix issue with nil Err object causing seg fault: 24f46c0

main.go Show resolved Hide resolved
configuration/parse.go Outdated Show resolved Hide resolved
configuration/parse.go Outdated Show resolved Hide resolved
customerrors/error.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
@bhamail
Copy link
Contributor Author

bhamail commented Apr 24, 2020

no objections, and some implicit approval, so merging this puppy in a bit.

Copy link
Member

@DarthHater DarthHater left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THIS STAMP IS RUBBER AND I GIVE IT TO YOU, FREE OF CHARGE

@bhamail
Copy link
Contributor Author

bhamail commented Apr 24, 2020

CAPS LOCK FRIDAY!

@bhamail bhamail merged commit 1b89a61 into master Apr 24, 2020
@bhamail bhamail deleted the exit_purge branch April 24, 2020 19:53
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

Successfully merging this pull request may close these issues.

Make nancy not so exit heavy
3 participants