Skip to content

[Bug] workflow sandbox does not always restrict usage of urllib3 #1287

@millerick

Description

@millerick

What are you really trying to do?

We noticed that one of our services was able to use requests to send HTTP requests, while others were not. We eventually tracked it down to a difference in urllib3 between services.

Describe the bug

When urllib3==1.26.19 is installed alongside requests, workflow code is able to avoid the sandbox restrictions and send HTTP requests without the sandbox detecting and raising an exception.
Image

urllib3==2.6.2 is correctly detected by the sandbox and creates an error as expected

temporalio.worker.workflow_sandbox._restrictions.RestrictedWorkflowAccessError: Cannot access http.client.IncompleteRead.__mro_entries__ from inside a workflow. If this is code from a module not used in a workflow or known to only be used deterministically from a workflow, mark the import as pass through.

Minimal Reproduction

Clone https://github.com/millerick/temporal-sandbox-restriction-bug and follow instructions in the README.

Environment/Versions

This is what I was running for the minimal reproduction, but I assume it happens in all cases

  • OS and processor: M3 Mac
  • Temporal Version: Python SDK 1.21.1

Additional context

n/a

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