question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"[Errno 2] No such file or directory" running gsutil

See original GitHub issue

I’m trying to get the dart-sdk checked out and working on my MacBook, but when I run gclient sync I’m greeted with the error:

[Errno 2] No such file or directory

Full details are here but I’ve managed to get as far as discovering that even gsutil.py version -l from inside the depot_tools folder doesn’t work:

dantup-macbookpro:depot_tools dantup$ gsutil.py version -l
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 152, 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

If I open up line 152 of gsutil.py and add print cmd just before it tries to run the command, I get this output:

[‘vpython’, ‘-vpython-spec’, ‘/Users/dantup/Dev/Google/depot_tools/gsutil.vpython’, ‘–’, ‘/Users/dantup/Dev/Google/depot_tools/external_bin/gsutil/gsutil_4.30/gsutil/gsutil’, ‘-o’, ‘GSUtil:software_update_check_period=0’, ‘version’, ‘-l’]

If I try to run that command manually from the terminal, it works fine:

dantup-macbookpro:depot_tools dantup$ 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
gsutil version: 4.28

I’ve hit this on three machines - previously on my Windows PC and my personal MacBook - I kinda gave up since the checkout had worked well enough for what I needed, but now I’m hitting the same issue on my Google corp MacBook and I’m really hoping to fix it this time!

Any ideas on how to troubleshoot further?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
DanTupcommented, Apr 24, 2018

In case anyone else finds this post with a similar issue, it turned out to be fairly simple - I’d used tildes ~ in my PATH, and they resolved fine in the terminal but not inside Python, which is why it culdn’t find vpython. Doh.

1reaction
houglumcommented, Apr 20, 2018

Maybe the environment from which you’re running the command isn’t able to run vpython – try editing cmd to use the full path to vpython, maybe? Regardless, this isn’t related to gsutil itself; it’s a problem with the tool that attempts to bundle and run it. I’d recommend continuing investigation on the other issue you linked.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No such file or directory Error with Google Cloud Storage
It seems like you're trying to open it with a regular os. command where you should be using GCP's sdk. Share.
Read more >
Issues running gclient sync ("[Errno 2] No such file or directory ...
No such file or directory. Check that /Users/dantup/Dev/Google/dart-sdk or download_from_google_storage exist and have execution permission. So I'm a bit lost.
Read more >
gsutil: No such file or directory on startup - Ask Ubuntu
I have VM that runs on linux 18.04.01 and that executes a startup script which includes gsutil : #!/bin/bash set -ex source bin/ci/colors ......
Read more >
Install gsutil | Cloud Storage
This page describes the installation and setup of gsutil, a tool that enables you to access Cloud Storage from the command-line using HTTPS....
Read more >
gsutil ls ISSUE [35907036] - Visible to Public - Issue Tracker
Observed Output -> Error ... File "/home/sarvesh/google-cloud-sdk/platform/gsutil/gsutil", line 22, ... IOError: [Errno 2] No such file or directory ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found