Skip to content

Workers cannot connect to workpool #20750

@pro-jasonnagy

Description

@pro-jasonnagy

Bug summary

I am trying to host a work pool on a Fedora 42 host and then have a Windows workers connect to the work pool and service a deployment made on that work pool. The deployment creation works but when I run prefect worker start --pool "local-pool" to deploy my workers, I am getting an error saying that the websocket couldnt be made even though the logs indicate a websocket connection was made.

Specifically I am seeing the following

14:14:28.662 | DEBUG   | prefect.client - Connecting to API at http://192.168.71.26:4200/api/
14:14:28.664 | DEBUG   | prefect.events.clients - Reconnecting websocket connection.
14:14:28.665 | DEBUG   | prefect.events.clients - Opening websocket connection.
14:14:28.673 | DEBUG   | prefect.events.clients - Pinging to ensure websocket connected.
14:14:28.675 | DEBUG   | prefect.events.clients - Pong received. Websocket connected.
14:14:28.676 | DEBUG   | prefect.events.clients - Authenticating...
14:14:28.682 | WARNING | prefect.events.clients - Unable to connect to 'ws://192.168.71.26:4200/api/events/in'. Please check your network settings to ensure websocket connections to the API are allowed. Otherwise event data (including task run data) may be lost. Reason: Unable to authenticate to the event stream. Please ensure the provided auth_token you are using is valid for this environment. . Set PREFECT_DEBUG_MODE=1 to see the full error.

Version info

The Prefect server:

S:/$ prefect version
22:53:38.993 | DEBUG   | prefect.profiles - Using profile 'debug-testing'
Version:              3.4.25
API version:          0.8.4
Python version:       3.9.25
Git commit:           8a37e7b1
Built:                Thu, Oct 23, 2025 07:58 PM
OS/Arch:              linux/x86_64
Profile:              debug-testing
Server type:          server
Pydantic version:     2.12.5
Server:
  Database:           sqlite
  SQLite version:     3.34.1
Integrations:
  prefect-github:     0.3.2


The Windows worker:

S:\>prefect version
14:53:47.047 | DEBUG   | prefect.profiles - Using profile 'debug-testing'
Version:              3.6.16
API version:          0.8.4
Python version:       3.13.10
Git commit:           e7d587cd
Built:                Thu, Feb 05, 2026 07:37 PM
OS/Arch:              win32/AMD64
Profile:              debug-testing
Server type:          server
Pydantic version:     2.12.4
Server:
  Database:           sqlite
  SQLite version:     3.51.0
Integrations:
  prefect-github:     0.4.1

Additional context

I have a server set up with the profile given by

S:/$ prefect profile inspect
22:49:08.962 | DEBUG   | prefect.profiles - Using profile 'debug-testing'
No name provided, defaulting to 'debug-testing'
PREFECT_SERVER_ALLOW_EPHEMERAL_MODE='true'
PREFECT_API_URL='http://0.0.0.0:4200/api'
PREFECT_RESULTS_PERSIST_BY_DEFAULT='true'
PREFECT_LOGGING_LEVEL='DEBUG'

And my code is hosted on a private github repo, so I am creating my deployment with the following:

from prefect import flow, task
...
if __name__ == "__main__":
    github_repo = GitRepository(
        url="https://github.com/user/repo",
        credentials=GitHubCredentials.load("token"),
    )

    flow.from_source(
        source=github_repo,
        entrypoint="src/workflows/flows/file.py:my_flow",
    ).deploy(
        name="my_flow",
        work_pool_name="local-pool",
    )

and the token is made in advance with the following, where TOKEN is a fine-grained token from Github with all required permissions.

github_credentials_block = GitHubCredentials(token=TOKEN)
github_credentials_block.save(name="token", overwrite=True)

All of the above allows the prefect server to successfuly create a deployment and make it available through the web GUI.

For my windows workers, I have a simple profile given by

(prefect) S:\>prefect profile inspect
14:48:08.581 | DEBUG   | prefect.profiles - Using profile 'debug-testing'
No name provided, defaulting to 'debug-testing'
PREFECT_API_URL='http://192.168.71.26:4200/api'
PREFECT_LOGGING_LEVEL='DEBUG'

And I am simply running prefect worker start --pool "local-pool" to start the worker and make it service the work pool but it fails to start with this log.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions