Gtk and glib errors when I build. Am I missing a dependency?

I checked out the master branch and opened the Duplicati.sln file in Monodevelop. If I select Duplicati.GUI.TrayIcon and hit the play button next to the dropdown, I end up with a status of “Build: 0 errors, 13 warnings”. Unfortunately, in the Application Output window, I get some error messages. And I cannot load 127.0.0.1:8200 in my browser, it says it cannot connect. (I did turn of my non-dev instance.)

A browser window sometimes pops up with the correct url, but it can’t connect either.

Here’s the output I get:

Server has started and is listening on 127.0.0.1, port 8200
Gtk-Message: Failed to load module "atk-bridge"
Gtk-Message: Failed to load module "canberra-gtk-module"
Exception in Gtk# callback delegate
  Note: Applications can use GLib.ExceptionManager.UnhandledException to handle the exception.
GLib.GException: Couldn't recognize the image file format for file '/home/username/dev/tools/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Debug/SVGIcons/dark/normal-error.svg'
  at Gdk.Pixbuf..ctor (System.String filename) [0x0006e] in <247d3298cc1240adb6e328c488f64545>:0 
  at Duplicati.GUI.TrayIcon.GtkRunner.GetIcon (Duplicati.GUI.TrayIcon.TrayIcons icon) [0x00158] in /home/username/dev/tools/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/GtkRunner.cs:301 
  at Duplicati.GUI.TrayIcon.GtkRunner.set_Icon (Duplicati.GUI.TrayIcon.TrayIcons value) [0x00008] in /home/username/dev/tools/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/GtkRunner.cs:312 
  at Duplicati.GUI.TrayIcon.TrayIconBase+<OnStatusUpdated>c__AnonStorey1.<>m__0 () [0x00059] in /home/username/dev/tools/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/TrayIconBase.cs:209 
  at Duplicati.GUI.TrayIcon.GtkRunner+<UpdateUIState>c__AnonStorey0.<>m__0 (System.Object sender, System.EventArgs arg) [0x00007] in /home/username/dev/tools/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/GtkRunner.cs:221 
  at Gtk.Application+InvokeCB.Invoke () [0x00000] in <e8d21baece374fadb4e2b3899720848c>:0 
  at GLib.Timeout+TimeoutProxy.Invoke (System.IntPtr data) [0x00000] in <940f51fcd0434c359bfa4fdc8e64ad03>:0 
  at GLib.SourceProxy.HandlerInternal (System.IntPtr data) [0x00000] in <940f51fcd0434c359bfa4fdc8e64ad03>:0 
  at GLib.ExceptionManager.RaiseUnhandledException (System.Exception e, System.Boolean is_terminal) [0x00000] in <940f51fcd0434c359bfa4fdc8e64ad03>:0 
  at GLib.SourceProxy.HandlerInternal (System.IntPtr data) [0x00000] in <940f51fcd0434c359bfa4fdc8e64ad03>:0 
  at Gtk.Application.gtk_main () [0x00000] in <e8d21baece374fadb4e2b3899720848c>:0 
  at Gtk.Application.Run () [0x00000] in <e8d21baece374fadb4e2b3899720848c>:0 
  at Duplicati.GUI.TrayIcon.GtkRunner.Run (System.String[] args) [0x0003b] in /home/username/dev/tools/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/GtkRunner.cs:198 
  at Duplicati.GUI.TrayIcon.TrayIconBase.Init (System.String[] args) [0x0003d] in /home/username/dev/tools/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/TrayIconBase.cs:78 
  at Duplicati.GUI.TrayIcon.GtkRunner.Init (System.String[] args) [0x00009] in /home/username/dev/tools/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/GtkRunner.cs:183 
  at Duplicati.GUI.TrayIcon.Program.RealMain (System.String[] _args) [0x00536] in /home/username/dev/tools/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/Program.cs:239 
  at System.Reflection.MonoMethod.InternalInvoke (System.Reflection.MonoMethod , System.Object , System.Object[] , System.Exception& ) [0x00000] in <2c1e745790d7412db8f8fdd869d65478>:0 
  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 /run/build/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:305 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /run/build/mono/mcs/class/referencesource/mscorlib/system/reflection/methodbase.cs:229 
  at Duplicati.Library.AutoUpdater.UpdaterManager.RunMethod (System.Reflection.MethodInfo method, System.String[] args) [0x0000e] in /home/username/dev/tools/duplicati/Duplicati/Library/AutoUpdater/UpdaterManager.cs:996 
  at Duplicati.Library.AutoUpdater.UpdaterManager.RunFromMostRecentSpawn (System.Reflection.MethodInfo method, System.String[] cmdargs, Duplicati.Library.AutoUpdater.AutoUpdateStrategy defaultstrategy) [0x0002b] in /home/username/dev/tools/duplicati/Duplicati/Library/AutoUpdater/UpdaterManager.cs:1079 
  at Duplicati.Library.AutoUpdater.UpdaterManager.RunFromMostRecent (System.Reflection.MethodInfo method, System.String[] cmdargs, Duplicati.Library.AutoUpdater.AutoUpdateStrategy defaultstrategy) [0x00027] in /home/username/dev/tools/duplicati/Duplicati/Library/AutoUpdater/UpdaterManager.cs:1072 
  at Duplicati.GUI.TrayIcon.Program.Main (System.String[] args) [0x0001d] in /home/username/dev/tools/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/Program.cs:62 

I’m running Ubuntu 16.04. I did start from a server image, and manually chose everything I wanted installed. So I could easily be missing something the normal desktop distribution has.

Any ideas?

I think this is the problem. Try:

apt install gtk-sharp2

and see if that fixes the problem.

It’s already installed.

$ sudo apt install gtk-sharp2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
gtk-sharp2 is already the newest version (2.12.45-0xamarin9+ubuntu1604b1).
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.

I searched on a couple key words and found this:

$ sudo apt search bridge | grep atk

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libatk-adaptor/xenial,now 2.18.1-2ubuntu1 amd64 [installed,automatic]
libatk-adaptor-data/xenial,xenial 2.18.1-2ubuntu1 all
libatk-bridge2.0-0/xenial,now 2.18.1-2ubuntu1 amd64 [installed,automatic]
libatk-bridge2.0-dev/xenial 2.18.1-2ubuntu1 amd64
libatk-wrapper-java/xenial,xenial 0.33.3-6 all
libatk-wrapper-java-jni/xenial 0.33.3-6 amd64
$ sudo apt search canberra | grep gtk

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libcanberra-gtk-common-dev/xenial,xenial 0.30-2.1ubuntu1 all
libcanberra-gtk-dev/xenial 0.30-2.1ubuntu1 amd64
libcanberra-gtk-module/xenial,now 0.30-2.1ubuntu1 amd64 [installed]
libcanberra-gtk-module-dbg/xenial 0.30-2.1ubuntu1 amd64
libcanberra-gtk0/xenial,now 0.30-2.1ubuntu1 amd64 [installed,automatic]
libcanberra-gtk0-dbg/xenial 0.30-2.1ubuntu1 amd64
  libcanberra-gtk libraries detached debugging symbols
libcanberra-gtk3-0/xenial,now 0.30-2.1ubuntu1 amd64 [installed,automatic]
libcanberra-gtk3-0-dbg/xenial 0.30-2.1ubuntu1 amd64
  libcanberra-gtk libraries detached debugging symbols
libcanberra-gtk3-dev/xenial 0.30-2.1ubuntu1 amd64
libcanberra-gtk3-module/xenial,now 0.30-2.1ubuntu1 amd64 [installed]
libcanberra-gtk3-module-dbg/xenial 0.30-2.1ubuntu1 amd64

It looks like some of the -dev packages are not installed. Would those be required?

On a brand new Ubuntu 17.10 Desktop Virtualbox vm, I still cannot get a successful build on the master branch.

All I did was install build-essential, vim, git, flatpak from it’s ppa, and the monodevelop’s flatpak installer.

I did purge ubuntu-web-launchers…

The canberra-gtk-module error is still there. And the browser opens up to localhost:8200 but it says it cannot connect.

User assembly '/home/username/dev/duplicati/Duplicati/UnitTest/bin/Debug/Duplicati.UnitTest.dll' is missing. Debugger will now debug all code, not just user code.
Loaded assembly: /home/username/dev/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Debug/Duplicati.GUI.TrayIcon.exe
Loaded assembly: /home/username/dev/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Debug/Duplicati.Server.exe
Loaded assembly: /home/username/dev/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Debug/Duplicati.Library.AutoUpdater.exe
Loaded assembly: /app/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll [External]
Loaded assembly: /home/username/dev/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Debug/Duplicati.Library.Utility.dll
Loaded assembly: /app/lib/mono/gac/System.Core/4.0.0.0__b77a5c561934e089/System.Core.dll [External]
Loaded assembly: /home/username/dev/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Debug/Duplicati.License.dll
Loaded assembly: /app/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll [External]
Loaded assembly: /home/username/dev/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Debug/Newtonsoft.Json.dll [External]
Loaded assembly: /home/username/dev/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Debug/Duplicati.Library.Interface.dll
Loaded assembly: /home/username/dev/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Debug/Duplicati.Server.Serialization.dll
Loaded assembly: /home/username/dev/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Debug/Duplicati.Library.Logging.dll
Loaded assembly: /app/lib/mono/gac/System.Data/4.0.0.0__b77a5c561934e089/System.Data.dll [External]
Thread started:  #2
Loaded assembly: /home/username/dev/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Debug/HttpServer.dll [External]
Loaded assembly: /home/username/dev/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Debug/Duplicati.Library.UsageReporter.dll
Loaded assembly: /home/username/dev/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Debug/CoCoL.dll [External]
Loaded assembly: /home/username/dev/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Debug/SQLiteHelper.dll
Loaded assembly: /app/lib/mono/gac/Mono.Data.Sqlite/4.0.0.0__0738eb9f132ed756/Mono.Data.Sqlite.dll [External]
Loaded assembly: /app/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll [External]
Loaded assembly: /app/lib/mono/gac/System.Transactions/4.0.0.0__b77a5c561934e089/System.Transactions.dll [External]
Loaded assembly: /home/username/dev/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Debug/UnixSupport.dll [External]
Loaded assembly: /app/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/Mono.Posix.dll [External]
Thread started:  #3
Thread started: UpdatePollThread #4
Thread started:  #5
Thread started: WorkerThread<IRunnerData> #6
Thread started: TaskScheduler #7
Loaded assembly: /home/username/dev/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Debug/BouncyCastle.Crypto.dll [External]
Loaded assembly: /home/username/dev/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Debug/Duplicati.Library.Main.dll
Loaded assembly: /home/username/dev/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Debug/Duplicati.Library.Snapshots.exe
Thread started:  #8
Loaded assembly: /app/lib/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll [External]
Thread started: <Thread Pool> #9
Loaded assembly: /home/username/dev/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Debug/Duplicati.Library.Localization.dll
Loaded assembly: /home/username/dev/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Debug/NGettext.dll [External]
NGettext: Creating a built-in plural rule for langcode "en" for locale "en-US".
NGettext: Translation not found for message id "Server has started and is listening on {0}, port {1}".
Server has started and is listening on 127.0.0.1, port 8200
Loaded assembly: /home/username/dev/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Debug/Duplicati.Library.Modules.Builtin.dll
Loaded assembly: /home/username/dev/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Debug/Duplicati.Library.OAuthHelper.dll
Thread started: <Thread Pool> #10
Thread started: <Thread Pool> #11
Thread started: <Thread Pool> #12
Thread started: <Thread Pool> #13
Loaded assembly: /app/lib/mono/gac/System.Numerics/4.0.0.0__b77a5c561934e089/System.Numerics.dll [External]
Loaded assembly: /app/lib/mono/gac/System.Runtime.Serialization/4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll [External]
Thread started: TrayIcon Request Thread #14
Loaded assembly: /app/lib/mono/gac/gtk-sharp/2.12.0.0__35e10195dab3c99f/gtk-sharp.dll [External]
Loaded assembly: /app/lib/mono/gac/glib-sharp/2.12.0.0__35e10195dab3c99f/glib-sharp.dll [External]
Loaded assembly: /app/lib/mono/gac/atk-sharp/2.12.0.0__35e10195dab3c99f/atk-sharp.dll [External]
Loaded assembly: /app/lib/mono/gac/gdk-sharp/2.12.0.0__35e10195dab3c99f/gdk-sharp.dll [External]
Thread started: TrayIcon Longpoll Thread #15
Gtk-Message: Failed to load module "canberra-gtk-module"
Loaded assembly: /app/lib/mono/gac/System.Drawing/4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll [External]
Exception in Gtk# callback delegate
  Note: Applications can use GLib.ExceptionManager.UnhandledException to handle the exception.
GLib.GException: Couldn't recognize the image file format for file '/home/username/dev/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Debug/SVGIcons/dark/normal-error.svg'
  at Gdk.Pixbuf..ctor (System.String filename) [0x0006e] in <247d3298cc1240adb6e328c488f64545>:0 
  at Duplicati.GUI.TrayIcon.GtkRunner.GetIcon (Duplicati.GUI.TrayIcon.TrayIcons icon) [0x00158] in /home/username/dev/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/GtkRunner.cs:301 
  at Duplicati.GUI.TrayIcon.GtkRunner.set_Icon (Duplicati.GUI.TrayIcon.TrayIcons value) [0x00008] in /home/username/dev/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/GtkRunner.cs:312 
  at Duplicati.GUI.TrayIcon.TrayIconBase+<OnStatusUpdated>c__AnonStorey1.<>m__0 () [0x00059] in /home/username/dev/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/TrayIconBase.cs:209 
  at Duplicati.GUI.TrayIcon.GtkRunner+<UpdateUIState>c__AnonStorey0.<>m__0 (System.Object sender, System.EventArgs arg) [0x00007] in /home/username/dev/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/GtkRunner.cs:221 
  at Gtk.Application+InvokeCB.Invoke () [0x00000] in <e8d21baece374fadb4e2b3899720848c>:0 
  at GLib.Timeout+TimeoutProxy.Invoke (System.IntPtr data) [0x00000] in <940f51fcd0434c359bfa4fdc8e64ad03>:0 
  at GLib.SourceProxy.HandlerInternal (System.IntPtr data) [0x00000] in <940f51fcd0434c359bfa4fdc8e64ad03>:0 
  at GLib.ExceptionManager.RaiseUnhandledException (System.Exception e, System.Boolean is_terminal) [0x00000] in <940f51fcd0434c359bfa4fdc8e64ad03>:0 
  at GLib.SourceProxy.HandlerInternal (System.IntPtr data) [0x00000] in <940f51fcd0434c359bfa4fdc8e64ad03>:0 
  at Gtk.Application.gtk_main () [0x00000] in <e8d21baece374fadb4e2b3899720848c>:0 
  at Gtk.Application.Run () [0x00000] in <e8d21baece374fadb4e2b3899720848c>:0 
  at Duplicati.GUI.TrayIcon.GtkRunner.Run (System.String[] args) [0x0003b] in /home/username/dev/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/GtkRunner.cs:198 
  at Duplicati.GUI.TrayIcon.TrayIconBase.Init (System.String[] args) [0x0003d] in /home/username/dev/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/TrayIconBase.cs:78 
  at Duplicati.GUI.TrayIcon.GtkRunner.Init (System.String[] args) [0x00009] in /home/username/dev/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/GtkRunner.cs:183 
  at Duplicati.GUI.TrayIcon.Program.RealMain (System.String[] _args) [0x00536] in /home/username/dev/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/Program.cs:239 
  at System.Reflection.MonoMethod.InternalInvoke (System.Reflection.MonoMethod , System.Object , System.Object[] , System.Exception& ) [0x00000] in <2c1e745790d7412db8f8fdd869d65478>:0 
  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 /run/build/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:305 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /run/build/mono/mcs/class/referencesource/mscorlib/system/reflection/methodbase.cs:229 
  at Duplicati.Library.AutoUpdater.UpdaterManager.RunMethod (System.Reflection.MethodInfo method, System.String[] args) [0x0000e] in /home/username/dev/duplicati/Duplicati/Library/AutoUpdater/UpdaterManager.cs:996 
  at Duplicati.Library.AutoUpdater.UpdaterManager.RunFromMostRecentSpawn (System.Reflection.MethodInfo method, System.String[] cmdargs, Duplicati.Library.AutoUpdater.AutoUpdateStrategy defaultstrategy) [0x0002b] in /home/username/dev/duplicati/Duplicati/Library/AutoUpdater/UpdaterManager.cs:1079 
  at Duplicati.Library.AutoUpdater.UpdaterManager.RunFromMostRecent (System.Reflection.MethodInfo method, System.String[] cmdargs, Duplicati.Library.AutoUpdater.AutoUpdateStrategy defaultstrategy) [0x00027] in /home/username/dev/duplicati/Duplicati/Library/AutoUpdater/UpdaterManager.cs:1072 
  at Duplicati.GUI.TrayIcon.Program.Main (System.String[] args) [0x0001d] in /home/username/dev/duplicati/Duplicati/GUI/Duplicati.GUI.TrayIcon/Program.cs:62

libcanberra is installed.

$ dpkg --get-selections | grep canberra
gnome-session-canberra				install
libcanberra-gtk-module:amd64			install
libcanberra-gtk0:amd64				install
libcanberra-gtk3-0:amd64			install
libcanberra-gtk3-module:amd64			install
libcanberra-pulse:amd64				install
libcanberra0:amd64				install

I am not familiar with libcanberra, so I can’t help there. Does it work if you install Duplicati from the .deb package? If so, then I would assume that it pulls the correct depdencies. Running from your own build should then work the same.