Sam Corbett created BROOKLYN-469:
------------------------------------

             Summary: CLI: Panic when login attempted with malformed URL
                 Key: BROOKLYN-469
                 URL: https://issues.apache.org/jira/browse/BROOKLYN-469
             Project: Brooklyn
          Issue Type: Bug
            Reporter: Sam Corbett


The cli panics when the URL for login isn't a URI:

{code}
$ br login http://localhost:sdnfksdjnfkjsndfkjsd
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x10 pc=0x647b1]

goroutine 1 [running]:
panic(0x4134c0, 0xc820014120)
        /usr/local/Cellar/go/1.6/libexec/src/runtime/panic.go:464 +0x3e6
github.com/apache/brooklyn-client/cli/net.(*Network).SendRequestGetStatusCode(0xc8200105c0,
 0xc8200ea000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        
/Users/sam/code/brooklyn.io/brooklyn/brooklyn-client/cli/target/src/github.com/apache/brooklyn-client/cli/net/net.go:124
 +0x1e1
github.com/apache/brooklyn-client/cli/api/version.Version(0xc8200105c0, 0x0, 
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        
/Users/sam/code/brooklyn.io/brooklyn/brooklyn-client/cli/target/src/github.com/apache/brooklyn-client/cli/api/version/version.go:31
 +0xb4
github.com/apache/brooklyn-client/cli/commands.(*Login).Run(0xc820015300, 0x0, 
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        
/Users/sam/code/brooklyn.io/brooklyn/brooklyn-client/cli/target/src/github.com/apache/brooklyn-client/cli/commands/login.go:125
 +0xfa8
github.com/apache/brooklyn-client/cli/command_runner.ConcreteRunner.RunCmdByName(0x7bdd60,
 0xc820015320, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        
/Users/sam/code/brooklyn.io/brooklyn/brooklyn-client/cli/target/src/github.com/apache/brooklyn-client/cli/command_runner/runner.go:49
 +0xe7
github.com/apache/brooklyn-client/cli/command_runner.(*ConcreteRunner).RunCmdByName(0xc820016540,
 0x49bb98, 0x5, 0xc82008e8c0, 0x0, 0x0)
        <autogenerated>:1 +0xe0
github.com/apache/brooklyn-client/cli/app.getCommand.func1(0xc82008e8c0)
        
/Users/sam/code/brooklyn.io/brooklyn/brooklyn-client/cli/target/src/github.com/apache/brooklyn-client/cli/app/app.go:82
 +0x57
github.com/apache/brooklyn-client/cli/vendor/github.com/urfave/cli.Command.Run(0x49bb98,
 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc8200c0fa0, 0x1e, 0x0, ...)
        
/Users/sam/code/brooklyn.io/brooklyn/brooklyn-client/cli/target/src/github.com/apache/brooklyn-client/cli/vendor/github.com/urfave/cli/command.go:174
 +0x1399
github.com/apache/brooklyn-client/cli/vendor/github.com/urfave/cli.(*App).Run(0xc82008e3c0,
 0xc82000a730, 0x5, 0x5, 0x0, 0x0)
        
/Users/sam/code/brooklyn.io/brooklyn/brooklyn-client/cli/target/src/github.com/apache/brooklyn-client/cli/vendor/github.com/urfave/cli/app.go:187
 +0x112b
main.main()
        
/Users/sam/code/brooklyn.io/brooklyn/brooklyn-client/cli/target/src/github.com/apache/brooklyn-client/cli/br/brooklyn.go:62
 +0x915
{code}




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to