Skip to content

Expose user friendly way to attach debugger to running Actor #1110

Closed

Description

@Pijukatel

It has been shown that it is possible to attach a debugger to an Actor running on the Apify platform and control the execution of the Actor code from a local IDE.
Here are sample Actors showing a crude way to do this: https://github.com/Pijukatel/actor-debug

The process is far from convenient. And requires:

  • A tool for creating a tunnel both on the debugging machine and the actor, for example: https://github.com/erebe/wstunnel
    • A tool needed locally
    • A tool needed within Actor Docker image
  • Local debugger setup where the developer maps the local code folder to the Actor folders
  • Injected start-up code in the Actor that waits for the debugger to connect
  • Copy-pasting the connection string from the Actor to the local machine to be able to connect

Figure out a way to make this as simple as possible so that the basic Actor creator is able to smoothly debug the Actors.

Random ideas:

  • include the tool wstunnel in each Docker image? or have a debug variant for each image?
  • Try to find if there is a Python-only package that can handle the tunnel creation and turn this into an optional dependency of Apify, Add debug to Actor.configuration and if True, the actor will automatically start in debug mode and wait for debugger attachment
  • ...

Prototype for Python and implement for JS/TS actors as well.

Security risk:
Current method prints the debugger connection to the log. If the log is shared with anyone (not the owner of the actor) while the actor run is still running, then this person can execute code in another person's actor and thus even grant access to many secrets. So we have to consider how to handle this to avoid users accidentally compromising themselves

TS/JS shortcut:
Most actors are TS/JS based, so this could be implemented as debugging in the browser that attaches to any TS/JS actor (it would not work for Python). So this could be purely an in-browser workflow with the simplest user interaction and reuse the existing browser-based debugger.

Context: https://apify.slack.com/archives/C01E7CSJ2PP/p1788245018951359

Activity

  1. added
    t-toolingIssues with this label are in the ownership of the tooling team.
    on Sep 1, 2026
  2. Pijukatel commented on Sep 21, 2026

    @Pijukatel
    ContributorAuthor

    Guide that describes the drop-in debugger and the manual tunnel approach:
    apify/apify-docs#2999

    Drop-in debugger published for both Python and JS/Ts actors:
    https://www.npmjs.com/package/actor-debugger?activeTab=readme
    https://pypi.org/project/actor-debugger/

    Closing for now until further native platform debugging support is requested.

  3. added
    documentationImprovements or additions to documentation.
    t-toolingIssues with this label are in the ownership of the tooling team.
    and removed
    t-toolingIssues with this label are in the ownership of the tooling team.
    on Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation.t-toolingIssues with this label are in the ownership of the tooling team.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions