Issues running gclient sync ("[Errno 2] No such file or directory" running gsutil)

1,672 views
Skip to first unread message

dan...@google.com

unread,
Apr 23, 2018, 11:04:38 AM4/23/18
to Chromium-dev
I don't know if this is the correct place to post about depot_tools, but I've been having issues setting the Dart SDK up (I've have the same issues on three machines, a windows PC, a personal MacBook and a Google corp MacBook). When I fun something like fetch dart or gclient sync I get the following error:

Syncing projects: 100% (84/84), done.                                     
Traceback (most recent call last):
  File "/Users/dantup/Dev/Google/depot_tools/gclient.py", line 3105, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/Users/dantup/Dev/Google/depot_tools/gclient.py", line 3091, in main
    return dispatcher.execute(OptionParser(), argv)
  File "/Users/dantup/Dev/Google/depot_tools/subcommand.py", line 252, in execute
    return command(parser, args[1:])
  File "/Users/dantup/Dev/Google/depot_tools/gclient.py", line 2783, in CMDsync
    ret = client.RunOnDeps('update', args)
  File "/Users/dantup/Dev/Google/depot_tools/gclient.py", line 1691, in RunOnDeps
    self.RunHooksRecursively(self._options, pm)
  File "/Users/dantup/Dev/Google/depot_tools/gclient.py", line 1155, in RunHooksRecursively
    hook.run(self.root.root_dir)
  File "/Users/dantup/Dev/Google/depot_tools/gclient.py", line 229, in run
    cmd, cwd=cwd, always=self._verbose)
  File "/Users/dantup/Dev/Google/depot_tools/gclient_utils.py", line 314, in CheckCallAndFilterAndHeader
    return CheckCallAndFilter(args, **kwargs)
  File "/Users/dantup/Dev/Google/depot_tools/gclient_utils.py", line 525, in CheckCallAndFilter
    **kwargs)
  File "/Users/dantup/Dev/Google/depot_tools/subprocess2.py", line 262, in __init__
    % (str(e), kwargs.get('cwd'), args[0]))
OSError: Execution failed with error: [Errno 2] No such file or directory.
Check that /Users/dantup/Dev/Google/dart-sdk or download_from_google_storage exist and have execution permission.
Traceback (most recent call last):
  File "/Users/dantup/Dev/Google/depot_tools/fetch.py", line 306, in <module>
    sys.exit(main())
  File "/Users/dantup/Dev/Google/depot_tools/fetch.py", line 301, in main
    return run(options, spec, root)
  File "/Users/dantup/Dev/Google/depot_tools/fetch.py", line 295, in run
    return checkout.init()
  File "/Users/dantup/Dev/Google/depot_tools/fetch.py", line 137, in init
    self.run_gclient(*sync_cmd)
  File "/Users/dantup/Dev/Google/depot_tools/fetch.py", line 82, in run_gclient
    return self.run(cmd_prefix + cmd, **kwargs)
  File "/Users/dantup/Dev/Google/depot_tools/fetch.py", line 71, in run
    subprocess.check_call(cmd, **kwargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '('/usr/bin/python', '/Users/dantup/Dev/Google/depot_tools/gclient.py', 'sync')' returned non-zero exit status 1

I executed the command it was calling manually and got the same issue, so I stepped down and ended getting to this command:

vpython /Users/dantup/Dev/Google/depot_tools/gsutil.py --force-version 4.28 version

If I run that come a terminal, I get:

Traceback (most recent call last):
  File "/Users/dantup/Dev/Google/depot_tools/gsutil.py", line 183, in <module>
    sys.exit(main())
  File "/Users/dantup/Dev/Google/depot_tools/gsutil.py", line 180, in main
    clean=args.clean)
  File "/Users/dantup/Dev/Google/depot_tools/gsutil.py", line 153, in run_gsutil
    return subprocess.call(cmd, shell=IS_WINDOWS)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 522, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

The command it's trying to run is:

vpython -vpython-spec /Users/dantup/Dev/Google/depot_tools/gsutil.vpython -- /Users/dantup/Dev/Google/depot_tools/external_bin/gsutil/gsutil_4.28/gsutil/gsutil -o GSUtil:software_update_check_period=0 version

Which if I run manually, works fine:

gsutil version: 4.28

So I'm a bit lost. vpython is on my path (as you can tell from the above command working), from `depot_tools`. I'm not sure why the gsutil.py wrapper is failing to run it or how I can debug (or why it's only affecting me). Any suggestions on how to debug would be appreciated (I'm not very familiar with Python!).

Ryan Tseng

unread,
Apr 23, 2018, 5:21:12 PM4/23/18
to dan...@google.com, Chromium-dev
It looks like for whatever reason, you are missing depot_tools/external_bin/gsutil/gsutil_4.28.  Can you check to see whats in that directory?

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/18c2a1ea-0f43-4fd8-9b1a-2a2be25a91be%40chromium.org.

dan...@google.com

unread,
Apr 24, 2018, 11:29:35 AM4/24/18
to Chromium-dev, dan...@google.com
Ugh, I fixed it - and it seems really simple now. When I pasted my path in the previous email it occurred to me... The tildes in the paths aren't being resolved when running commands in Python, so it really wasn't finding vpython. Updating my paths to have /Users/dantup/ instead has solved the issue. That'll explain it on both MacBooks - not so sure about Windows, but I'll dig more into that next time I need to work on it there.

Sorry for the bother! :-)

dan...@google.com

unread,
Apr 24, 2018, 11:29:35 AM4/24/18
to Chromium-dev, dan...@google.com
On Monday, 23 April 2018 22:21:12 UTC+1, Ryan Tseng wrote:
It looks like for whatever reason, you are missing depot_tools/external_bin/gsutil/gsutil_4.28.  Can you check to see whats in that directory?

That directory seems complete. I think the error is actually referring to vpython, as if I change the source to pass the full path (/Users/dantup/Dev/Google/depot_tools/vpython) then it works:

cmd = [
    '/Users/dantup/Dev/Google/depot_tools/vpython',
    '-vpython-spec', os.path.join(THIS_DIR, 'gsutil.vpython'),
    '--',
    gsutil_bin
] + disable_update + args
print cmd
return subprocess.call(cmd, shell=IS_WINDOWS)

However if I run the original command (gclient sync) it fails with the same error on download_from_google_storage. It feels like a PATH issue, yet I can run vypthon and download_from_google_storage both fine from the very same terminal window that fails when they're invoked from inside the gsutil scripts.

Hmm, so I just made a test python script like this:

import subprocess
subprocess.call([ 'vpython', '-V' ])

And ran it from the terminal. It fails with exactly the same message. However if I change vpython to python then it works fine (in both cases, it doesn't matter whether I run my test script with python or vpython, only the one being run from inside the script). vpython is definitely on my PATH as you can see here:

dantup-macbookpro:depot_tools dantup$ echo $PATH
/usr/local/git/current/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:~/Dev/dart-sdk/latest/bin:~/Dev/Google/flutter/bin:~/Library/Android/sdk/tools:~/Library/Android/sdk/tools/bin:~/Dev/Google/depot_tools

dantup-macbookpro:depot_tools dantup$ vpython -V
Python 2.7.10

Any ideas why launching it from inside a Python script wouldn't work?
Reply all
Reply to author
Forward
0 new messages