1053 mongodb runtime_error ai_generated true

Error: 1053 (ERROR_SERVICE_REQUEST_TIMEOUT) - The service did not respond to the start or control request in a timely fashion.

ID: mongodb/invalid-windows-service-name

Also available as: JSON · Markdown · 中文
78%Fix Rate
82%Confidence
1Evidence
2024-01-10First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
MongoDB 5.0 active
MongoDB 6.0 active
Windows Server 2019 active
Windows Server 2022 active

Root Cause

MongoDB on Windows failed to start as a service within the default 30-second timeout, often due to a corrupted configuration file, insufficient system resources, or a port conflict.

generic

中文

Windows 上的 MongoDB 作为服务启动时未能在默认的 30 秒超时内启动,通常是由于配置文件损坏、系统资源不足或端口冲突。

Official Documentation

https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-windows/

Workarounds

  1. 80% success Check the MongoDB log file (e.g., C:\Program Files\MongoDB\Server\6.0\log\mongod.log) for specific errors. Common fixes: ensure port 27017 is not in use with `netstat -ano | findstr :27017`, or correct the config file path in the service.
    Check the MongoDB log file (e.g., C:\Program Files\MongoDB\Server\6.0\log\mongod.log) for specific errors. Common fixes: ensure port 27017 is not in use with `netstat -ano | findstr :27017`, or correct the config file path in the service.
  2. 85% success Remove and recreate the MongoDB service with explicit parameters: `sc delete MongoDB` then `mongod.exe --config "C:\Program Files\MongoDB\Server\6.0\bin\mongod.cfg" --install --serviceName MongoDB`.
    Remove and recreate the MongoDB service with explicit parameters: `sc delete MongoDB` then `mongod.exe --config "C:\Program Files\MongoDB\Server\6.0\bin\mongod.cfg" --install --serviceName MongoDB`.
  3. 75% success Temporarily increase service start timeout via registry (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control, ServicesPipeTimeout = 60000) to allow more time for startup, then diagnose logs.
    Temporarily increase service start timeout via registry (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control, ServicesPipeTimeout = 60000) to allow more time for startup, then diagnose logs.

中文步骤

  1. 检查 MongoDB 日志文件(例如 C:\Program Files\MongoDB\Server\6.0\log\mongod.log)以获取具体错误。常见修复:使用 `netstat -ano | findstr :27017` 确保端口 27017 未被占用,或更正服务中的配置文件路径。
  2. 删除并重新创建 MongoDB 服务,使用显式参数:`sc delete MongoDB` 然后 `mongod.exe --config "C:\Program Files\MongoDB\Server\6.0\bin\mongod.cfg" --install --serviceName MongoDB`。
  3. 通过注册表临时增加服务启动超时时间(HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control, ServicesPipeTimeout = 60000)以允许更多启动时间,然后诊断日志。

Dead Ends

Common approaches that don't work:

  1. 85% fail

    The service will eventually time out again if the root issue (e.g., port conflict or corrupt config) is not addressed.

  2. 90% fail

    The same configuration file or port conflict remains, causing the same timeout.

  3. 70% fail

    This bypasses the service manager but leaves the system without automatic restart on boot, and may miss environment-specific settings.