Right now I get a blank page when localhost runs, but the deployed app is fine. The logs show the "database is locked". How do I "unlock" the database for localhost?
4 Answers
This can happen if you're running multiple instances of dev_appserver without giving them distinct datastore files/directories. If you need to be running multiple instances, see dev_appserver.py --help
and look at the options for specifying paths/files.

- 24,318
- 4
- 40
- 46
-
Newbie question - how did I get to the point where I'm running multiple instances of dev_appserver? I'm only running one folder for each app. Is there a way to undo this in the app engine sdk/google app engine launcher? – mango Dec 15 '13 at 07:53
-
This often happens when using `dev_appserver` from the command line in multiple shell windows. Sorry, but have very little experience with the launcher, being an old-school command-line kind of developer. – Dave W. Smith Dec 16 '13 at 05:35
-
I went into the docs (https://developers.google.com/appengine/docs/python/tools/devserver) and tried dev_appserver.py --max_module_instances=1 in command line, and it said I had too few arguments? – mango Dec 16 '13 at 23:21
-
You need to include a path to the directory that hold `app.yaml`. (`.` is fine if you're already there.) – Dave W. Smith Dec 23 '13 at 01:44
Dave W. Smith has the right idea. I had this same issue and looking into the docs you need to set the --storage_path='some/path'
to be different for each instance of the localhost.
From the Docs:
--storage_path PATH path to the data (datastore, blobstore, etc.)
Also, different port and admin_ports
have to be set to run the two instances.

- 10,612
- 2
- 29
- 46

- 2,381
- 2
- 31
- 42
-
1To elaborate: When the dev server starts it uses the default datastore, which it locks, so other dev servers cannot access it, hence the message. So use: `dev_appserver.py ./ --port=
--admin_port= – nick Feb 07 '18 at 09:22--storage_path= ` e.g. `dev_appserver.py ./ --port=8001 --admin_port=8002 --storage_path=var/api`. Using `var/api` will create this path in your app's file structure.
I tried this and it worked, I noticed that when this happens, there are multiple pythonw.exe processes working in the process bar.
Go to command prompt, run the following
taskkill /f /im pythonw.exe
Restart your application from the app launcher

- 32,158
- 14
- 82
- 96

- 31
- 3
-
Just `python.exe` for me, and I had to open in Administrator mode. – Nate Anderson May 18 '17 at 13:28
-
In Windows, the task manager was showing multiple copies of python.exe task. Killing a task fixed it. – intotecho May 24 '17 at 12:23
So with your command to start the server which should be
start_in_shell.sh -f -p 8xxx -a 8xxx
do include a -s
flag after the -f
as below:
start_in_shell.sh -f -s -p 8xxx -a 8xxx
Sometimes some unanticipated error somewhere causes this issue. Remember to keep only one of the instances with this flag(-s
) and others should be started as you do usually.
This should make it work.

- 445
- 4
- 17