Rclone ls mega remote causes segmentation fault

What is the problem you are having with rclone?

When running rclone ls on a MEGA remote (that has been in a use for a while and has files in it), I get the segmentation fault seen in the log, below.

This just started today. I did not upgrade or update anything, that I can remember. However, I did churn up some data in the remote a bit lately.

I could not find a similar post in the forum or the github issues.

(I have not rebooted in a few days. Will try that.)

Run the command 'rclone version' and share the full output of the command.

rclone v1.73.3-termux
- os/version: unknown
- os/kernel: 6.1.166-android14-11-g524c23aac062 (aarch64)
- os/type: android
- os/arch: arm64 (ARMv8 compatible)
- go/version: go1.26.1
- go/linking: dynamic
- go/tags: noselfupdate

Which cloud storage system are you using? (eg Google Drive)

mega

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone ls -vv mega-anne:

The rclone config contents with secrets removed.

[mega-anne]                                                                                                                                                                        
type = mega                                                                                                                                                                        
user = XXX                                                                                                                                                                         
pass = XXX                                                                                                                                                                         
hard_delete = true                                                                                                                                                                 
mega_debug = true                                                                                                                                                                  
session_id = XXX

A log from the command with the -vv flag

2026/04/04 20:28:06 DEBUG : rclone: Version "v1.73.3-termux" starting with parameters ["rclone" "ls" "-vv" "mega-anne:"]
2026/04/04 20:28:06 DEBUG : Creating backend with remote "mega-anne:"
2026/04/04 20:28:06 DEBUG : Using config file from "/data/data/com.termux/files/home/.config/rclone/rclone.conf"
2026/04/04 20:28:06 DEBUG : mega root '': Using previously stored session ID and master key to initialize the Mega API
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xb99b1b3d7b74]

goroutine 1 [running]:
github.com/t3rm1n4l/go-mega.(*Node).GetType(0x7cc8634f4160?)
        /home/builder/.termux-build/rclone/src/.gopath/pkg/mod/github.com/t3rm1n4l/go-mega@v0.0.0-20251031123324-a804aaa87491/mega.go:188 +0x24
github.com/rclone/rclone/backend/mega.(*Fs).findDir(0x7cc86336e5a0?, 0xb99b1a85ea01?, {0xecac80c21e90?, 0x1?})
        /home/builder/.termux-build/rclone/src/backend/mega/mega.go:344 +0x68
github.com/rclone/rclone/backend/mega.(*Fs).findRoot(0x7cc8634f4160, {0xb99b1c998350, 0xb99b1ce6bc20}, 0x0)
        /home/builder/.termux-build/rclone/src/backend/mega/mega.go:449 +0xf8
github.com/rclone/rclone/backend/mega.NewFs({0xb99b1c998350, 0xb99b1ce6bc20}, {0xecac80c21e90, 0x9}, {0xecac80c21e90, 0x0}, {0xb99b1c97fc68, 0x7cc8632fee70})
        /home/builder/.termux-build/rclone/src/backend/mega/mega.go:294 +0x770
github.com/rclone/rclone/fs.NewFs({0xb99b1c998350, 0xb99b1ce6bc20}, {0xecac80c21e90, 0xa})
        /home/builder/.termux-build/rclone/src/fs/newfs.go:75 +0x2d0
github.com/rclone/rclone/fs/cache.GetFn.func1({0xecac80c21e90?, 0xb99b1a884f40?})
        /home/builder/.termux-build/rclone/src/fs/cache/cache.go:103 +0x30
github.com/rclone/rclone/lib/cache.(*Cache).Get(0x7cc8632f5860, {0xecac80c21e90, 0xa}, 0x7cc8638879c0)
        /home/builder/.termux-build/rclone/src/lib/cache/cache.go:88 +0x128
github.com/rclone/rclone/fs/cache.GetFn({0xb99b1c998350, 0xb99b1ce6bc20}, {0xecac80c21e90, 0xa}, 0xb99b1c957fc8)
        /home/builder/.termux-build/rclone/src/fs/cache/cache.go:102 +0xa4
github.com/rclone/rclone/fs/cache.Get({0xb99b1c998350, 0xb99b1ce6bc20}, {0xecac80c21e90, 0xa})
        /home/builder/.termux-build/rclone/src/fs/cache/cache.go:183 +0x74
github.com/rclone/rclone/cmd.NewFsFile({0xecac80c21e90, 0xa})
        /home/builder/.termux-build/rclone/src/cmd/cmd.go:92 +0xdc
github.com/rclone/rclone/cmd.newFsFileAddFilter({0xecac80c21e90, 0xa})
        /home/builder/.termux-build/rclone/src/cmd/cmd.go:114 +0x48
github.com/rclone/rclone/cmd.NewFsSrc(...)
        /home/builder/.termux-build/rclone/src/cmd/cmd.go:136
github.com/rclone/rclone/cmd/ls.init.func1(0xb99b1cade0a0, {0x7cc86379c220, 0x1, 0xb99b18a40bcb?})
        /home/builder/.termux-build/rclone/src/cmd/ls/ls.go:40 +0x58
github.com/spf13/cobra.(*Command).execute(0xb99b1cade0a0, {0x7cc86379c200, 0x2, 0x2})
        /home/builder/.termux-build/rclone/src/.gopath/pkg/mod/github.com/spf13/cobra@v1.10.1/command.go:1019 +0x7fc
github.com/spf13/cobra.(*Command).ExecuteC(0xb99b1cad39e0)
        /home/builder/.termux-build/rclone/src/.gopath/pkg/mod/github.com/spf13/cobra@v1.10.1/command.go:1148 +0x350
github.com/spf13/cobra.(*Command).Execute(...)
        /home/builder/.termux-build/rclone/src/.gopath/pkg/mod/github.com/spf13/cobra@v1.10.1/command.go:1071
github.com/rclone/rclone/cmd.Main()
        /home/builder/.termux-build/rclone/src/cmd/cmd.go:541 +0x34
main.main()
        /home/builder/.termux-build/rclone/src/rclone.go:14 +0x1c

Rebooting did not help.

1 Like

Also, after installing the megacmd tools, I was able to login with the same credentials and run mega-ls / , and it worked. So, not sure if there is a difference in the go libraries between them?

1 Like

Inexplicably, without any change on my side, this has cleared up!

Whatever the mega service was sending in return to the ‘ls’ request that the code could not handle seems to be resolved.

(This is still a bug in the code, but I cannot reproduce it now.)

1 Like

You can use the cmd software to convert Mega into a webdav server. Then you configure rclone with webdav.

Perhaps that will work better for you.