Issue with Mega

What is the problem you are having with rclone?

Hello,
I have an issue with connecting to Mega

I tried it on linux and termux with the same version of rclone 1.56.0
On termux first command worked and when I repeated I got this issue. When I deleted storage of termux, copied the rclone config again and test it, it worked again for first command and then every command returns again error code as bellow.

Can you help me? This issue is only on Mega

What is your rclone version (output from rclone version)

1.56.0

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Termux android, archlinux -64 bit

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 -vv --mega-debug about mega:

The rclone config contents with secrets removed.

[mega]
type = mega
user = 
pass = 
hard_delete = true

[9megaS]
type = crypt
remote = mega:secret
filename_encryption = off
directory_name_encryption = false
password = 

A log from the command with the -vv flag

2021/07/29 23:58:23 DEBUG : rclone: Version "v1.56.0" starting with parameters ["rclone" "-vv" "--mega-debug" "about" "mega:"]
2021/07/29 23:58:23 DEBUG : Creating backend with remote "mega:"
2021/07/29 23:58:23 DEBUG : Using config file from "/home/ksj/.config/rclone/rclone.conf"
2021/07/29 23:58:23 DEBUG : mega: detected overridden config - adding "{v6fxV}" suffix to name
2021/07/29 23:58:24 DEBUG : go-mega: Retry API request 1/10: Try again
2021/07/29 23:58:24 DEBUG : go-mega: Retry API request 2/10: Try again
2021/07/29 23:58:24 DEBUG : go-mega: Retry API request 3/10: Try again
2021/07/29 23:58:24 DEBUG : go-mega: Retry API request 4/10: Try again
2021/07/29 23:58:24 DEBUG : go-mega: Retry API request 5/10: Try again
2021/07/29 23:58:24 DEBUG : go-mega: Retry API request 6/10: Try again
2021/07/29 23:58:25 DEBUG : go-mega: Retry API request 7/10: Try again
2021/07/29 23:58:25 DEBUG : go-mega: Retry API request 8/10: Try again
2021/07/29 23:58:27 DEBUG : go-mega: Retry API request 9/10: Try again
2021/07/29 23:58:29 DEBUG : go-mega: Retry API request 10/10: Try again
2021/07/29 23:58:34 Failed to create file system for "mega:": couldn't login: Try again

hello and welcome to the forum,

just now, using v1.56.0, on windows, linux and termux, i had no problems running this command multiple times.
rclone about mega01: -vv --mega-debug

Hello, hmm, have you tried to run it more times? It is strange....

yes, i ran rclone about mega01: -vv --mega-debug multiple times on win,lin and termux.

try deleting the remote from the config files, and using rclone config to recreate it.

for a more detailed debug log, try adding this and post it.
--dump=bodies --retries=1 --low-level-retries=1
note: you might want to redact your email address

I don't have linux now, so i tried it on termux. I recreated config and tried it again. First request was ok and when i repeated it, i got:

$ rclone about mega: -vv --mega-debug --dump=bodies --retries=1 --low-level-retries=1
2021/07/30 15:27:38 DEBUG : rclone: Version "1.56.0-termux" starting with parameters ["rclone" "about" "mega:" "-vv" "--mega-debug" "--dump=bodies" "--retries=1" "--low-level-retries=1"]
2021/07/30 15:27:38 DEBUG : Creating backend with remote "mega:"
2021/07/30 15:27:38 DEBUG : Using config file from "/data/data/com.termux/files/home/.config/rclone/rclone.conf"
2021/07/30 15:27:38 DEBUG : mega: detected overridden config - adding "{v6fxV}" suffix to name
2021/07/30 15:27:38 DEBUG : You have specified to dump information. Please be noted that the Accept-Encoding as shown may not be correct in the request and the response may not show Content-Encoding if the go standard libraries auto gzip encoding was in effect. In this case the body of the request will be gunzipped before showing it.
2021/07/30 15:27:38 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/07/30 15:27:38 DEBUG : HTTP REQUEST (req 0x40006c1a00)
2021/07/30 15:27:38 DEBUG : POST /cs?id=3718356513 HTTP/1.1
Host: g.api.mega.co.nz
User-Agent: rclone/1.56.0-termux
Content-Length: 46
Content-Type: application/json
Accept-Encoding: gzip

[{"a":"us0","user":"xxx@xxx"}]
2021/07/30 15:27:38 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/07/30 15:27:39 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/07/30 15:27:39 DEBUG : HTTP RESPONSE (req 0x40006c1a00)
2021/07/30 15:27:39 DEBUG : HTTP/1.1 200 OK
Content-Length: 9
Access-Control-Allow-Headers: Content-Type, MEGA-Chrome-Antileak
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Original-Content-Length
Access-Control-Max-Age: 86400
Connection: keep-alive
Content-Type: application/json
Original-Content-Length: 9

[{"v":1}]
2021/07/30 15:27:39 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/07/30 15:27:39 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/07/30 15:27:39 DEBUG : HTTP REQUEST (req 0x40005dc000)
2021/07/30 15:27:39 DEBUG : POST /cs?id=3718356514 HTTP/1.1
Host: g.api.mega.co.nz
User-Agent: rclone/1.56.0-termux
Content-Length: 64
Content-Type: application/json
Accept-Encoding: gzip

[{"a":"us","user":"xxx@xxx","uh":"xxx"}]
2021/07/30 15:27:39 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/07/30 15:27:39 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/07/30 15:27:39 DEBUG : HTTP RESPONSE (req 0x40005dc000)
2021/07/30 15:27:39 DEBUG : HTTP/1.1 200 OK
Content-Length: 2
Access-Control-Allow-Headers: Content-Type, MEGA-Chrome-Antileak
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Original-Content-Length
Access-Control-Max-Age: 86400
Connection: keep-alive
Content-Type: application/json
Original-Content-Length: 2

-3
2021/07/30 15:27:39 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/07/30 15:27:39 DEBUG : go-mega: Retry API request 1/1: Try again
2021/07/30 15:27:39 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/07/30 15:27:39 DEBUG : HTTP REQUEST (req 0x4000481a00)
2021/07/30 15:27:39 DEBUG : POST /cs?id=3718356514 HTTP/1.1
Host: g.api.mega.co.nz
User-Agent: rclone/1.56.0-termux
Content-Length: 64
Content-Type: application/json
Accept-Encoding: gzip

[{"a":"us","user":xxx@xxx","uh":"xxx"}]
2021/07/30 15:27:39 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/07/30 15:27:39 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/07/30 15:27:39 DEBUG : HTTP RESPONSE (req 0x4000481a00)
2021/07/30 15:27:39 DEBUG : HTTP/1.1 200 OK
Content-Length: 2
Access-Control-Allow-Headers: Content-Type, MEGA-Chrome-Antileak
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Original-Content-Length
Access-Control-Max-Age: 86400
Connection: keep-alive
Content-Type: application/json
Original-Content-Length: 2

-3
2021/07/30 15:27:39 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/07/30 15:27:39 Failed to create file system for "mega:": couldn't login: Try again

ok, now that we have a good debug log, somebody more knowledgeable with mega should hopefully comment soon.

I have found, everyday I can do one successful command (Maybe it is shorter, I haven't check it exactly). When I add it to that I can recreate rclone config and have one successful command too, I'm thinking isn't there any limit, or session, which would somehow break and I would have to wait for expiration of this session?

So, no one knows, what can cause this issue?

When i try to use mega-tools instead of rclone, it works after while. I think it can be caused by login timeout. But increase timeout with --timeout doesn't work for login. Which one can be used for increase login timeout for rclone?

MEGA is just finicky. I'm not sure there is an answer as you get locked out every so often and if you try back later, it works.

That is something on the MEGA side and nothing we can do to my knowledge.

And what about the increase time limit for login to mega? Is there any? Megatools works for me only because it waits to response the whole time no matter if it will be endless.

with the megatool, you can setup a webdav server and rclone supports webdav...

Ok better workaround than nothing. Is there some manual how can i do it? I don't know what exactly is webdav and how it will then work.

Also, what is your rclone mega configuration that it works for you and not for me? For me it any command works only one for few hours.

i do not use mega, i have a free account.
it is closed source with no official go lang support.
so rclone has to rely on third party software.
as a result, rclone cannot fully support mega.

from the megacmd command line
webdav /
and the output would look like
Serving via webdav /: http://127.0.0.1:4443/OUshHIDQ/Cloud%20Drive

create a rclone webdav remote, which would look like

[megawebdav]
type = webdav
url = http://127.0.0.1:4443/OUshHIDQ/Cloud%20Drive
vendor = other

and then run a command such as

rclone lsd megawebdav:
          -1 1969-12-31 19:00:00        -1 test
          -1 1969-12-31 19:00:00        -1 thetestbucket

And after this, can i use commands copy, ls and about like i would connected directly to mega with the same result?

yes, that is correct.

https://rclone.org/webdav/#modified-time-and-hashes
for what it is worth, i would not trust it.
as far as i know with mega webdav, no support for

  • checksums
  • mod-time

That's ok. I'm using my own method in bash script to update, not dependent on these two.

And on rclone mega page is written that mega doesn't support hashes anyway.

what method do you use, where you can trust data transfer without checksums?

Aha, you meant transfer hash, not generated hash on the server. Hmm, that is worse.

Hi,
I am experiencing the same issue. I have got a script that runs everytime my machine boots up, and it syncs some notes I have in my local machine to a folder in Mega.

After a while, I saw that I could not login to Mega. Trying the command line, the answer I got is that there is a failure in login and to try again later.

I wrote to the support team at Mega and told me that it was an issue related to Rclone, because it is not able to close the session after the transaction is finished, so, at Mega's point of view, I had a LOT of unknown opened sessions, they told me this opened sessions appeared in their database, so they have a mechanism to lock the account to prevent some bad thing to happen.

What I am trying to do is synchronize my Tomboy's notes, which currently are over 1 thousand. They are plain text small files, but more than one thousand (perhaps 1050 files I guess).

I tried other service providers (I mean free cloud storage providers) but till now I could not experience the same issue.

So, you see, I am stuck because although they give you a MEGAsync client to run some interesting commands from your desktop, it is not able, for instance, to let me load a bunch of music files at a time, in order to be able to listen to my favourite tunes using regular multimedia software. What I can do with this MEGAsync client is load ONE music file at a time and only listen to it using their web interface also...

The Mega support team also pointed out in their response, that I can use Mega-CMD command in conjunction with WebDav protocol so I can mount the remote folder as it were a local folder. I did but it did not work as expected, lot of failures, slaggishness, and tested a lot of multimedia software to see if I could play at least one music track but none of them could... So, mega-cmd and WebDav is not a solution.

I am running Linux Mint ver. 19.2 Tina 64 bits
Kernel ver. 4.15.0-153-generic (x86_64)
Rclone ver. 1.56.0
go version go1.16.5
the command I try to run is:
rclone sync /path/to/local/files name:/remote/path

If you can talk to Rclone developers about this issue or if you have a suggestions it will be greatly appreciated.

Best regards.