New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 846336 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Swarming's auth.py fails cryptically if CHROME_HEADLESS is set

Project Member Reported by jam@chromium.org, May 24 2018

Issue description

I have a task that I'm trying to repro locally: https://chromium-swarm.appspot.com/task?id=3da8c0ba1129a510&refresh=10&show_raw=1

I get this error
E:\src\chrome2\src>python tools\swarming_client\swarming.py reproduce -S chromium-swarm.appspot.com 3da8c0ba1129a510
12648 2018-05-24 14:29:56.411 E: Request to https://chromium-swarm.appspot.com/api/swarming/v1/task/3da8c0ba1129a510/request failed with HTT
P status code 403: 403 Client Error: Forbidden for url: https://chromium-swarm.appspot.com/api/swarming/v1/task/3da8c0ba1129a510/request - A
ccess is denied.
Failed to retrieve request data for the task



I tried re-logging in
E:\src\chrome2\src>python tools/swarming_client/auth.py login --service=https://isolateserver.appspot.com  
Login failed or canceled.


but that failed



I can trigger my own jobs.
 

Comment 1 by mar...@chromium.org, May 24 2018

Cc: s...@google.com
+ smut who did refactoring in API handlers.
> Login failed or canceled.

That doesn't look right... Can you run 'auth.py login' with '-v -v' flags to get more logging?

To fix:
1. Try to logout first using "auth.py logout --service=https://isolateserver.appspot.com". Then login again.
2. If it doesn't help, try "auth.py login --auth-no-local-webserver --service=https://isolateserver.appspot.com" (maybe there are issues with opening the browser on Windows).

Comment 3 by jam@chromium.org, May 24 2018

E:\src\chrome2\src>python tools/swarming_client/auth.py login --service=https://chromium-swarm.appspot.com -v -v
Login failed or canceled.

E:\src\chrome2\src>python tools/swarming_client/auth.py login -v -v --service=https://chromium-swarm.appspot.com
Login failed or canceled.



E:\src\chrome2\src>python tools/swarming_client/auth.py logout --service=https://isolateserver.appspot.com

E:\src\chrome2\src>python tools/swarming_client/auth.py login --service=https://isolateserver.appspot.com
Login failed or canceled.

E:\src\chrome2\src>python tools/swarming_client/auth.py login --auth-no-local-webserver --service=https://isolateserver.appspot.com
Login failed or canceled.
Hm, it doesn't even attempt to do anything. 

Do you happen to have any of the following env vars set:
  CHROME_HEADLESS
  SWARMING_HEADLESS
  SWARMING_AUTH_SERVICE_ACCOUNT_JSON
  LUCI_CONTEXT
?

Comment 5 by jam@chromium.org, May 24 2018

Yes, I do have
CHROME_HEADLESS=1
because I was trying to be similar to a bot when I run tests.

Removing that now fixes things, thanks.

Can these scripts print an error if they're not working due to these variables beings set?
Owner: vadimsh@chromium.org
Status: Assigned (was: Unconfirmed)
Summary: Swarming's auth.py fails cryptically if CHROME_HEADLESS is set (was: Can't reproduce swarming jobs locally)
I'll add something to auth.py. 

The rest of the script are actually used on bots, where changing behavior on presence of CHROME_HEADLESS is intended, so printing errors there would be incorrect.
Cc: smut@chromium.org
Cc: -s...@google.com

Sign in to add a comment