gpt4 book ai didi

python - GoogleAppEngineLauncher : database disk image is malformed

转载 作者:太空狗 更新时间:2023-10-30 02:44:56 25 4
gpt4 key购买 nike

我为 Google App Engine 编写了一个小应用程序,每次我想运行我的应用程序时,我都会遇到以下错误:

*** Running dev_appserver with the following flags:
--skip_sdk_update_check=yes --port=13080 --admin_port=8005 --clear_datastore=yes
Python command: /usr/bin/python2.7
INFO 2014-11-22 07:47:57,008 devappserver2.py:745] Skipping SDK update check.
Traceback (most recent call last):
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/dev_appserver.py", line 83, in <module>
_run_file(__file__, globals())
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/dev_appserver.py", line 79, in _run_file
execfile(_PATHS.script_file(script_name), globals_)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 997, in <module>
main()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 990, in main
dev_server.start(options)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 789, in start
request_data, storage_path, options, configuration)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 888, in _create_api_server
default_gcs_bucket_name=options.default_gcs_bucket_name)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/api_server.py", line 403, in setup_stubs
logservice_stub.LogServiceStub(logs_path=logs_path))
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/logservice/logservice_stub.py", line 107, in __init__
self._conn.execute(_REQUEST_LOG_CREATE)
sqlite3.DatabaseError: database disk image is malformed

当我运行我创建的其他应用程序时,我没有任何错误。我尝试了一些基本的想法:

  • 删除/重新添加应用

  • 删除应用启动器并重新安装

  • 重启电脑

  • 使用 grep 找到数据库的位置

没有任何效果。有什么想法吗?

最佳答案

默认的日志数据库文件名是log.db。它存储在您的应用程序存储目录中,该目录默认位于您的 tempfile.gettempdir() 目录中,名为 appengine.[appname].[userid]

appname 部分从您的 app.yaml 中获取值(查找 application 条目),替换 : 冒号和下划线,并删除最后一个 ~ 波浪号(如果有的话)之前的所有内容。

因此,如果您的应用名为 foobar 并且您的用户名是 jbj,则损坏的 SQLite 数据库位于:

`python -c 'import tempfile;print tempfile.gettempdir()'`/appengine.foobar.jbj/log.db

在 Mac OS X 上,tempfile.gettempdir() 返回 /var/folders 下某处的散列路径;它只是取自 TMPDIR 环境变量,因此您应该只能使用:

rm $TMPDIR/appengine.foobar.jbj/log.db

您可以安全地删除此文件,下次启动应用程序时会重新创建它。

关于python - GoogleAppEngineLauncher : database disk image is malformed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27075350/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com