Skip to content

DeveloperFaq

ryosuketc edited this page Feb 10, 2021 · 10 revisions
« back to DeveloperGuide

How do I safely delete Person entities?

Because Person entities can have associated Note and Photo entities, it's not safe to just call Person.delete() in the console. Instead, go to the /admin page of the app and use the deletion form there.

The app says "There was an error processing your request". What do I do?

If you're running a local development appserver, check the console for error messages. If you're running on appspot.com, go to your application dashboard at http://appspot.com/ and check the "Logs" page for error messages.

The app crashed with NeedIndexError. What do I do?

This means that either an index definition is missing from app/index.yaml, or the index is defined but isn't built yet. Go to your application dashboard at http://appspot.com/ and check the "Datastore Indexes" page. All the indexes should be "Serving"; if they are still "Building" then you just have to wait. Unfortunately this can take a long time (hours in some cases).

A command in tools/ returns "Could not find google_appengine directory. Please set APPENGINE_DIR."

This means that it can not find where you installed Google Cloud SDK (and appengine). common.sh is looking into you HOME directory or in a env variable $APPENGINE_DIR to find google_appengine but could not find it. When installing Google Cloud SDK (and appengine), make sure to install it as per GettingStarted.

hg commit says "No username found"

You need to create a .hgrc file. See the Mercurial quickstart guide.

hg commit says "transaction abort!"

This means the commit did not go through. When you commit, Mercurial brings up an editor for you to enter a commit message. This message is required. Beware that Mercurial ignores the lines beginning with HG: when looking for your message, so do not type HG: in front of your message.

hg produces errors about hgext.hbisect and hgext.imerge

If you get the following errors:

failed to import extension hgext.hbisect: No module named hbisect

failed to import extension hgext.imerge: No module named imerge

These used to be extensions, but are now built-in commands. Check these files:

~/.hgrc
/etc/mercurial/hgrc
/etc/mercurial/hgrc.d/hgext.rc

and remove any lines that try to load the hbisect and imerge extensions. Still not working? Check the
Mercurial forum.

tools/rietveld produces error messages

The rietveld script can fail for following reasons:
  • the EDITOR env variable is not set
  • Description longer than 100 characters
  • Description contains a " character

Make sure your EDITOR env variable is set (echo $EDITOR). If not set it through export EDITOR=emacs.
It will allow you to edit your description when running rietveld if the description was longer than 100 characters or if it contained a bad character.

After a failure related to long description or bad character, subsequent runs of rietveld will fail with errors such as:

Usage: -c [options] [-- diff_options]
-c: error: option -i: invalid integer value: 'aliceb-translation'

To go back to a clean state, you have to remove the broken line from the file .codereview_issues in your home directory.

Unittests failed to launch

If Error is 'tools/unit_tests: line 7: nosetests: command not found. It means you did not install Nose for running unittests. Install it using sudo easy_install nose.

How to read/write config values

See Config.

How to run part of unit/server tests

$ ./tools/unit_tests -k APITests  # Test class name
$ ./tools/unit_tests -k test_sms_render_person  # Test method name
$ ./tools/server_tests -k PersonNoteTests  # Test class name
$ ./tools/server_tests -k test_seeking_someone_regular_by_full_text_search  # Test method name

I got an OAuth error when I try to access a production server with tools/console.

Authorization Error
Error 401: invalid_client
The OAuth client was not found.

Set up appropriate Application Default Credentials (ADC) to access a production host such as googlepersonfinder.appspot.com. Please refer to the official document.

« back to DeveloperGuide