vectordotdev / vectordotdev/vector
Windows service stuck in START_PENDING forever when Vector fails to start
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 22.6k
- Forks
- 2.3k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 146
Description
A note for the community
I have a fix for this and will submit a PR.
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Problem
When Vector runs as a Windows service and startup fails (for example an invalid
configuration file), the service never reports any status to the Service
Control Manager and is left stuck in START_PENDING indefinitely:
sc query vectorreportsSTART_PENDINGand never transitions; the
vector.exeprocess remains running.- The service is
NOT_STOPPABLEin this state, sosc stopcannot clear it;
recovery required setting the service to disabled and terminating the
process by hand. - No SCM error event (7000/7024/7031) is written to the System event log, so
nothing indicates the service failed. - Configured recovery actions (
sc failure/ Services -> Recovery) never run,
because the SCM never observes a failure.
Observed state with the stock v0.56.0 release binary and a config that fails
to load (unchanged after many minutes):
SERVICE_NAME: vector
TYPE : 10 WIN32_OWN_PROCESS
STATE : 2 START_PENDING
(NOT_STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x7d0
Root cause: in run_service (src/vector_windows.rs), the failure arm of the
Application::prepare_start match returns Ok(()) without registering a
service control handler or calling set_service_status at all:
https://github.com/vectordotdev/vector/blob/v0.56.0/src/vector_windows.rs#L384-L440
(see the _ => Ok(()) arm at line 439; the Err(exit_code) from
prepare_start is discarded)
The success path correctly reports Running and later Stopped, so this only
affects startup failures. By contrast, running the same broken configuration
from a console correctly exits with code 78 (config error).
Expected behavior: on startup failure the service should register a control
handler and report SERVICE_STOPPED with a nonzero exit code
(e.g. ServiceExitCode::ServiceSpecific(exit_code)), so sc query reflects
the failure, the SCM logs event 7024, and service recovery can act on it.
Reproduction (elevated PowerShell):
- Register Vector as a service pointing at a config that fails to load
(e.g. appendbroken: [to a workingvector.yaml). sc start vectorsc query vector->START_PENDING, forever (output above).
Configuration
(any broken config file when you start the windows service triggers this issue)
Version
vector 0.56.0 (x86_64-pc-windows-msvc 7923556 2026-05-02 05:50:46.918905925)
Debug Output
Not applicable: the failure is in Windows service status reporting, so there is
no console output in service context. Console mode with the same config exits
with code 78 after printing the config error.
Example Data
No response
Additional Context
Vector is registered as a Windows service (OWN_PROCESS) via the built-in service entry point from #2896.
Without a fix, an invalid vector config can leave the Windows service in a state where it can't be stopped or restarted without forcible intervention (terminating the process via task manager).
References
- #2896
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/vector_windows.rs at run_service and inspect the failure arm of Application::prepare_start. Verify the Windows service reports SERVICE_STOPPED with a nonzero exit code when configuration loading fails, rather than remaining in START_PENDING; confirm the behavior with the broken-configuration reproduction described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100