SQL logic error no such column: −100

After the latest beta update, I keep getting this error when attempting to do a backup:

code = Error (1), message = System.Data.SQLite.SQLiteException (0x800007BF): SQL logic error
no such column: −100
   at System.Data.SQLite.SQLite3.Prepare(SQLiteConnection cnn, String strSql, SQLiteStatement previous, UInt32 timeoutMS, String& strRemain)
   at System.Data.SQLite.SQLiteCommand.BuildNextCommand()
   at System.Data.SQLite.SQLiteDataReader.NextResult()
   at System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave)
   at Duplicati.Library.Main.Database.ExtensionMethods.ExecuteScalarInt64(IDbCommand self, Boolean writeLog, String cmd, Int64 defaultvalue)
   at Duplicati.Library.Main.Database.ChangeStatistics.CountWithCondition(IDbCommand cmd, String tmpName, String alias, String baseCondition, Nullable`1 blocksetId, Int64[] excludeBlocksets)
   at Duplicati.Library.Main.Database.ChangeStatistics.CountAdded(IDbCommand cmd, String tmpName, Nullable`1 blocksetId, Int64[] excludeBlocksets)
   at Duplicati.Library.Main.Database.ChangeStatistics.UpdateChangeStatistics(IDbCommand cmd, BackupResults results, Int64 currentFilesetId, Int64 previousFilesetId)
   at Duplicati.Library.Main.Database.LocalBackupDatabase.UpdateChangeStatistics(BackupResults results, IDbTransaction transaction)
   at Duplicati.Library.Main.Operation.Backup.BackupDatabase.<>c__DisplayClass34_0.<UpdateChangeStatisticsAsync>b__0()
   at Duplicati.Library.Main.Operation.Common.SingleRunner.DoRunOnMain[T](Func`1 method)
   at Duplicati.Library.Main.Operation.Backup.UploadRealFilelist.Run(BackupResults result, BackupDatabase db, IBackendManager backendManager, Options options, FilesetVolumeWriter filesetvolume, Int64 filesetid, ITaskReader taskreader, Boolean lastWasPartial)
   at Duplicati.Library.Main.Operation.BackupHandler.RunAsync(String[] sources, IBackendManager backendManager, IFilter filter)
   at Duplicati.Library.Main.Controller.<>c__DisplayClass22_0.<<Backup>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Duplicati.Library.Utility.Utility.Await(Task task)
   at Duplicati.Library.Main.Controller.RunAction[T](T result, String[]& paths, IFilter& filter, Func`3 method)
   at Duplicati.Library.Main.Controller.Backup(String[] inputsources, IFilter filter)
   at Duplicati.Server.Runner.RunInternal(Connection databaseConnection, EventPollNotify eventPollNotify, INotificationUpdateService notificationUpdateService, IProgressStateProviderService progressStateProviderService, IApplicationSettings applicationSettings, IRunnerData data, Boolean fromQueue)

The error is shown twice in the log after each backup attempt:

1 sep 2025 11:23: Failed while executing Backup "Rclone Cloud" (id: 16)
1 sep 2025 11:23: Error in worker

I’ve tried both repairing, and recreating the database. No change.

Verifying the database shows no errors at all. Any idea how I can fix this without deleting my entire backup and starting over? I’d hate having to do that. :frowning:

Thanks for reporting this.

The problem is that some locales (Swedish being one I know of) do not insert a regular minus in front of a number, but instead an extended unicode that shows a slightly longer line.

This is fine visually, but it messes with the SQL parser that does not understand the number.

I checked up on the code, and I cannot see the issue present in the latest beta (2.1.2.0), but the issue is present in the latest canary. Did you mean the latest canary instead?

A workaround is to run Duplicati with a en-US locale, or change the regional settings to use a regular - for the negative numbers.

Nope: You are currently running Duplicati - 2.1.2.0_beta_2025-08-20

Thank you, I’ll try it out later today and come back to let you all know if it worked.

Edit: It’s gonna take a couple of days as it needs to re-validate > 10 tb of data, since I deleted and re-created the database.

Thank you! It worked! :slight_smile:

I added Environment=“LANG=C” to duplicati.service which solved it.

Thanks for confirming that. I found a corner where the locale was being applied even though it should not be. It will be fixed in the next beta.

1 Like

I updated to v2.1.2.1_beta_2025-10-03, and the bug persists. I had to re-edit duplicati.service since the update removed my workaround.

I just noticed that adding Environment=“LANG=C” to duplicati.service didn’t do its job as a workaround in beta 2.1.2.1. The error keeps showing up every time after a backup. :frowning:

What sort of double quotes did you actually type? What you posted looks like this in source:

image

If there are actually left and right typographic (curly) quotes in unit file, I don’t know if they work.

If that isn’t it, you probably need the dev, but might as well make sure to use the neutral quotes.

If you mean direct edit, it’s not recommended because such loss can happen.
There’s a systemctl edit command available, but Duplicati intent might be:

Duplicati provides an EnvironmentFile already in unit file, for your variables.

Thank you for noticing this. I copied it from my previous post and pasted it to the .service file, somehow “ became a “. I’ve corrected it now and will update this post once the next backup is complete to let you know if that was the cause.

Can you post the stack trace again? Then I will dig in once again…

Nevermind, I managed to reproduce it and fix it. Thanks for reporting!