2

I'm setting up a BuildBot worker in a Windows Server 2016 Datacenter Edition VM running on Azure. This is going build our product for Windows, using the Visual Studio C++ compiler.

I've got to the point where the worker is installed and running in an administrative desktop session. It connects to our build master server, and seems to be able to access all of the tools and services it needs to, based on the results of test builds.

I have been working on getting the worker to run as a service. This will make it possible to automatically run the worker as an unprivileged user.

Except... the service doesn't start. When I look in the Event Log I see two errors in 'Windows Logs → System':

  • Event ID: 7000

    The BuildBot service failed to start due to the following error: The service did not respond to the start or control request in a timely fashion.

  • Event ID: 7009

    A timeout was reached (30000 milliseconds) while waiting for the BuildBot service to connect

There are no events from BuildBot itself logged in 'Windows Logs → Application', and these events are logged (and the service is reported as failed) immediately on trying to start it.

Currently, the service is set to run as 'LocalSystem' (I was planning to clamp down on permissions later). As I understand it, 'LocalSystem' is supposed to have access to all local resources, so I don't think that filesystem permissions are likely to be causing this problem.

  • Are there any commonly-encountered reasons for services to fail like this?

  • Are there any other logs or diagnostic information that I should be looking at?

  • What other steps could I take to determine what's causing this failure?

Edit: This issue is reproducible even using the simple test service provided in this Stack Overflow answer.

1 Answers1

3

The problem turned out to be unregistered DLLs. Specifically, the Python service support provided by pywin32 requires specific DLLs to be available for interaction with the win32 API. These DLLs are supposed to be installed automatically when installing pywin32 with:

pip install pypiwin32

As mentioned in this Stack Overflow answer, the correct fix in this case was to run:

python C:\Python27\Scripts\pywin32_postinstall.py install

This resolved my problem.

  • 2
    Thanks a lot, this solved my hopeless attempts to get the buildbot worker running. It should be `-install` though. (`python.exe 'C:\Program Files\Python\Python38\Scripts\pywin32-postinstall.py' -install` in my case) – Mojca Aug 21 '20 at 20:28