[英]How do I unlock the app engine database when localhost runs?
Right now I get a blank page when localhost runs, but the deployed app is fine.现在我在 localhost 运行时得到一个空白页面,但部署的应用程序很好。 The logs show the "database is locked".
日志显示“数据库已锁定”。 How do I "unlock" the database for localhost?
如何“解锁”本地主机的数据库?
This can happen if you're running multiple instances of dev_appserver without giving them distinct datastore files/directories.如果您正在运行 dev_appserver 的多个实例而没有为它们提供不同的数据存储文件/目录,则可能会发生这种情况。 If you need to be running multiple instances, see
dev_appserver.py --help
and look at the options for specifying paths/files.如果您需要运行多个实例,请参阅
dev_appserver.py --help
并查看用于指定路径/文件的选项。
Dave W. Smith has the right idea. Dave W. Smith 的想法是正确的。 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.我遇到了同样的问题,并查看了您需要将
--storage_path='some/path'
设置为每个本地主机实例不同的文档。
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.此外,必须设置不同的 port 和
admin_ports
才能运行这两个实例。
I tried this and it worked, I noticed that when this happens, there are multiple pythonw.exe processes working in the process bar.我试过了,它奏效了,我注意到当发生这种情况时,进程栏中有多个 pythonw.exe 进程在工作。
Go to command prompt, run the following转到命令提示符,运行以下命令
taskkill /f /im pythonw.exe
Restart your application from the app launcher从应用程序启动器重新启动您的应用程序
So with your command to start the server which should be start_in_shell.sh -f -p 8xxx -a 8xxx
所以用你的命令启动服务器,它应该是
start_in_shell.sh -f -p 8xxx -a 8xxx
do include a -s
flag after the -f
as below:在
-f
之后包含一个-s
标志,如下所示:
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.记住只保留一个带有此标志(
-s
)的实例,其他实例应该像往常一样启动。
This should make it work.这应该使它工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.