'Pabot' error in azure pipeline: RuntimeError: Connection to remote server broken: [WinError 10061] No connection could be made because the target machine actively refused it

Hi,

The Azure pipeline what is running UI tests is getting an RuntimeErorr exception.

This exception occurred today (25-09-2025)

Error
Pabot: 5.1.0
Python: 3.12.10 (tags/v3.12.10:0cc8128, Apr 8 2025, 12:21:36) [MSC v.1943 64 bit (AMD64)]
Robot Framework: 7.3.2
Stopping PabotLib process
Could not connect to PabotLib - assuming stopped already
Total testing: 31 minutes 53.50 seconds
Traceback (most recent call last):
Elapsed time: 38 minutes 59.43 seconds
File “”, line 198, in _run_module_as_main
File “”, line 88, in _run_code
File “C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\pabot\pabot.py”, line 2343, in
main()
File “C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\pabot\pabot.py”, line 2052, in main
return sys.exit(main_program(args))
^^^^^^^^^^^^^^^^^^
File “C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\pabot\pabot.py”, line 2099, in main_program
_parallel_execute(
File “C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\pabot\pabot.py”, line 1456, in _parallel_execute
dynamic_items = _get_dynamically_created_execution_items(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\pabot\pabot.py”, line 2025, in _get_dynamically_created_execution_items
new_suites = plib.run_keyword(“get_added_suites”, , {})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\robot\libraries\Remote.py”, line 119, in run_keyword
result = RemoteResult(self._client.run_keyword(name, args, kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\robot\libraries\Remote.py”, line 280, in run_keyword
raise RuntimeError(message)
RuntimeError: Connection to remote server broken: [WinError 10061] No connection could be made because the target machine actively refused it

The running tests in Azure have the status , see the printscreen:

After one hour, (default time is one hour for the executed tasks in the Azure pipeline), the test stops

Extra info, and lib use:
Pabot vers. 5.1.0
Robotframework vers. 7.3.2
Robotframework-browser 19.8.0
Python 3.12

Info Azure pipeline:
pool:
vmImage: ‘windows-latest’

other steps i use in the Azure pipeline

steps:

  • task: UsePythonVersion@0
    inputs:
    versionSpec: ‘$(python.version)’
    architecture: x64
  • script: |
    python -m pip install --upgrade pip setuptools wheel
    displayName: ‘Upgrade pip’
  • task: NodeTool@0
    inputs:
    versionSpec: ‘20.18.0’
    checkLatest: false
    force32bit: true
    retryCountOnTaskFailure: 2
  • script: pip install robotframework robotframework-browser robotframework-keepasslibrary robotframework-otp pyotp robotframework-requests robotframework-pabot robotframework-retryfailed
    displayName: ‘Install dependencies robotframework browser lib’
  • script: rfbrowser init
    displayName: ‘Install dependencies rfbrowser init’

robot script/command:
python -m pabot.pabot --processes 3 --pabotlibport 0 --outputdir $Env:BUILD_SOURCESDIRECTORY//tests/robot/Results/Results_PROD -x outputxunit.xml --logtitle “log_legacy_prod” --loglevel TRACE TC*.robot

Reproduce path
Try to run the same command local, the test runs perfect.
‘python -m pabot.pabot --processes 3 --pabotlibport 0 --outputdir $Env:BUILD_SOURCESDIRECTORY//tests/robot/Results/Results_PROD -x outputxunit.xml --logtitle “log_legacy_prod” --loglevel TRACE TC*.robot’

Does anyone have any ideas what could be causing this.
Perhaps the Pabot server can’t connect to the Azure Agent?

Last time I ran stuff on Azure pipelines, there was 1h limit and after that running tasks where killed/stopped .. Did you rule that out ?

The task runs default one hour.

I just tested with different lib versions. Then the tests run parallel correctly

  • script: |
    pip install robotframework==7.2 robotframework-browser==18.3.0 robotframework-pabot==5.1.0 robotframework-keepasslibrary==0.5.0 robotframework-otp==1.1.0 pyotp==2.9.0 robotframework-requests==0.9.6 robotframework-retryfailed==0.2.0
    displayName: ‘Install dependencies (pinned)’

If i use this versions, from each lib the last version

  • script: pip install robotframework robotframework-browser robotframework-keepasslibrary robotframework-otp pyotp robotframework-requests robotframework-retryfailed robotframework-pabot
    displayName: ‘Install dependencies robotframework browser lib’

Than i get the ‘RuntimeError: Connection to remote server broken: [WinError 10061] No connection could be made because the target machine actively refused it’

Looking back now, I don’t think the issue has anything to do with Pabot

that error message is coming from pabot for sure but for example, at the time of writing robotframework-pabot==5.1.0 and just robotframework-pabot - they are the same version

Error message - as far as i understand - is that main pabot process cannot talk to sub process via network connection. This indicates spawned off child process that runs the subset of tests has been killed/terminated (due to timeout perhaps?) or it has crashed ..

What sort of worker are you using eg, self-hosted or microsoft hosted ? And if its MS hosted, is your repository private or public ? Cuz if its private on MS hosted, after 1h, your job is getting cancelled for sure if you have not purchased extra features/time …

Ok it is Microsoft-hosted agent where the pipeline is running

I have make also an issue in Pabot project. See:

I still have to implement the last suggestion in the comment

The task runs default one hour is due to microsoft limit rate for CI , otherwise you need to pay and set up a billing plan

and it was very unclear to me if this issue is happening when the job has ran 1 hour or what and then the comment on GH, its really hard or next to impossible to say what is the actual problem here.