Sunshine icon indicating copy to clipboard operation
Sunshine copied to clipboard

sunshine.exe retries every 3 seconds while sunshinesvc.exe runs in the background

Open GustafXTT opened this issue 10 months ago • 21 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

Is your issue described in the documentation?

  • [x] I have read the documentation

Is your issue present in the latest beta/pre-release?

This issue is present in the latest pre-release

Describe the Bug

Sunshine failed to start while executing sunshine.exe. Failed to open WebUI. A sunshinesvc.exe is running in the background, which contains a Sunshine Service. A sunshine.exe keeps trying to start and fails every 3 seconds in the background.

Expected Behavior

No response

Additional Context

No response

Host Operating System

Windows

Operating System Version

24H2 26100.2894

Architecture

amd64/x86_64

Sunshine commit or version

v2025.122.24544

Package

Windows - installer (recommended)

GPU Type

NVIDIA

GPU Model

RTX 3070 Mobile

GPU Driver/Mesa Version

561.09

Capture Method

None

Config

<EMPTY>

Apps


Relevant log output

./sunshine.exe
[2025-01-22 15:44:35.828]: Info: Sunshine version: v2025.122.24544
[2025-01-22 15:44:35.828]: Info: Package Publisher: LizardByte
[2025-01-22 15:44:35.828]: Info: Publisher Website: https://app.lizardbyte.dev
[2025-01-22 15:44:35.828]: Info: Get support: https://app.lizardbyte.dev/support
[2025-01-22 15:44:35.829]: Info: Provided workaround settings for SettingsManager:
{
  "hdr_blank_delay": null
}
[2025-01-22 15:44:35.832]: Info: Currently available display devices:
[
  {
    "device_id": "{97a2cf0b-92a9-53c9-991c-279f8bf5e790}",
    "display_name": "\\\\.\\DISPLAY1",
    "friendly_name": "VX2758-2K-PRO",
    "info": {
      "hdr_state": "Enabled",
      "origin_point": {
        "x": 0,
        "y": 0
      },
      "primary": true,
      "refresh_rate": {
        "type": "rational",
        "value": {
          "denominator": 1000,
          "numerator": 184999
        }
      },
      "resolution": {
        "height": 1440,
        "width": 2560
      },
      "resolution_scale": {
        "type": "rational",
        "value": {
          "denominator": 100,
          "numerator": 100
        }
      }
    }
  }
]
[2025-01-22 15:44:36.073]: Info: nvprefs: No need to modify application profile settings
[2025-01-22 15:44:36.073]: Info: nvprefs: Changed OGL_CPL_PREFER_DXPRESENT to OGL_CPL_PREFER_DXPRESENT_PREFER_ENABLED for base profile
[2025-01-22 15:44:36.121]: Info: Compiling shaders...
[2025-01-22 15:44:36.142]: Info: System tray created
[2025-01-22 15:44:36.221]: Info: Compiled shaders
[2025-01-22 15:44:36.234]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2025-01-22 15:44:36.234]: Info: Trying encoder [nvenc]
[2025-01-22 15:44:36.567]: Info:
Device Description : NVIDIA GeForce RTX 3070 Laptop GPU
Device Vendor ID   : 0x000010DE
Device Device ID   : 0x0000249D
Device Video Mem   : 8020 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 8138 MiB
Feature Level      : 0x0000B100
Capture size       : 2560x1440
Offset             : 0x0
Virtual Desktop    : 2560x1440
[2025-01-22 15:44:36.568]: Info: Active GPU has HAGS enabled
[2025-01-22 15:44:36.568]: Info: Using realtime GPU priority
[2025-01-22 15:44:36.568]: Info:
Colorspace         : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color     : 10
Red Primary        : [0.660156,0.326172]
Green Primary      : [0.275391,0.644531]
Blue Primary       : [0.145508,0.0556641]
White Point        : [0.3125,0.329102]
Min Luminance      : 0.4184 nits
Max Luminance      : 436.208 nits
Max Full Luminance : 436.208 nits
[2025-01-22 15:44:36.571]: Info: Desktop resolution [2560x1440]
[2025-01-22 15:44:36.571]: Info: Desktop format [DXGI_FORMAT_R16G16B16A16_FLOAT]
[2025-01-22 15:44:36.571]: Info: Display refresh rate [184.999Hz]
[2025-01-22 15:44:36.571]: Info: Requested frame rate [60fps]
[2025-01-22 15:44:36.571]: Info: Creating encoder [h264_nvenc]
[2025-01-22 15:44:36.571]: Info: Color coding: SDR (Rec. 601)
[2025-01-22 15:44:36.571]: Info: Color depth: 8-bit
[2025-01-22 15:44:36.572]: Info: Color range: JPEG
[2025-01-22 15:44:36.624]: Info: NvEnc: created encoder H.264 P1 two-pass rfi
[2025-01-22 15:44:36.654]: Info: Creating encoder [hevc_nvenc]
[2025-01-22 15:44:36.655]: Info: Color coding: SDR (Rec. 601)
[2025-01-22 15:44:36.655]: Info: Color depth: 8-bit
[2025-01-22 15:44:36.655]: Info: Color range: JPEG
[2025-01-22 15:44:36.706]: Info: NvEnc: created encoder HEVC P1 two-pass rfi
[2025-01-22 15:44:36.737]: Info: Creating encoder [av1_nvenc]
[2025-01-22 15:44:36.737]: Info: Color coding: SDR (Rec. 601)
[2025-01-22 15:44:36.737]: Info: Color depth: 8-bit
[2025-01-22 15:44:36.737]: Info: Color range: JPEG
[2025-01-22 15:44:36.761]: Error: NvEnc: encoding format is not supported by the gpu
[2025-01-22 15:44:36.770]: Info: Creating encoder [h264_nvenc]
[2025-01-22 15:44:36.770]: Info: Color coding: SDR (Rec. 601)
[2025-01-22 15:44:36.770]: Info: Color depth: 8-bit
[2025-01-22 15:44:36.770]: Info: Color range: JPEG
[2025-01-22 15:44:36.824]: Info: NvEnc: created encoder H.264 P1 yuv444 two-pass rfi
[2025-01-22 15:44:37.059]: Info:
Device Description : NVIDIA GeForce RTX 3070 Laptop GPU
Device Vendor ID   : 0x000010DE
Device Device ID   : 0x0000249D
Device Video Mem   : 8020 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 8138 MiB
Feature Level      : 0x0000B100
Capture size       : 2560x1440
Offset             : 0x0
Virtual Desktop    : 2560x1440
[2025-01-22 15:44:37.059]: Info: Active GPU has HAGS enabled
[2025-01-22 15:44:37.059]: Info: Using realtime GPU priority
[2025-01-22 15:44:37.059]: Info:
Colorspace         : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color     : 10
Red Primary        : [0.660156,0.326172]
Green Primary      : [0.275391,0.644531]
Blue Primary       : [0.145508,0.0556641]
White Point        : [0.3125,0.329102]
Min Luminance      : 0.4184 nits
Max Luminance      : 436.208 nits
Max Full Luminance : 436.208 nits
[2025-01-22 15:44:37.061]: Info: Desktop resolution [2560x1440]
[2025-01-22 15:44:37.062]: Info: Desktop format [DXGI_FORMAT_R16G16B16A16_FLOAT]
[2025-01-22 15:44:37.062]: Info: Display refresh rate [184.999Hz]
[2025-01-22 15:44:37.062]: Info: Requested frame rate [60fps]
[2025-01-22 15:44:37.062]: Info: Creating encoder [hevc_nvenc]
[2025-01-22 15:44:37.062]: Info: Color coding: SDR (Rec. 709)
[2025-01-22 15:44:37.062]: Info: Color depth: 10-bit
[2025-01-22 15:44:37.062]: Info: Color range: JPEG
[2025-01-22 15:44:37.199]: Info: NvEnc: created encoder HEVC P1 yuv444 10-bit two-pass rfi
[2025-01-22 15:44:37.257]: Info:
[2025-01-22 15:44:37.257]: Info: // Ignore any errors mentioned above, they are not relevant. //
[2025-01-22 15:44:37.257]: Info:
[2025-01-22 15:44:37.257]: Info: Found H.264 encoder: h264_nvenc [nvenc]
[2025-01-22 15:44:37.257]: Info: Found HEVC encoder: hevc_nvenc [nvenc]
[2025-01-22 15:44:37.257]: Info: Open the Web UI to set your new username and password and getting started
[2025-01-22 15:44:37.257]: Fatal: Couldn't bind RTSP server to port [48010], 以一种访问权 限不允许的方式做了一个访问套接字的尝试。(Translation: An attempt was made to access a socket in a way that the access permissions do not allow.)
[2025-01-22 15:44:37.258]: Info: File C:\Program Files\Sunshine\config\sunshine_state.json doesn't exist
terminate called recursively
terminate called after throwing an instance of 'boost::wrapexcept<boost::system::system_error>

GustafXTT avatar Jan 22 '25 05:01 GustafXTT

If the service is running, you shouldn't run sunshine manually

ReenigneArcher avatar Jan 22 '25 13:01 ReenigneArcher

Pardon me if I didn't make it clear, the service was not running before I manually executed Sunshine.

A sunshinesvc.exe is running in the background, which contains a Sunshine Service. A sunshine.exe keeps trying to start and fails every 3 seconds in the background.

It means the situation after I tried to run Sunshine.

GustafXTT avatar Jan 22 '25 13:01 GustafXTT

Something is using a port that Sunshine needs, maybe you have multiple instances running?

I would just restart your computer.

ReenigneArcher avatar Jan 22 '25 13:01 ReenigneArcher

A reboot didn't fix the problem.

GustafXTT avatar Jan 22 '25 14:01 GustafXTT

Just did some tests and found no process using port 47990, maybe it's not a port conflict issue.

GustafXTT avatar Jan 22 '25 14:01 GustafXTT

The logs indicate something else is using a different port.

[2025-01-22 15:44:37.257]: Fatal: Couldn't bind RTSP server to port [48010]

ReenigneArcher avatar Jan 22 '25 14:01 ReenigneArcher

The information after this log, which I provided a translation before:

An attempt was made to access a socket in a way that the access permissions do not allow.

Could it be a permission issue? If not then I have no idea :(

GustafXTT avatar Jan 22 '25 14:01 GustafXTT

Could it be a permission issue?

Yes, I think there are also other permission issues.

[2025-01-22 15:44:37.258]: Info: File C:\Program Files\Sunshine\config\sunshine_state.json doesn't exist
terminate called recursively
terminate called after throwing an instance of 'boost::wrapexcept<boost::system::system_error>

Running Sunshine as a service should prevent permission issues like this though, since it runs as the SYSTEM account.

ReenigneArcher avatar Jan 22 '25 14:01 ReenigneArcher

Trying to solve the permission issue: Give both sunshinesvc.exe and sunshine.exe administration permission was not working. Reinstalling an old 0.20.0 version / latest beta version of Sunshine was not working either. Manually running the exe file & Starting the SunshineService from the task manager's services panel were working neither.

GustafXTT avatar Jan 22 '25 14:01 GustafXTT

Adding that I'm experiencing the same issue. Sunshine service is running and the application keeps trying to start. I have already searched for anything using the 48010 port and found nothing. (Both netstat -ano | findstr :48010 as well as Get-Process -Id (Get-NetTCPConnection -LocalPort 48010).OwningProcess)

My log ends slightly differently though:

[2025-01-24 11:34:02.760]: Info: Open the Web UI to set your new username and password and getting started [2025-01-24 11:34:02.760]: Fatal: Couldn't bind RTSP server to port [48010], An attempt was made to access a socket in a way forbidden by its access permissions [2025-01-24 11:34:02.760]: Info: File C:\Program Files\Sunshine\config\sunshine_state.json doesn't exist [2025-01-24 11:34:02.871]: Info: nvprefs: Restored OGL_CPL_PREFER_DXPRESENT for base profile [2025-01-24 11:34:03.541]: Info: Registered Sunshine mDNS service [2025-01-24 11:34:03.541]: Info: Unregistered Sunshine mDNS service

jvvilar avatar Jan 24 '25 10:01 jvvilar

I encountered the same problem. My computer has Hyper-V enabled.

X3ZvaWQ avatar Jan 27 '25 18:01 X3ZvaWQ

Same issue here, I also get

Fatal: Couldn't bind RTSP server to port [48010], An attempt was made to access a socket in a way forbidden by its access permissions
[2025-01-30 09:53:53.277]: Info: File C:\Program Files\Sunshine\config\sunshine_state.json doesn't exist

LouKordos avatar Jan 30 '25 08:01 LouKordos

I also encountered the same issue.

After executing netstat -ano | findstr "48010", I found no processes using the port, so a port conflict is unlikely to be the cause.

However, I confirmed that specifying an arbitrary port, such as port = 50000 in sunshine.conf, resolves the issue.

Additionally, the problem seemed to occur after installing KB5050094, so it might be related.

Lapis256 avatar Jan 31 '25 17:01 Lapis256

However, I confirmed that specifying an arbitrary port, such as port = 50000 in sunshine.conf, resolves the issue.

It does fix the problem for now, thanks.

Additionally, the problem seemed to occur after installing KB5050094, so it might be related.

I reckon the problem can occur before KB5050094 since I have not installed it yet.

GustafXTT avatar Jan 31 '25 20:01 GustafXTT

Because the SW is retires every 3 Seconds, the old Socket may not be clear yet. Most likely you need to set ENET_SOCKOPT_REUSEADDR, so it can re-use the socket

So it will look something like;

  //Set Sockopt reuseaddr, so if the SW does a retry,  it can reuse the socket address
   if (enet_socket_set_option(host->socket, ENET_SOCKOPT_REUSEADDR, 1) < 0)
    {
        std::cerr << "Failed to set socket option for address reuse.\n";
        enet_host_destroy(host);
        return 1;
    }

Smarter-Mind avatar Feb 03 '25 07:02 Smarter-Mind

I also encountered the same issue.

After executing netstat -ano | findstr "48010", I found no processes using the port, so a port conflict is unlikely to be the cause.

However, I confirmed that specifying an arbitrary port, such as port = 50000 in sunshine.conf, resolves the issue.

Additionally, the problem seemed to occur after installing KB5050094, so it might be related.

This fix works, and a system restart also temporarily resolves the issue, but only for a while. The problem eventually comes back, and since the port doesn't appear to be in use, I still haven't been able to pinpoint the actual cause.

pinguluk avatar Apr 14 '25 20:04 pinguluk

It seems this issue hasn't had any activity in the past 90 days. If it's still something you'd like addressed, please let us know by leaving a comment. Otherwise, to help keep our backlog tidy, we'll be closing this issue in 10 days. Thanks!

LizardByte-bot avatar Jul 14 '25 10:07 LizardByte-bot

This issue was closed because it has been stalled for 10 days with no activity.

LizardByte-bot avatar Jul 24 '25 10:07 LizardByte-bot

Also having that problem. Windows installed an Update a few Days ago, i think since then i get this restarting behaivior. Checked with netstat: Nothing occupies this port.

But i still get the Fatal: Couldn't bind RTSP server to port [48010], An attempt was made to access a socket in a way forbi...-Error Message.

Vaskyy avatar Aug 21 '25 16:08 Vaskyy

Also having that problem. Windows installed an Update a few Days ago, i think since then i get this restarting behaivior. Checked with netstat: Nothing occupies this port.

But i still get the Fatal: Couldn't bind RTSP server to port [48010], An attempt was made to access a socket in a way forbi...-Error Message.

After that post, the whole day it was restarting, so i killed it. Next day i didnt see any restarts. I guess Windows Update fixed it?

Vaskyy avatar Aug 25 '25 07:08 Vaskyy

Also having that problem. Windows installed an Update a few Days ago, i think since then i get this restarting behaivior. Checked with netstat: Nothing occupies this port. But i still get the Fatal: Couldn't bind RTSP server to port [48010], An attempt was made to access a socket in a way forbi...-Error Message.

After that post, the whole day it was restarting, so i killed it. Next day i didnt see any restarts. I guess Windows Update fixed it?

A PC restart fixes the issue. I also mentioned a workaround by changing the port

pinguluk avatar Aug 25 '25 07:08 pinguluk

It seems this issue hasn't had any activity in the past 90 days. If it's still something you'd like addressed, please let us know by leaving a comment. Otherwise, to help keep our backlog tidy, we'll be closing this issue in 10 days. Thanks!

LizardByte-bot avatar Nov 23 '25 10:11 LizardByte-bot