megacmd
megacmd copied to clipboard
megacmd panic for anaccount with a large number of files
megacmd working fine with some accounts.
Trying to list content of this account (42336 files) I am getting the following:
fabri@PC111ubuntu:~$ megacmd -conf=".megacmd.json.old" list mega:/
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x20 pc=0x444611]
goroutine 1 [running]:
github.com/t3rm1n4l/go-mega.blockDecrypt(0x0, 0x0, 0xc2002ccee0, 0x10, 0x12, ...)
/home/slakshman/gopath/src/github.com/t3rm1n4l/go-mega/utils.go:179 +0x51
github.com/t3rm1n4l/go-mega.(*Mega).addFSNode(0xc2000885a0, 0xc2002c3130, 0x8, 0xc2002c32d0, 0x8, ...)
/home/slakshman/gopath/src/github.com/t3rm1n4l/go-mega/mega.go:466 +0x10ae
github.com/t3rm1n4l/go-mega.(*Mega).getFileSystem(0xc2000885a0, 0x0, 0x0)
/home/slakshman/gopath/src/github.com/t3rm1n4l/go-mega/mega.go:589 +0x362
github.com/t3rm1n4l/go-mega.(*Mega).Login(0xc2000885a0, 0xc2000bb5a0, 0x17, 0xc2000a57f0, 0xa, ...)
/home/slakshman/gopath/src/github.com/t3rm1n4l/go-mega/mega.go:416 +0x4c9
github.com/t3rm1n4l/megacmd/client.(*MegaClient).Login(0xc2000a5860, 0xc2000a5860, 0x0)
/home/slakshman/gopath/src/github.com/t3rm1n4l/megacmd/client/client.go:137 +0x4f
main.main()
/home/slakshman/gopath/src/github.com/t3rm1n4l/megacmd/main.go:115 +0x807
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 9 [runnable]:
net/http.(*persistConn).readLoop(0xc2000c6400)
/home/slakshman/go/src/pkg/net/http/transport.go:761 +0x64b
created by net/http.(*Transport).dialConn
/home/slakshman/go/src/pkg/net/http/transport.go:511 +0x574
goroutine 10 [select]:
net/http.(*persistConn).writeLoop(0xc2000c6400)
/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
This account is still working fine with other API (PHP)
I haven't tested it with large number of files. But, it is expected that it has some design limitations wrt large number of files. It needs some caching of FS meta. Somebody needs to work on that.
I get the same traceback with my account. Are there any workarounds?
The only workaround is to totally reset mega account (password lost procedure).
Even deleting all files in the account isn't enough!
So I suspect the problem is not directly related to the large number of files.
Unfortunately I have no skills in this specific programming language so I have given up and migrated to a PHP solution.
If you guys have an easy way to reproduce the problem on latest code let me know
I have uploaded many git repositories to mega, then i ran megacmd -conf megacmd.json list mega:/
, this problem occurred.
I tested by deleting all the uploaded repositories. Then everything is fine again.
I think too many files like git repositories is the problem. I hope you can reproduce and fix it.
I have the same issue uploading one single file after only 3% The problem is random tough, and sometimes its working properly...