Unable to lanch with "--batch-process" option

Summary:

In an ubuntu:21.10 container, I'm unable to launch Inkscape with the --batch-process option.

Steps to reproduce:

  • Launch a container: docker run --rm -it ubuntu:21.10 bash
  • Install Inkscape: apt update; apt install inkscape
  • Check version:
$ inkscape --version
Unable to init server: Could not connect: Connection refused
Inkscape 1.1.1 (3bf5ae0d25, 2021-09-20)
  • Copy some .svg file inside the container: docker cp file.svg <container_id>:/tmp/
  • Launch:
$  inkscape /tmp/drawing.svg --export-plain-svg --batch-process --actions "EditSelectAll;StrokeToPath;FileSave" --export-filename "out_file.svg"
Unable to init server: Could not connect: Connection refused

(inkscape:7753): Gtk-CRITICAL **: 11:14:24.951: gtk_icon_theme_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed

Emergency save activated!
Emergency save completed. Inkscape will close now.
If you can reproduce this crash, please file a bug at https://inkscape.org/report
with a detailed description of the steps leading to the crash, so we can fix it.

(inkscape:7753): Gtk-CRITICAL **: 11:14:24.952: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed

(inkscape:7753): Gtk-CRITICAL **: 11:14:24.952: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed

(inkscape:7753): Gtk-CRITICAL **: 11:14:24.952: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
Segmentation fault (core dumped)

Even inkscape --batch-process alone lead to the same error.

What happened?

Inkscape crash with Emergency activated and a core dump.

What should have happened?

Inkscape should have launched normally

  • Sample attachments: N/A

Version info

inkscape --debug-info
Unable to init server: Could not connect: Connection refused
Inkscape 1.1.1 (3bf5ae0d25, 2021-09-20)

    GLib version:     2.68.4
    GTK version:      3.24.30
    glibmm version:   2.64.2
    gtkmm version:    3.24.5
    libxml2 version:  2.9.12
    libxslt version:  1.1.34
    Cairo version:    1.16.0
    Pango version:    1.48.10
    HarfBuzz version: 2.7.4
    Poppler version:  21.06.1

    OS version:       Ubuntu 21.10

Notes:

  • I've tried to simplify the process to have it reproducible, in my context, the real command is something like: inkscape -p --batch-process --actions="export-filename:%s; export-plain-svg; export-text-to-path; export-dpi:300; export-area-page; export-background:white; export-background-opacity:255; export-do; FileQuit;"

  • Tested with ubuntu:22.04, and latest version from ppa, same problem.

  • It used to work on ubuntu:groovy (Inkscape 1.0.1) with the same steps as above:

$ docker run -it --rm ubuntu:groovy bash
# apt update
# apt install inkscape

root@770315f0ae85:/# inkscape --version
Unable to init server: Could not connect: Connection refused
Inkscape 1.0.1 (3bc2e813f5, 2020-09-07)
    Pango version: 1.46.2
root@770315f0ae85:/# 
root@770315f0ae85:/# inkscape --batch-process
Unable to init server: Could not connect: Connection refused
Failed to get connection
** (inkscape:3596): CRITICAL **: 10:19:46.253: dbus_g_proxy_new_for_name: assertion 'connection != NULL' failed

** (inkscape:3596): CRITICAL **: 10:19:46.253: dbus_g_proxy_call: assertion 'DBUS_IS_G_PROXY (proxy)' failed

** (inkscape:3596): CRITICAL **: 10:19:46.253: dbus_g_connection_register_g_object: assertion 'connection != NULL' failed

** (inkscape:3596): WARNING **: 10:19:46.352: Fonts dir '/usr/share/inkscape/fonts' does not exist and will be ignored.
ConcreteInkscapeApplication<T>::create_window: Should not be called!
root@770315f0ae85:/# echo $?
0
root@770315f0ae85:/# 
Edited by kumy