How to fix Google-cloud-sdk 156.0.0 “There are too many files in your application for changes in all of them to be monitored.”?

后端 未结 4 2670
野性不改
野性不改 2021-02-19 18:55

I just installed Go 1.6.4 and google-cloud-sdk 1.56.0.0 on osX.

When I attempt to run the local dev_server I get the following warning.

/Users/Bryan/go/src/googl

相关标签:
4条回答
  • With my current sdk version (Google Cloud SDK 171.0.0) dev_appserver.py has one option named enable_watching_go_path.

    Setting it to False removed the warning.

    The command I use is: dev_appserver.py --enable_watching_go_path=False server/app.yml

    0 讨论(0)
  • 2021-02-19 19:37

    I only used an older version of appengine sdk, but I believe below is still true.

    The main issue is that you have google-cloud-sdk inside your GOPATH. This should not be necessary. I have it installed in my path. But even if not installed it should be resolving it's location relative to the executable or script you are running and should find all required sdk files properly. At the same time SDK is roughly 7500 files and you only need to have more than 10000 (approx) in your GOPATH to get that "to many files" warning. So, if you have another (e.g. older) copy of SDK or other big project inside same GOPATH, you are pretty much guaranteed to exceed the threshold. Just locate /Users/Bryan/go in Finder and use "Get Info" to count files.

    So, either move appengine SDK outside of your GOPATH. Or make a new folder, export it as your new GOPATH and move your project files (but not SDK) to that new folder. This should fix the "too many files issue".

    The other issue is that your app actually fails to build. And as you have already figured out yourself the (immediate) issue is missing appengine package.

    But the correct way of getting google.golang.org/appengine is as follows: go get google.golang.org/appengine

    Though keep in mind that GOPATH must be set correctly before running the above command. It will fetch google.golang.org/appengine and all it's dependencies.

    Once you have retrieved all required packages (and fixed errors, if any) it should compile and run without issues.

    0 讨论(0)
  • 2021-02-19 19:48

    The corresponding error occurs when mtime_file_watcher.py tries to monitor all files under "GOPATH" but has too many files, so use the skip_files option of app.yaml to check vendor, node_modules and arbitrary number of files Can be avoided by excluding many projects to be monitored.

    https://cloud.google.com/appengine/docs/standard/python/config/appref#skip_files

    skip_files:
    - .*node_modules
    - .*vendor
    - .*project-name-having-too-many-files
    
    0 讨论(0)
  • 2021-02-19 19:56

    I'm using just the App Engine SDK for Go (1.9.54), not the Cloud SDK, but have the same problem [Goapp serve - Warning: There are too many files.

    I solved it by moving large packages and repositories to vendor/ dir.

    0 讨论(0)
提交回复
热议问题