Error testing connection to mega.nz

Unexpected character encountered while parsing value: . Path ‘’, line 0, position 0.

Hello

could you provide some more information, say, a screenshot showing what you are trying to do, and the error message ?

Same problem here. I tried to add a new backup to mega.nz, this error is displayed when I click on Test Connection button: Failed to connect: Unexpected character encountered while parsing value: . Path ‘’, line 0, position 0.

Hello

tested it with a free account and current Duplicati canary, works for me.
So either you are using a special sort of account or set something different than the default in your provider setup, or there is a problem in the info that you hide behind the error message (I left the path empty).

Were there old backups on the same account? How are they on Test connection, etc.?
The behavior of MEGA sounds like it can depend on stored size and maybe other things.
See About → Libraries for the mega.nz one. Recently lib did a fix for an interesting issue:

Unable to GetNodes (API update?) #211

List all files / folders on your Mega account

// GetNodes retrieves all files/folders metadata from Mega
  // so this method can be time consuming
  IEnumerable<INode> nodes = client.GetNodes();

is the list from Test connection, so might do GetNode which might fail, e.g. if MEGA compressed.

Support compressed api response #213 was the pull request on MegaApiClient, put in version 1.10.3, which was available on Oct 16, 2022 and is not in a Duplicati release. Library updates aren’t frequent.

I don’t know how feasible it is to test this theory, e.g. by your local install of a newer MegaApiClient.dll
Going the other way, I don’t know if a free account can get big enough to let @gpatel-fr try to break it.

Occasionally an ambitious person will build from source to get a fast fix, and sometimes this is shared among others having the same issue. Unfortunately, it takes awhile to do even a Canary the right way.

There’s a shortage of developers, and behind those the only release manager has had no time lately. Because Duplicati runs on volunteers, those willing to contribute in any way they can are encouraged.

Anyway, there’s a possible lead, and I couldn’t find lots of complaints on the Internet about breakages.
Timing’s a little odd with two Duplicati observations at once, but what’s the run/account history timing?

@syscom and @silasgcf are both invited to post a few details which could support or refute a theory.

Duplicati

Estou ainda fazerndo o teste de conexão e a conta tem 3tera disponivel pra 3 usuarios.
obrigado.

@syscom

Can you try to export the job as command line, extract the connection string, then use

Duplicati.CommandLine.BackendTool.exe list (connection string) 

to try to show what is on your backend ? Maybe a clearer message will appear in the terminal.

Executando entrada de linha de comando
Finalizado!

Backup started at 23/02/2023 20:58:18
Checking remote backup …
Listing remote folder …
Listing remote folder …
Listing remote folder …
Listing remote folder …
Listing remote folder …
Fatal error => Unexpected character encountered while parsing value: . Path ‘’, line 0, position 0.

Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: . Path ‘’, line 0, position 0.
em Duplicati.Library.Main.BackendManager.List()
em Duplicati.Library.Main.Operation.FilelistProcessor.RemoteListAnalysis(BackendManager backend, Options options, LocalDatabase database, IBackendWriter log, IEnumerable1 protectedFiles) em Duplicati.Library.Main.Operation.FilelistProcessor.VerifyRemoteList(BackendManager backend, Options options, LocalDatabase database, IBackendWriter log, IEnumerable1 protectedFiles)
em Duplicati.Library.Main.Operation.BackupHandler.PreBackupVerify(BackendManager backend, String protectedfile)
em Duplicati.Library.Main.Operation.BackupHandler.d__20.MoveNext()
— Fim do rastreamento de pilha do local anterior onde a exceção foi gerada —
em System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
em CoCoL.ChannelExtensions.WaitForTaskOrThrow(Task task)
em Duplicati.Library.Main.Controller.<>c__DisplayClass14_0.b__0(BackupResults result)
em Duplicati.Library.Main.Controller.RunAction[T](T result, String[]& paths, IFilter& filter, Action1 method) em Duplicati.Library.Main.Controller.Backup(String[] inputsources, IFilter filter) em Duplicati.CommandLine.Commands.Backup(TextWriter outwriter, Action1 setup, List1 args, Dictionary2 options, IFilter filter)
em Duplicati.CommandLine.Program.ParseCommandLine(TextWriter outwriter, Action1 setup, Boolean& verboseErrors, String[] args) em Duplicati.CommandLine.Program.RunCommandLine(TextWriter outwriter, TextWriter errwriter, Action1 setup, String[] args)
Return code: 100

@luis_fillipi

you are not the person I addressed. You are not following the last advice I gave. Good luck.

@gpatel-fr é o meu filho tentando me ajudar. Ele entrou em uma parte que executou a linha de comando e deu essa mensagem. Descupe não tenho muita facilidade no que aconselhou pra fazer, ainda não consigo fazer o backup para a mega que paguei o serviço para 3 terabytes.

@syscom

@ts678 is right, your problem is caused by an Api update in mega.nz that appears only when there is a large number of files and that’s why I don’t see it. What would be needed is indeed an update to the project to include updated Mega client version.

theory being that at some point it’s worth compressing file listing. Available space might not matter.

Due to the commit and release bottlenecks, we sometimes have people install replacement pieces.

What do you think the chances are that a drop-in .dll plan would work? You could test it with your relatively empty MEGA to get confidence it fits and doesn’t break, then have them test it on theirs…

The other option, short of their getting an emptier MEGA account, is to install Rclone to see if Mega works well with that. If it does, then have Duplicati use Rclone storage type for its destination needs.

No it don’t. The connection fails with bad Tls version.
I suspect that the problem is in the patch.

For some reason Duplicati use the 4.6 Net version, and the patch has been built with different code for .Net version < 4.7, Tls 1.2 is not specified explicitly. And no, dropping the 4.7 version of MegaApiClient does not work, as expected (I tried anyway).

Edit: I checked and recompiling Duplicati for new MegaApiclient.dll works.

Looking in 1.9.0 package using 7-Zip, that’s the highest Framework. Now they even have 4.7.1.
Are you trying to get to the #if NET471 || NETSTANDARD branch? Maybe one of those would?

It’s great news, but more pieces probably makes unofficial distribution harder but not impossible.

Thanks for pushing on this.

I think that updating Duplicati.Library.Backend.Mega.dll and MegaApiClient.dll could do to check if this is indeed the root cause of the problem.

That’s one .dll less than the Jottacloud workaround here, and one of yours is even an original library (probably still best to offer it than to provide directions for how to find it directly from nuget.org though).

Or maybe you’re hoping we can do a release soon. I’m certainly hoping, as are some Jottacloud users whose needed fix is one of the of the 4 commits that made it in after 2.0.6.104. I wonder if another will suffice to ask for another Canary? There are many big PRs needing help, but I expect .dll one is small.

it’s even possible to just extract it from the Megaapi client release page, nuget packages are zip files, you just have to add a .zip extension to open it in the Windows explorer.

oh yes it’s trivial. But even trivial changes can break. However in this case it’s arguable that Duplicati is already broken in this case.

1 Like

@gpatel-fr , @ts678 . Perdoe-me a insistencia, mas consegui abrir um outra conta gratuita , sem nenhum arquivo na mega e mesmo assim da o mesmo erro ao testar conexao, estou achando que possa ser alguma configuração do navegador como apontaram sobre Framework e Tls 1.2, seria possivel?

Translation:

Forgive me for insisting, but I managed to open another free account, without any files in the mega and even so it gives the same error when testing the connection, I am thinking that it could be some browser configuration as pointed out about Framework and Tls 1.2, would it be possible?

What OS is this? Windows? Linux? Which? Another possibility is compression got enabled randomly.

The message “sounds” like it got past TLS, but knowing it is hard unless you want to capture packets.

ja testei fazer essa conexão em windows 10 64bit, e windows server 2012r2 64bit. Faco a instalaçao, ele a tela de configuração no browser google chrome e quando vou fazer o processo de configuração de qualquer situação de backup na 2 tab onde coloco o serviço de cloud que vou usar que no casa é a mega e peço pra testar a conexão, ja recebo essa menssagem.

Essa é a primeira tela de informaçoes.

Essa é a segunda tela que ao cliclar em testar conexão ja da esse erro.