0

I feel foolish asking this question, but I cannot seem to get my local datastore to clear for a project using GAE. I've consulted the following SE questions:

I've also looked at the docs, and the command seems very clear among them all. I can navigate to the folder where dev_appserver.py is located and then run

dev_appserver.py --clear_datastore=yes <myappname>

Yet, I keep getting an error stating No such file or directory for my app.

I'm certain I'm entering the right name for my app, because it matches the name in my app.yaml file, it matches the folder my project is in locally, and it matches the name of the project on the GAE Launcher.

My app's local files are in a directory that is completely separate from the GAE install location, if that makes any difference. I tried running the command in my app's directory and it gives me the same error.

The name contains dashes, could that be causing a problem? I realize that this is not a verifiable example, but I'm out of ideas.

Community
  • 1
  • 1
coralvanda
  • 6,431
  • 2
  • 15
  • 25
  • How would `dev_appserver.py` know *where* is the app called `` located if you're executing it in "the folder where dev_appserver.py is located"? – Dan Cornilescu Aug 15 '16 at 20:01
  • See also http://stackoverflow.com/a/33132299/4495081 for a variant of the same general aspect - invoking an executable which needs to locate a file/dir to work with. – Dan Cornilescu Aug 15 '16 at 20:02
  • I mentioned that I ran the same command from inside the app's directory. It gave me the same error in the traceback, so I'm not sure what else it wants from me. I've also tried the command from each folder using the full path to the other respective location, and that didn't work either. Any ideas why it wouldn't work if I'm running the command from inside the app's directory? – coralvanda Aug 15 '16 at 20:20
  • 1
    The syntax is also wrong if you want to specify the app by appname (I presume by that you mean the app's ID). It's supposed to be `[-A APP_ID]`. But I'd strongly suggest getting used to specifying the service `.yaml` file(s) instead - less ambiguous, more consistent (can't use `[-A APP_ID]` for multi-service apps) - it's also the default syntax these days: `yaml_path [yaml_path ...]` – Dan Cornilescu Aug 15 '16 at 20:20
  • Can you link me to the docs for that? I've been looking at [this](https://cloud.google.com/appengine/docs/python/tools/using-local-server) and it says nothing like that. Maybe that's an old version? So, the correct command should be run from the directory with my `app.yaml` file, and should be `dev_appserver.py --cleardatastore=yes app.yaml`? – coralvanda Aug 15 '16 at 20:32
  • 1
    I got the info by running `dev_appserver.py --help`. For running with multi-service apps see http://stackoverflow.com/a/29839511/4495081 or http://stackoverflow.com/a/34111170/4495081. The official docs don't cover all args and all use cases. Yes, that's the cmd I'd use, assuming (the right) `dev_appserver.py` is in the execution path. – Dan Cornilescu Aug 15 '16 at 21:04
  • Thanks, that got it, although I forgot in my comment above to include the `_` in `--clear_datastore`. Not sure I could have figured out that massive `--help` section on my own, so thank you again. – coralvanda Aug 15 '16 at 22:22
  • You're welcome. Please add an answer with the final solution to not leave the question hanging as unanswered. – Dan Cornilescu Aug 15 '16 at 22:41

1 Answers1

1

Thanks to Dan for his help. As he pointed out, the dev_appserver.py --help command explains that the .yaml file should be put in the position of the app's name. This is the final command that worked for me (run from the same directory as the .yaml file) was

dev_appserver.py --clear_datastore=yes app.yaml

Also, it appears that this command has cleared the local datastore for all of my GAE projects. That was not a problem for me but, if someone else needs to preserve a project on the local datastore while clearing another one, then a slightly different command may be required.

coralvanda
  • 6,431
  • 2
  • 15
  • 25