Inkscape snap CLI unable to access files

Summary:

Files that can be opened through the GUI can't be accessed via CLI.

Steps to reproduce:

I have an SVG file in my home directory:

[romano:~] % ls -l export.svg 
-rw-rw-r-- 1 romano romano 10669 ene 22 10:03 export.svg

The file can be opened and processed correctly via GUI interface. Unfortunately, the program that generates the file is using a CLI invocation of Inkscape to do file conversions, and it fails, because if you use the CLI invocation for Inkscape:

[romano:~] % inkscape ./export.svg 
ink_file_open: '/home/romano/export.svg' cannot be opened!
InkscapeApplication::document_open: Failed to open: /home/romano/export.svg
ConcreteInkscapeApplication::on_open: failed to create document!

So, it seems there is a problem with snap confinement. I had the same problem with the flatpak version on an Arch machine, and solved it by removing that version and substituting it with a native build. Unfortunately, Ubuntu does not offer a native build, and going around the internet, it seems the suggested option is installing the AppImage version (I'll try with the Inkscape PPA first... Ok, with the PPA native version it works ok).

Sample attachments:

export.svg

Version info

[romano:~] % inkscape --debug-info
Inkscape 1.3.1 (9b9bdc1480, 2023-11-25, custom)

    GLib version:     2.72.4
    GTK version:      3.24.33
    glibmm version:   2.66.2
    gtkmm version:    3.24.5
    libxml2 version:  2.9.13
    libxslt version:  1.1.34
    Cairo version:    1.16.0
    Pango version:    1.50.6
    HarfBuzz version: 2.7.4

    OS version:       Ubuntu Core 22
snap connections inkscape            
Interface              Plug                          Slot                            Notes
content[gtk-3-themes]  inkscape:gtk-3-themes         gtk-common-themes:gtk-3-themes  -
content[icon-themes]   inkscape:icon-themes          gtk-common-themes:icon-themes   -
dbus                   -                             inkscape:inkscape-dbus          -
desktop                inkscape:desktop              :desktop                        -
desktop-legacy         inkscape:desktop-legacy       :desktop-legacy                 -
gsettings              inkscape:gsettings            :gsettings                      -
network                inkscape:network              :network                        -
personal-files         inkscape:dot-config-inkscape  :personal-files                 -
raw-usb                inkscape:raw-usb              -                               -
unity7                 inkscape:unity7               :unity7                         -
wayland                inkscape:wayland              :wayland                        -
x11                    inkscape:x11                  :x11                            -

[romano:~] % inxi -SG
System:
  Host: pern Kernel: 6.8.0-51-generic arch: x86_64 bits: 64
  Desktop: GNOME v: 46.0 Distro: Ubuntu 24.04.1 LTS (Noble Numbat)
Graphics:
  Device-1: Intel Raptor Lake-S GT1 [UHD Graphics 770] driver: i915 v: kernel
  Device-2: AMD Navi 24 [Radeon RX 6400/6500 XT/6500M] driver: amdgpu
    v: kernel
  Device-3: Logitech B525 HD Webcam driver: snd-usb-audio,uvcvideo type: USB
  Display: wayland server: X.Org v: 23.2.6 with: Xwayland v: 23.2.6
    compositor: gnome-shell driver: dri: radeonsi gpu: amdgpu resolution:
    1: 2560x1440~60Hz 2: 2560x1440~60Hz
  API: EGL v: 1.5 drivers: iris,radeonsi,swrast
    platforms: wayland,x11,surfaceless,device
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: amd mesa v: 24.0.9-0ubuntu0.3
    renderer: AMD Radeon RX 6400 (radeonsi navi24 LLVM 17.0.6 DRM 3.57
    6.8.0-51-generic)
Edited by Romano Giannetti