Skip to content

Unable to retrieve screenshot when local remote proxy is configured #1316

Description

@hurali97

Environment

Local Remote Proxy

Description

When using remote proxy on local, agent-device errors out when pulling the screenshot on the calling device. I have configured local proxy with ngrok on mac A and on mac B I am doing the following steps:

agent-device connect --remote-config ./remote.json
agent-device open com.android.chrome --platform android
agent-device screenshot ./screen.png --debug --remote-config ./remote.json

With the agent-device screenshot command I see this error:

{
  "artifactId": "e17d026c-6f51-478a-a6b8-ca39bd5b8e88",
  "statusCode": 401,
  "requestId": "5b3733205b427e69",
  "body": "{\"ok\":false,\"error\":\"Artifact belongs to a different tenant\",\"code\":\"UNAUTHORIZED\"}"
}

I have tried clearing out all the temp folders in ~/.agent-device on both mac A and B. Also tried only passing the daemonBaseUrl and daemonAuthToken to the connect command without any tenant, runId, etc.

Note: This issue only happens with local remote proxy. With agent device cloud, the exact steps work fine.

Reproducible Demo

From Mac A:

agent-device proxy --port 4310 --host 0.0.0.0

Save the token printed and use for calling on mac B.

Expose the url using tunnel:

ngrok http 4310

Save the Forwarding URL and use for calling on mac B.

From Mac B:

Populate remote.json with above token and URL:

  "daemonBaseUrl": "your_tunnel_url",
  "daemonAuthToken": "your_token_from_agent_device_proxy_command",
  "daemonTransport": "http",
  "tenant": "test-tenant",
  "runId": "demo-run-001",
  "sessionIsolation": "tenant"

Run the following commands:

agent-device connect --remote-config ./remote.json
agent-device open com.android.chrome --platform android
agent-device screenshot ./screen.png --debug --remote-config ./remote.json // Error here

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions