Sunshine error 503 in Moonlight: the three causes and how to fix each
Short answer: Sunshine sends a 503 in three situations: it couldn’t start video capture or encoding, there are too many unfinished pairing attempts, or Moonlight asked to resume a session that no longer exists. The message that comes with the code tells you which one. The most common is “Failed to initialize video capture/encoding. Is a display connected and turned on?”
Checked October 30, 2026 against Moonlight PC v6.2.0 and Sunshine v2026.914.233613 (latest stable releases) and their documentation. Sources are listed at the end of the page.
The three messages behind a 503
We read Sunshine’s request handler (src/nvhttp.cpp on the master branch) to see exactly when it returns 503. There are three cases:
| Message | When it happens | First thing to try |
|---|---|---|
| Failed to initialize video capture/encoding. Is a display connected and turned on? | When you launch or resume a stream. Sunshine sets up the display, then re-checks the encoders, and this check failed. | Make sure the host has an active display and a working GPU encoder. |
| Too many pending pairing sessions | When you start pairing while too many earlier attempts are still open. | Finish or cancel the pairing attempts, or wait a few minutes. |
| No running app to resume | Moonlight asked to resume, but nothing is running on the host. | Start the app again from Moonlight instead of resuming it. |
Cause 1: video capture or encoding failed
This is the one most people see. Sunshine prepares the display before it checks the encoders, because the active GPU can change after a hot-plug, a driver crash or a new primary monitor. If no working display and encoder pair is found, it gives up with a 503.
- Give it a display. The host monitor needs to be connected and on, or use a dummy plug or a virtual display. On Windows, setting
dd_configuration_optiontoensure_activelets Sunshine activate an inactive display. - Check
output_name. If it points at a display that isn’t there any more, capture fails. Look at the list of detected displays in the Sunshine log and pick one that is connected, or clear the setting to use the default. - Windows with two GPUs: Desktop Duplication only captures from the GPU driving the display, so the display must be connected to the GPU you want to encode on.
- Linux with XDG Portal capture: a stale or rejected permission token can stop capture at startup. In one closed Sunshine issue (#5673), the log said “Unable to find display or encoder during startup” and deleting the saved
portal_tokenfile fixed it. Sunshine’s docs describe a Troubleshooting → Reset XDG Portal Capture button in the web UI that deletes the saved token and restarts Sunshine so you can approve the prompt again. If the token is stale, current versions try a fallback capture method so you can answer the prompt. - Linux with VA-API: if the log shows
Could not open codec [h264_vaapi]: Function not implemented, your Mesa build has hardware encoding turned off. Sunshine’s docs explain how to re-enable it.
Cause 2: too many pending pairing sessions
In the current source, Sunshine keeps up to 32 unfinished pairing sessions, and each one expires after 5 minutes (src/nvhttp.h). If you keep retrying pairing without entering the PIN, you can hit the limit. Enter the PIN on the Sunshine web UI’s PIN page (https://localhost:47990 on the host), cancel the other attempts, or wait a few minutes and try once.
Cause 3: no running app to resume
Moonlight thinks a session is still running, but the host has already closed it, for example after a reboot or after the game exited. Go back to the app list and start the app fresh rather than resuming.
FAQ
Does error 503 mean my network is broken?
No. Sunshine answered the request, so the client reached the host. A 503 means Sunshine couldn’t do what was asked: start capture, start another pairing, or resume a session.
I get 503 only when my PC monitor is off. What can I do?
Sunshine can’t capture a display that is off. Leave the monitor on, use an HDMI dummy plug, use a virtual display, or on Windows set dd_configuration_option to ensure_active so Sunshine activates the display.
Where do I see which 503 message I got?
The message comes back with the error, and Sunshine’s log shows what failed. The log also lists the displays and encoders Sunshine detected, which helps with the capture/encoding case.
Sources
- Sunshine source code: src/nvhttp.cpp (Sunshine source, master branch)
- Sunshine source code: src/nvhttp.h (Sunshine source, master branch)
- Sunshine docs: Configuration (official Sunshine docs)
- Sunshine docs: Getting Started (official Sunshine docs)
- Sunshine docs: Troubleshooting (official Sunshine docs)
- Sunshine issue #5673: Unable to find display or encoder during startup (GitHub issue, closed)
- Moonlight wiki: Setup Guide (official Moonlight docs)