t3rm1n4l / megacmd

A command-line client for mega.co.nz storage service
456 stars 74 forks source link

Panic! #41

Closed repeatingmeme closed 10 years ago

repeatingmeme commented 10 years ago

I keep getting this error and I cant figure out how to fix it...

panic: Bad response received from server - 

goroutine 23 [running]:                                                                                                       
github.com/t3rm1n4l/go-mega.(*Mega).pollEvents(0xc2000885a0)                                                                  
        /home/slakshman/gopath/src/github.com/t3rm1n4l/go-mega/mega.go:1167 +0x543                                            
created by github.com/t3rm1n4l/go-mega.(*Mega).getFileSystem                                                                  
        /home/slakshman/gopath/src/github.com/t3rm1n4l/go-mega/mega.go:594 +0x3bb                                             

goroutine 1 [select]:                                                                                                         
net/http.(*persistConn).roundTrip(0xc200355480, 0xc200307cd0, 0xc200355480, 0x0, 0x0, ...)                                    
        /home/slakshman/go/src/pkg/net/http/transport.go:857 +0x6c7                                                           
net/http.(*Transport).RoundTrip(0xc2000c6100, 0xc2002f5680, 0xc2002f590d, 0x0, 0x0, ...)                                      
        /home/slakshman/go/src/pkg/net/http/transport.go:186 +0x396                                                           
net/http.send(0xc2002f5680, 0xc2000a6900, 0xc2000c6100, 0x0, 0x0, ...)                                                        
        /home/slakshman/go/src/pkg/net/http/client.go:166 +0x3a1                                                              
net/http.(*Client).send(0xc2000a6e10, 0xc2002f5680, 0x69, 0xc200178e50, 0xc200178dd0, ...)                                    
        /home/slakshman/go/src/pkg/net/http/client.go:100 +0xcd                                                               
net/http.(*Client).doFollowingRedirects(0xc2000a6e10, 0xc2002f5680, 0x6c1c00, 0x0, 0x0, ...)                                  
        /home/slakshman/go/src/pkg/net/http/client.go:282 +0x5ff                                                              
net/http.(*Client).Post(0xc2000a6e10, 0xc2000b5690, 0x69, 0x6887f0, 0x10, ...)                                                
        /home/slakshman/go/src/pkg/net/http/client.go:344 +0x114                                                              
github.com/t3rm1n4l/go-mega.(*Mega).api_request(0xc2000885a0, 0xc200395a74, 0x19, 0x40, 0x0, ...)                             
        /home/slakshman/gopath/src/github.com/t3rm1n4l/go-mega/mega.go:333 +0x3ef                                             
github.com/t3rm1n4l/go-mega.(*Mega).UploadFile(0xc2000885a0, 0x7fff5f36a8c8, 0xf, 0xc2002f55b0, 0x7fff5f36a8c8, ...)          
        /home/slakshman/gopath/src/github.com/t3rm1n4l/go-mega/mega.go:821 +0x3f0                                             
github.com/t3rm1n4l/megacmd/client.(*MegaClient).Put(0xc2000a5850, 0x7fff5f36a8c8, 0xf, 0x7fff5f36a8d8, 0x8, ...)             
        /home/slakshman/gopath/src/github.com/t3rm1n4l/megacmd/client/client.go:488 +0x864                                    
main.main()                                                                                                                   
        /home/slakshman/gopath/src/github.com/t3rm1n4l/megacmd/main.go:176 +0x1844                                            

goroutine 2 [syscall]:                                                                                                        

goroutine 4 [syscall]:                                                                                                        
os/signal.loop()                                                                                                              
        /home/slakshman/go/src/pkg/os/signal/signal_unix.go:21 +0x1c                                                          
created by os/signal.init·1                                                                                                   
        /home/slakshman/go/src/pkg/os/signal/signal_unix.go:27 +0x2f                                                          

goroutine 5 [chan receive]:                                                                                                   
main.func·002()                                                                                                               
        /home/slakshman/gopath/src/github.com/t3rm1n4l/megacmd/main.go:105 +0xb5                                              
created by main.main                                                                                                          
        /home/slakshman/gopath/src/github.com/t3rm1n4l/megacmd/main.go:108 +0x72e                                             

goroutine 21 [IO wait]:                                                                                                       
net.runtime_pollWait(0x7f87da9eef00, 0x72, 0x0)                                                                               
        /home/slakshman/go/src/pkg/runtime/znetpoll_linux_amd64.c:118 +0x82                                                   
net.(*pollDesc).WaitRead(0xc2003597d0, 0xb, 0xc20016edb0)                                                                     
        /home/slakshman/go/src/pkg/net/fd_poll_runtime.go:75 +0x31                                                            
net.(*netFD).Read(0xc200359750, 0xc200368000, 0x1000, 0x1000, 0x0, ...)                                                       
        /home/slakshman/go/src/pkg/net/fd_unix.go:195 +0x2b3                                                                  
net.(*conn).Read(0xc2002ff210, 0xc200368000, 0x1000, 0x1000, 0x4d7c61, ...)                                                   
        /home/slakshman/go/src/pkg/net/net.go:123 +0xc3                                                                       
crypto/tls.(*block).readFromUntil(0xc200366180, 0xc20016eed0, 0xc2002ff210, 0x5, 0xc2002ff210, ...)                           
        /home/slakshman/go/src/pkg/crypto/tls/conn.go:401 +0xbd                                                               
crypto/tls.(*Conn).readRecord(0xc200103780, 0x17, 0x0, 0x40d0f5)                                                              
        /home/slakshman/go/src/pkg/crypto/tls/conn.go:481 +0xfa                                                               
crypto/tls.(*Conn).Read(0xc200103780, 0xc2003c0000, 0x1000, 0x1000, 0x0, ...)                                                 
        /home/slakshman/go/src/pkg/crypto/tls/conn.go:796 +0x102                                                              
bufio.(*Reader).fill(0xc2003bf4e0)                                                                                            
        /home/slakshman/go/src/pkg/bufio/bufio.go:79 +0x10c                                                                   
bufio.(*Reader).Peek(0xc2003bf4e0, 0x1, 0x0, 0x0, 0x0, ...)                                                                   
        /home/slakshman/go/src/pkg/bufio/bufio.go:107 +0xc9                                                                   
net/http.(*persistConn).readLoop(0xc200355480)                                                                                
        /home/slakshman/go/src/pkg/net/http/transport.go:670 +0xc4                                                            
created by net/http.(*Transport).dialConn                                                                                     
        /home/slakshman/go/src/pkg/net/http/transport.go:511 +0x574                                                           

goroutine 22 [select]:                                                                                                        
net/http.(*persistConn).writeLoop(0xc200355480)                                                                               
        /home/slakshman/go/src/pkg/net/http/transport.go:774 +0x26f                                                           
created by net/http.(*Transport).dialConn                                                                                     
        /home/slakshman/go/src/pkg/net/http/transport.go:512 +0x58b                                                           

goroutine 24 [select]:                                                                                                        
github.com/t3rm1n4l/megacmd/client.progressBar(0xc2003bf600, 0xc20020cc40, 0xebe5014, 0x7fff5f36a8c8, 0xf, ...)               
        /home/slakshman/gopath/src/github.com/t3rm1n4l/megacmd/client/utils.go:155 +0x39c                                     
created by github.com/t3rm1n4l/megacmd/client.(*MegaClient).Put                                                               
        /home/slakshman/gopath/src/github.com/t3rm1n4l/megacmd/client/client.go:485 +0x7ff                                    

goroutine 28 [runnable]:                                                                                                      
net/http.(*persistConn).writeLoop(0xc2001cb880)                                                                               
        /home/slakshman/go/src/pkg/net/http/transport.go:774 +0x26f                                                           
created by net/http.(*Transport).dialConn                                                                                     
        /home/slakshman/go/src/pkg/net/http/transport.go:512 +0x58b

Any help would be appreciated, thank you!

repeatingmeme commented 10 years ago

I should add: I JUST used megacmd seconds before with different files and it was working, and nothing has changed since then, so I dont know where this error came from. I tried changing accounts and uploading different files, but it just throws the same sort of errors.

repeatingmeme commented 10 years ago

Ummm, okay i guess it fixed itself? ...technology amirite?

It would be nice to know still what was causing it so I can fix it in the future if anyone has any ideas.

ml- commented 10 years ago

Such errors are not really megacmd's issues. It probably just doesn't catch all kinds of errors/responses returned by MEGA. If you're getting such error messages then the MEGA servers are unreachable or can't serve your stuff at the moment. Just retry later and it should work.

t3rm1n4l commented 10 years ago

This issue seems to be fixed. Please try latest code.