Duplicati no longer launching on Mac - database version?

Suddenly, without upgrading the app or making any system changes Duplicati is no longer launching.
If I launch app from terminal I get errors (see below). If I delete Duplicati-server.sqlite file the app works again but all my settings, databases etc are gone.

Crash! 
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Exception: A serious error occurred in Duplicati: System.Exception: Failed to create, open or upgrade the database.
Error message: 
The database has version 5 but the largest supported version is 4.

This is likely caused by upgrading to a newer version and then downgrading.
If this is the case, there is likely a backup file of the previous database version in the folder /Users/MacMini/.config/Duplicati.
  at Duplicati.Server.Program.GetDatabaseConnection (System.Collections.Generic.Dictionary`2[TKey,TValue] commandlineOptions) [0x0023b] in <5ce7873446514fd69c1c6b28a3dc0d2

Did you get this resolved yet? If not, what version of Duplicati are you using?

I am using 2.02.20 on a Mac OS X 10.11.6

I got the app to launch again by deleting the Duplicati-server.sqlite file.
I then had lost all my settings. Since I am still in the testing phase, I just deleted the whole backup and started from scratch.
So, yes it is working again, but the way I fixed it is not desired for a real, large backup.

I agree the solution wasn’t great, but I’m glad you got it working.

Unfortunately, with so few (you only?) people running into this (or at least reporting it) it’s tough to dig into possible causes.

I’ve updated the topic title to indicate it’s a “database version” related issue so hopefully if there are others running into this they can chime in.

Please let us know if the error happens to you again (though I’m guessing it won’t)…

There are other users reporting the same issue.

After going through the Github thread above I seem to have found a way around this on a Mac, at least for now.

I deleted all the files in ~/.config/Duplicati/ except backup_xxxxxx.sqlite (my latest backup), which allowed Duplicati to start but without any configured backups.

Closed Duplicati, opened backup_xxxxxx.sqlite in TextEdit and copied the contents into the newly created Duplicati-server.sqlite file. Started Duplicati again, repaired the database and things seem to be back to normal.

Thanks @Monstergerm for linking my thread.

It happened again. Duplicati crashed and is no longer launching. Something about wrong database version. This time I cannot get it to launch again. I deleted sqlite file and tried what Nito suggested, but Duplicati refuses to launch. Very frustrating …

Just for reference, here’s another database version post:

Had the same problem when moving from Canary to Beta.
To get it working again I changed back to Canary and activated the backup database by renaming it.

I was on Canary and it happened with the latest Canary update. I ran the updater and applied it. The web interface confirmed that I am running the latest update but when I look inside the Duplicati app I see in Info.plist an old version number.
Clicking on the app icon failed with messages like the app is already running or app already quit.
I trashed everything and freshly downloaded the beta version this time. I restored backup configuration from json files and recreated databases. So far it seems to work again.
So something with the update process seems to screw things up. My Update Channel is and always was Default (beta).

There were quite a few changes to the update process between the two betas, and we know some of the changes did cause update failures in some scenarios (though I don’t think we ever pinned down which scenarios).

Hopefully the painful part is over and future updates will go more smoothly now that you’re on the new process. But if not, please let us know.

So I have several computers testing Duplicati right now.
What is the safest way to go forward?

Avoid the Canary updates and stick with the less frequent Beta updates?
What update channel setting?
How do I switch my Canary backups to Beta backups without corrupting the database?

The choice of beta vs. canary channel really depends on how well the channels currently support your needs and how quickly you want access to new features.

If the beta does what you need, I’d suggest you stick with that - though personally I’m using the beta on one machine and canary on all the others I manage.

Switching from canary to beta shouldn’t be problem, particularly right now as they are very close to each other. As long as you aren’t using any canary specific parameters you should be able to do an install of Beta “over” Canary then change your Update channel (on main Settings page) from Canary to Beta (otherwise you’ll be alerted about canary updates you don’t want).

If you’re at all paranoid be sure to export your backup jobs to “To File” just in case something goes wrong, though personally I don’t recall ever needing to re-import a job after an update.

Note that I expect your update issues were more of a one-time thing due to update specific code changes. As far as I know that process is mostly settled now so the problems you had shouldn’t return moving forward.

Good thing I was paranoid and had a backup json file. The switch from canary to beta totally failed.

First I opened my Canary installation, switched to Beta Update channel and checked for new update. None was available (I thought the app would tell me about the latest beta).

Then I quit the Canary app and just for fun relaunched it. App is no longer launching with same database errors in Console log as reported previously.

Then I freshly installed Beta app from a disk image , deleted Canary app and I am still not able to launch Beta app. After I completely delete the content of the Duplicati config folder I can finally launch the Beta app but of course I have to restore all my backup settings and repair the database.

So, maybe this helps figuring out what is going wrong here.

Sorry to hear that - and glad to hear you did back up your json file.

Let us know if you run into any issues with the database repair - and thanks for the detail about the process you had to go through. Hopefully we can align it with some other reports and figure out why it happened.

Duplicati is not longer launching on a Mac. No upgrades were made. Running Duplicati 2.0.3.3_beta_2018-04-02 and Mac High Sierra 10.13.6. I am not an experienced user, although I am running Duplicati on 6 different Macs. Any suggestions on what I should do to try to find out why it will no longer launch?

Is this the same Mac you’ve had issues on twice before or is it a different machine?

Are you running tray-icon or service/daemon?

Do you get any console messages if you run from command line?

Have you checked for an error log in %LOCALAPPDATA%Duplicati\crashlog.txt? (Usually created only on super catastrophic errors like not being able to write to the database logs.)

I finally got together with my son on whose computer this issue was occurring. We still can’t launch Duplicati. Here are the answers to your questions. Any suggestions on how to proceed?

  1. It is a different Mac than the one that had issues from before.
  2. On the mac, the main Duplicati app is automatically launched at startup.
  3. Have not tried to launch from the command line. I have not used the command line tool before. I would need to learn how to do that.
  4. There is an error file that gets created when you try to launch! Here it is:
    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.Exception: A serious error occurred in Duplicati: System.Exception: Failed to create, open or upgrade the database.
    Error message: The database disk image is malformed
    database disk image is malformed
    at Duplicati.Server.Program.GetDatabaseConnection (System.Collections.Generic.Dictionary2[TKey,TValue] commandlineOptions) [0x0023b] in <670b0e4a9ae144208688fcb192d20146>:0 at Duplicati.Server.Program.RealMain (System.String[] _args) [0x002bb] in <670b0e4a9ae144208688fcb192d20146>:0 ---> System.Exception: Failed to create, open or upgrade the database. Error message: The database disk image is malformed database disk image is malformed at Duplicati.Server.Program.GetDatabaseConnection (System.Collections.Generic.Dictionary2[TKey,TValue] commandlineOptions) [0x0023b] in <670b0e4a9ae144208688fcb192d20146>:0
    at Duplicati.Server.Program.RealMain (System.String _args) [0x002bb] in <670b0e4a9ae144208688fcb192d20146>:0
    — End of inner exception stack trace —
    at Duplicati.GUI.TrayIcon.HostedInstanceKeeper…ctor (System.String args) [0x00093] in :0
    at Duplicati.GUI.TrayIcon.Program.RealMain (System.String _args) [0x002a8] in :0
    at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object,System.Exception&)
    at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object parameters, System.Globalization.CultureInfo culture) [0x00032] in :0
    — End of inner exception stack trace —
    at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object parameters, System.Globalization.CultureInfo culture) [0x00048] in :0
    at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object parameters) [0x00000] in :0
    at Duplicati.Library.AutoUpdater.UpdaterManager.RunMethod (System.Reflection.MethodInfo method, System.String args) [0x00000] in <9ce928d8db224e1f8330a80e119b5dbe>:0

Looks like somehow the database (probably the main one) got corrupted.

I’d suggest moving any databases not named “duplicati-server.sqlite” to another folder and see if it starts.

If not, move the server one ou5 and try again. If that works, move any non-server ones back.

Once we’ve narrowed down the bad database(s) we can look at repairing it replacing.

Just connected with my son (and his laptop) today. We followed this suggestion and Duplicati started. We had moved out three .sqlite files and one .backup file. I then moved the files back in and restarted the computer and Duplicati and Duplicati still started, which was good, but the backup sets did not show up in the GUI.

What might be a good next step to see if we can get the backup sets to show up again?