Skip to content

[BUG] Missing critical env var from Internal/System/Run shell path #3855

@fritz-fritz

Description

@fritz-fritz

Make sure you're on the latest stable or beta build

  • I have tested this on the latest stable or beta release

Is this a bug in companion itself or a module?

  • I believe this to be a bug in companion and not a specific module

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

With the update to v4.2.0 there was a bugfix note of limit env vars passed to modules. This broke some of my buttons that launched GUI applications with the following log message:

25.12.22 00:45:13 Internal/System: Shell command failed. Guru meditation:
{
  "code": 134,
  "killed": false,
  "signal": null,
  "cmd": "obs",
  "stdout": "",
  "stderr": "Detected locale \"C\" with character encoding \"ANSI_X3.4-1968\", which is not UTF-8.
                 Qt depends on a UTF-8 locale, and has switched to \"C.UTF-8\" instead.
                 If this causes problems, reconfigure your locale. See the locale(1) manual
                 for more information.
                 qt.qpa.xcb: could not connect to display 
                 qt.qpa.plugin: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin.
                 qt.qpa.plugin: Could not load the Qt platform plugin \"xcb\" in \"\" even though it was found.
                 This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

                 Available platform plugins are: vnc, wayland, offscreen, minimal, vkkhrdisplay, xcb, linuxfb, eglfs, wayland-egl, minimalegl.

                 Aborted (core dumped)
                 "
}

Steps To Reproduce

  1. Add a new press action to a button
  2. Select internal > System: Run shell path (local)
  3. Enter a path to a graphical application under path
  4. Press button

Expected Behavior

Previously, the configured application would be launched without issue but due to the restricted environment variables it is now failing. I expect the application to be launched.

Environment (please complete the following information)

- OS: Linux x86_64 KDE Plasma 6.5.4 Wayland
- Companion Version: v4.2.0

Additional context

After testing it seems companion is only passing:

HOME=/home/user
XDG_RUNTIME_DIR=/run/user/1000
PWD=/usr/local/bin/companion-x64/resources

A recommended fix would be to also pass XDG_SESSION_TYPE as adding that to the path before the application seems to resolve the problem for me on a wayland desktop.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BUGSomething isn't workingarea/internalRelated to an internal action or function of Companion.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions