Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sunshine.service Failed with result 'exit-code' #1344

Closed
3 tasks done
CatEricka opened this issue Jun 1, 2023 · 8 comments
Closed
3 tasks done

sunshine.service Failed with result 'exit-code' #1344

CatEricka opened this issue Jun 1, 2023 · 8 comments

Comments

@CatEricka
Copy link

CatEricka commented Jun 1, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Is your issue described in the documentation?

  • I have read the documentation

Is your issue present in the nightly release?

  • This issue is present in the nightly release

Describe the Bug

systemctl --user start sunshine.service failed:

$ systemctl --user status sunshine.service

● sunshine.service - Sunshine is a self-hosted game stream host for Moonlight.
     Loaded: loaded (/home/serv/.config/systemd/user/sunshine.service; disabled; preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Thu 2023-06-01 11:10:03 CST; 3s ago
    Process: 3793 ExecStart=flatpak run --command=sunshine dev.lizardbyte.app.Sunshine (code=exited, status=203/EXEC)
   Main PID: 3793 (code=exited, status=203/EXEC)
        CPU: 489us

6月 01 11:10:03 debian systemd[1566]: sunshine.service: Main process exited, code=exited, status=203/EXEC
6月 01 11:10:03 debian systemd[1566]: sunshine.service: Failed with result 'exit-code'.

$ systemctl --user start sunshine.service
Job for sunshine.service failed because the control process exited with error code.
See "systemctl --user status sunshine.service" and "journalctl --user -xeu sunshine.service" for details.

$ systemctl --user status sunshine.service 
× sunshine.service - Sunshine is a self-hosted game stream host for Moonlight.
     Loaded: loaded (/home/serv/.config/systemd/user/sunshine.service; disabled; preset: enabled)
     Active: failed (Result: exit-code) since Thu 2023-06-01 11:10:29 CST; 3min 48s ago
   Duration: 563us
    Process: 3850 ExecStart=flatpak run --command=sunshine dev.lizardbyte.app.Sunshine (code=exited, status=203/EXEC)
   Main PID: 3850 (code=exited, status=203/EXEC)
        CPU: 531us

6月 01 11:10:29 debian systemd[1566]: Stopped sunshine.service - Sunshine is a self-hosted game stream host for Moonlight..
6月 01 11:10:29 debian systemd[1566]: sunshine.service: Start request repeated too quickly.
6月 01 11:10:29 debian systemd[1566]: sunshine.service: Failed with result 'exit-code'.
6月 01 11:10:29 debian systemd[1566]: Failed to start sunshine.service - Sunshine is a self-hosted game stream host for Moonlight..
6月 01 11:13:52 debian systemd[1566]: sunshine.service: Start request repeated too quickly.
6月 01 11:13:52 debian systemd[1566]: sunshine.service: Failed with result 'exit-code'.
6月 01 11:13:52 debian systemd[1566]: Failed to start sunshine.service - Sunshine is a self-hosted game stream host for Moonlight..
6月 01 11:13:59 debian systemd[1566]: sunshine.service: Start request repeated too quickly.
6月 01 11:13:59 debian systemd[1566]: sunshine.service: Failed with result 'exit-code'.
6月 01 11:13:59 debian systemd[1566]: Failed to start sunshine.service - Sunshine is a self-hosted game stream host for Moonlight..

Expected Behavior

sunshine.service should start normally

Additional Context

Version v0.19.0 of sunshine_x86_64.flatpak works fine.

Host Operating System

Linux

Operating System Version

Debian GNU/Linux 12 (bookworm)

Architecture

32 bit

Sunshine commit or version

dev.lizardbyte.app.Sunshine 0.20.0 stable from flathub:

https://flathub.org/apps/dev.lizardbyte.app.Sunshine

https://github.com/flathub/dev.lizardbyte.app.Sunshine/tree/1b71ae0b22cf2464180c55045e8814da5e6cc444

Package

Linux - AppImage

GPU Type

AMD

GPU Model

AMD Radeon Graphics gfx1036

GPU Driver/Mesa Version

Mesa Gallium driver 22.3.6

Capture Method (Linux Only)

X11

Config

qsv_coder = auto
gamepad = x360
nv_preset = p4
amd_coder = auto
upnp = disabled
dwmflush = enabled
min_log_level = 2
origin_web_ui_allowed = lan
amd_quality = balanced
vt_software = auto
nv_coder = auto
qsv_preset = medium
fps = [10,30,60,90,120]
amd_vbaq = enabled
amd_preanalysis = disabled
encoder = vaapi
amd_rc = vbr_latency
hevc_mode = 2
nv_rc = cbr
vt_coder = auto
nv_tune = ull
key_rightalt_to_key_win = disabled
vt_realtime = enabled
origin_pin_allowed = pc
amd_usage = ultralowlatency
resolutions = [
    352x240,
    480x360,
    858x480,
    1280x720,
    1920x1080,
    2560x1080,
    3440x1440,
    1920x1200,
    3860x2160,
    3840x1600
]

Apps

No response

Relevant log output

No log
@CatEricka
Copy link
Author

I just noticed that the issue should belong to https://github.com/flathub/dev.lizardbyte.app.Sunshine .

@KuleRucket
Copy link
Contributor

The error "Start request repeated too quickly" is caused by this line in the sunshine.service file which is part of sunshine:
StartLimitBurst=5

This means that is something fails then it will not allow the service to be restarted again for a period. This doesn't say anything about the first issue that occurred though as you have not provided the journal for that.

StartLimitBurst is something I always remove from the unit file because I break things often when running tests and keeping it is annoying. It's debatable whether this should be in the normal release though. There are pro and cons in having it there.

@CatEricka
Copy link
Author

CatEricka commented Jun 1, 2023

This doesn't say anything about the first issue that occurred though as you have not provided the journal for that.

Because systemd cannot spawn processes, there is no log.

Anyway, just inspiration came, and I found two issues that dev.lizardbyte.app.Sunshine have:

  1. The ExecStart field of the service unit file which provided by dev.lizardbyte.app.Sunshine have a syntax error:
[Unit]
Description=Sunshine is a self-hosted game stream host for Moonlight.
StartLimitIntervalSec=500
StartLimitBurst=5
PartOf=graphical-session.target
Wants=xdg-desktop-autostart.target
After=xdg-desktop-autostart.target

[Service]
ExecStart="flatpak run --command=sunshine dev.lizardbyte.app.Sunshine"
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=xdg-desktop-autostart.target

There shouldn't be double quotes here, which results a Failed to locate executable flatpak run --command=sunshine dev.lizardbyte.app.Sunshine: No such file or directory error.

  1. dev.lizardbyte.app.Sunshine lacks permission --talk-name=org.freedesktop.Flatpak:

https://github.com/flathub/dev.lizardbyte.app.Sunshine/blob/1b71ae0b22cf2464180c55045e8814da5e6cc444/dev.lizardbyte.app.Sunshine.yml#L20

This caused the install script failed Portal call failed: org.freedesktop.DBus.Error.ServiceUnknown:

$ flatpak run --command=additional-install.sh dev.lizardbyte.app.Sunshine 
Sunshine User Service has been installed.
Use [systemctl --user enable sunshine] once to autostart Sunshine on login.
Configuring mouse permission.
Portal call failed: org.freedesktop.DBus.Error.ServiceUnknown
Restart computer for mouse permission to take effect.

and this seems to be causing the service to fail to start.


Another question, what is the relationship between https://github.com/flathub/dev.lizardbyte.app.Sunshine and this repo? Is dev.lizardbyte.app.Sunshine officially maintained?

@CatEricka CatEricka reopened this Jun 1, 2023
@CatEricka
Copy link
Author

The correct service unit should be like:

[Unit]
Description=Sunshine is a self-hosted game stream host for Moonlight.
StartLimitIntervalSec=500
StartLimitBurst=5
PartOf=graphical-session.target
Wants=xdg-desktop-autostart.target
After=xdg-desktop-autostart.target

[Service]
ExecStart=flatpak run --command=sunshine dev.lizardbyte.app.Sunshine
ExecStop=flatpak kill dev.lizardbyte.app.Sunshine
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=xdg-desktop-autostart.target

ExecStop is necessary.

@ReenigneArcher
Copy link
Member

That repo is not officially maintained yet... Someday it may be if we can come to agreements on how to build the flatpak version with the flathub team.

@KuleRucket
Copy link
Contributor

KuleRucket commented Jun 1, 2023

Because systemd cannot spawn processes, there is no log.

The log goes journal for services:
journalctl --unit=sunshine --user -xb

EDIT: or what the error already said: journalctl --user -xeu sunshine.service

@istori1
Copy link
Contributor

istori1 commented Jun 1, 2023

Flathub blocks the use of --talk-name=org.freedesktop.Flatpak when building the application.

At runtime the permission can be added temporarily
flatpak run --talk-name=org.freedesktop.Flatpak --command=additional-install.sh dev.lizardbyte.app.Sunshine

Alternatively the permission can be permanently added with an override.
sudo flatpak override --talk-name=org.freedesktop.Flatpak dev.lizardbyte.app.Sunshine

@CatEricka
Copy link
Author

Closed as completed via flathub/dev.lizardbyte.app.Sunshine#9 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants