Duplicati no longer launching on Mac - database version?

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 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?

The backup sets are stored in the duplicati-server.sqlite for (I think… There might be a.json for involved as well).

When Duplicati starter up it will create a black one if none is found. Do you have an older version of that database you could try copying into the folder?

You can always manually recreate the jobs and point the to the old databases - the truck is knowing which database was for which job.

The .backup file indicates a database was updated or repaired at some point. You might be able to use that if it’s not too old - but that’s a fairly hands on approach.

@kenkendk, how hard would it be to serialize the job (maybe with global settings} and store it in the job database to simplify this type of recovery?

I think so too. Unfortunately it was put aside earlier because The database disk image is malformed.
Database disk image is malformed was one case where the damage was assessed then manually repaired, however that’s a rather advanced effort. Some Internet postings also say that an export then import can fix, however what was done at the link above was more. You could attempt an SQLite repair if you would like…

A relatively simple task would be to see if the damaged Duplicati-server.sqlite will open in an SQLite viewer. Information in the Backup table includes the given name for each backup, and the path to its job database. Information in the Source table includes the folders and files that had been chosen to go into each backup. There’s also schedule information and more, for your use as aids to manually rebuilding the configurations.

DB Browser for SQLite is a tool that you can install to see whether it can read the old Duplicati-server.sqlite.

The best case would be if you have exported and saved the backup configuration yourself. If so, just import.

Old databases with random names can be inspected by looking inside using Direct restore from backup files. Maybe your configuration is short enough to just recreate. For help, see above on old Duplicati-server.sqlite.

1 Like

Great tip, thanks! 

Or maybe not a great tip. Works well for seeing what’s at the destination but I’m still looking for the UI to plug in a database. I suspect it doesn’t exist because a job database caches destination info, and has little config. One could reverse-engineer the source file configuration from the backup it produced, but it’s rather indirect. The inspection could be done by opening the randomly-named database in a viewer, or using Direct restore.

How to test which database belongs to which job? talks about this, and also about configuration backup idea.

Hi, There are various tools that we can use to try to figure out what is going on with the databases. (suggest to make a copy of duplicati-server.sqlite before proceeding and work only on the copy.)

Open the Duplicati-server.sqlite copy in dbeaver (the tool I usually use), DB Browser which @ts687 mentioned or another such tool. then can you please issue the following command and paste the results?


In most SQL tools you type the commands and press ‘ctrl’/‘cmd’ + ‘enter’ to execute them.

Thanks for the suggestion. I downloaded DB Browser and tried to open the Duplicati-server.sqlite file and it could not be opened. The error message said that the database disk image was malformed.

So, do I trash the online backup and start over or is there a way to save me from having to backup all of my files again to the cloud?

That’s kind of… alarming. How on earth could the database get into such a bad state that it cannot even be opened? I don’t want to alarm you but is there any evidence of a disk or filesystem issue?

What does file(1) identify ‘Duplicati-server.sqlite’ as? I belive that the traditional POSIX file command is installed with macintoshes, so E.G.

file /path/to/Duplicati-server.sqlite

Please paste the exact output.

At this point the only thing that I can suggest is seeing if the sqlite3 client tool can open it. It may be that the gui tool is doing some kind of processing which trips this error before we have time to get to a worksheet and enter commands. For example, looking at the screenshot, it looks like there are “database structure” and “browse data” tabs. IN order to meaningfully load them, it will parse the database to some way, probably by issuing SELECT commands against the system catalogue. In this case, it may ‘trip’ over the source of ‘malformity’ and die ungracefully.

Maybe we will get lucky!

If you want to try the sqlite3 tool, please download and unzip the SQLITE3 Precompiled Binaries for Mac OSX from SQLite Download Page Alternatively, a tool such as Homebrew may be used but I am not familiar with this.

Then extract and open a terminal in the location the binaries are extracted to and enter
./sqlite3 /path/to/copy of Duplicati-server.sqlite "PRAGMA integrity_check"

Again, I advise using a copy of the file.

Please paste the exact output. Even if they are vague.

I am not a dev, but I had a thought:

Theres’ a button on the UI that exports the job config as JSON

On each restart, the enterprise application that I work with ingests the latest version of its main configuration properties file into a special table called CONFIG_REGISTRY

maybe there could be, in the main and job-specific databases a table like:

CREATE TABLE config_registry ( 
    id           INTEGER PRIMARY KEY,
    digest       TEXT, -- md5sum of the JSON
    job_name     TEXT, -- denormalized reference to the 'name' of the job
    dtmodified   TEXT, -- Sqlite does not support dates
    config_json  TEXT  -- that exported JSON mentioned above

CREATE UNIQUE INDEX config_reg_digest on config_registry (digest);

On each startup, the app does the JSON export, gets the MD5 and inserts into this table with the ON CONFLICT DO NOTHING option

This can be kept from growing out of control rather easily by also doing

DELETE FROM config_registry WHERE id 
                           NOT IN ( SELECT id FROM config_registry
                                    WHERE job_name = :1 
                                    ORDER BY dtmodified DESC
                                    LIMIT 10 );

There would need to be some way to handle renaming of jobs, however.

1 Like

Have you tested the actual backup? Backups don’t need to be listed to be available. Try direct restore and see how the backup looks that way. Try a small restore. If all looks sound, then the challenge is to work out how to hook everything back together. Now that you have a DB browser, you can look through *.sqlite files, especially in their File table, to see if you can find something that matches what you think your backup had. You can also sanity-check it by file date. If it looks right, make sure you keep it around, and you can slide it underneath new job creation in Duplicati by copying it into the path Duplicati says on job Database screen. With only one backup and three regular .sqlite files, opening the four would probably get something of use.

Job databases can also be recreated from destination files (see Recreate button) but it can be very slow…

@Ingmyv makes a good point that there’s a chance there’s a hardware problem in action, and getting up after a disk replacement (which we can hope we don’t have) would be a similar process, starting maybe on direct restore to get some things back, then getting the job database rebuilt with Recreate plus some time. You’re in a somewhat nicer position because you might still have all your sqlite files except for the server’s.

If I recall correctly, when I tried using DB Browser in Linux and tried to open my .sqlite file when connect with a read-only user I got that error.

I ended up copying the .sqlite file to a local writeable folder and opening the copy from three w/out issue.

Do you mean where in the UI do you point an existing job to a different database? If so, it is rather un-intuative as you need to use the job Data base menu then not just enter but actually CHANGE the existing database path which will then activate the buttons beneath the field.

No. The context for that was direct restore, and for a moment I thought it could look inside random databases, but then I went to look for the actual web UI and didn’t see a place to enter its path. Your tip on specifying the database for a job was good though. I’ve poked at that UI for awhile, and its behavior was hard to understand, which definitely slows one down when handling important things like databases. Ideally it would be VERY clear.

Agreed - so you’re probably gonna love this… :slight_smile:

When doing a direct restore, you should be able to use “Edit as text” on one of the Advanced Options sections (such as in step 1 or 2) and manually add the --dbpath= parameter.

I’m not positive (and not sure how to easily test), but I think that will tell it to use that database instead of creating an interim one based on the destination files.