[Ubuntu] Pinta refuses to quit (Unhandled exception)

Bug #750441 reported by Dene W
40
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Pinta
Fix Released
Medium
Unassigned

Bug Description

Ubuntu 10.04 32bit
Pinta 0.8
Open Pinta
Select close from menu or X from titlebar

The following error always appears:

Unhandled exception:
Exception has been thrown by the target of an invocation.

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.DirectoryNotFoundException: Could not find a part of the path "/home/dene/.config/Pinta/layouts.xml".
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in <filename unknown>:0
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
  at System.Xml.XmlTextWriter..ctor (System.String filename, System.Text.Encoding encoding) [0x00000] in <filename unknown>:0
  at MonoDevelop.Components.Docking.DockFrame.SaveLayouts (System.String file) [0x00000] in <filename unknown>:0
  at Pinta.MainWindow.<MainWindow>m__23 (System.Object , System.EventArgs ) [0x00000] in <filename unknown>:0
  at Pinta.Core.FileActions.HandlePintaCoreActionsFileExitActivated (System.Object sender, System.EventArgs e) [0x00000] in <filename unknown>:0
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
  at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in <filename unknown>:0
  at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in <filename unknown>:0
  at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in <filename unknown>:0
  at GLib.Signal.ClosureInvokedCB (System.Object o, GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0
  at GLib.SignalClosure.Invoke (GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0
  at GLib.SignalClosure.MarshalCallback (IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data) [0x00000] in <filename unknown>:0

Revision history for this message
grofaty (grofaty) wrote :

There is an info:
System.IO.DirectoryNotFoundException: Could not find a part of the path "/home/dene/.config/Pinta/layouts.xml"

If I remember correctly Ubuntu 10.04 does not use the same directory structure. Can you manually create directory like in terminal:
mkdir /home/dene/.config/Pinta
and run Pinta again.

Revision history for this message
grofaty (grofaty) wrote :

By the way, how did you install Pinta 0.8 on Ubuntu 10.04? Did you create Pinta from source or used some PPA like: nilarimogard/webupd8 from: http://www.webupd8.org/2011/04/install-pinta-08-in-ubuntu-now.html

Revision history for this message
grofaty (grofaty) wrote :

I can reproduce the problem:
1. Delete Pinta directory: rm -rf /home/[user]/.config/Pinta (Note: replace [user] with your username)
2. Open Pinta and close it - the error "Could not find a part..." is produced, this is because Pinta saves settings that were used during Pinta (like layout of tools/history/palette/layers, new window size etc) and this settings are stored at "close".
3. Create directory: mkdir /home/[user]/.config/Pinta (Note: replace [user] with your username)
4. Start Pinta and close it again. Then check the ~/.config/Pinta directory and you will see there are 3 files created.

Revision history for this message
Dene W (helloiamdene) wrote :

Installed via the PPA.

I now have it working after opening pinta, editing the default image, saving it and closing (without error) - Now i can can open and close pinta without the error as described.

Revision history for this message
Alin Andrei (nilarimogard) wrote :

I can reproduce this bug in both Ubuntu 10.10 and 11.04 32bit. I'll make a "hack" to create that file when Pinta is installed and upload it to the PPA

Revision history for this message
Alin Andrei (nilarimogard) wrote :

Well it seems the missing ~/.config/Pinta directory wasn't actually what was causing this because I can now reproduce this even though that folder exists. Here's the error I get:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.UnauthorizedAccessException: Access to the path "/home/andrei/.config/Pinta/layouts.xml" is denied.
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in <filename unknown>:0
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
  at System.Xml.XmlTextWriter..ctor (System.String filename, System.Text.Encoding encoding) [0x00000] in <filename unknown>:0
  at MonoDevelop.Components.Docking.DockFrame.SaveLayouts (System.String file) [0x00000] in <filename unknown>:0
  at Pinta.MainWindow.<MainWindow>m__23 (System.Object , System.EventArgs ) [0x00000] in <filename unknown>:0
  at Pinta.Core.FileActions.HandlePintaCoreActionsFileExitActivated (System.Object sender, System.EventArgs e) [0x00000] in <filename unknown>:0
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
  at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in <filename unknown>:0
  at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in <filename unknown>:0
  at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in <filename unknown>:0
  at GLib.Signal.ClosureInvokedCB (System.Object o, GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0
  at GLib.SignalClosure.Invoke (GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0
  at GLib.SignalClosure.MarshalCallback (IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data) [0x00000] in <filename unknown>:0

Revision history for this message
Alin Andrei (nilarimogard) wrote :

Oops, please disregard my last comment, I wasn't right actually.

Revision history for this message
grofaty (grofaty) wrote :

The main question now is, should Pinta program create a ~/.config/Pinta if it does not exists when closing or should install program do the job. If I look at e.g. Firefox and I manually delete ~/.mozilla/firefox folder, then Firefox program automatically create this folder again when Firefox is run. Following the same principle Pinta program should create a folder if it does not already exists when Pinta is closing.

Revision history for this message
Jonathan Pobst (jpobst) wrote :

Pinta should be creating this. It's a trivial fix that I'll ensure is in 1.0.

Changed in pinta:
milestone: none → 1.0
Revision history for this message
Jonathan Pobst (jpobst) wrote :
Changed in pinta:
importance: Undecided → Medium
status: New → Fix Committed
Robert Nordan (rpvn)
Changed in pinta:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.