GoogleAppEngineLauncher:数据库磁盘映像格式不正确 [英] GoogleAppEngineLauncher: database disk image is malformed

查看:159
本文介绍了GoogleAppEngineLauncher:数据库磁盘映像格式不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

  ***使用以下标志运行dev_appserver:
--skip_sdk_update_check = yes --port = 13080 --admin_port = 8005 --clear_datastore = yes
Python命令:/ usr / bin / python2 .7
INFO 2014-11-22 07:47:57,008 devappserver2.py:745]跳过SDK更新检查。
Traceback(最近一次调用最后):
文件/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/dev_appserver.py,第83行, <模块>
_run_file(__ file__,globals())
文件/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/dev_appserver.py,第79行, _run_file
execfile(_PATHS.script_file(script_name),globals_)
文件/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools /devappserver2/devappserver2.py,第997行,位于< module>
main()
文件/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/devappserver2.py,行990,主
dev_server.start(选项)
文件/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2 /devappserver2.py,第789行,开始
request_data,storage_path,options,configuration)
文件/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/ google_appengine / google / appengine / tools / devappserver2 / devappserver2.py,第888行,在_create_api_server
default_gcs_bucket_name = options.default_gcs_bucket_name)
文件/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default .bundle /内容/资源/ google_appengine /谷歌/ AppEngine上/工具s / devappserver2 / api_server.py,第403行,在setup_stubs
logservice_stub.LogServiceStub(logs_path = logs_path))
文件/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/目录/资源/ google_appengine / google / appengine / api / logservice / logservice_stub.py,第107行,位于__init__
self._conn.execute(_REQUEST_LOG_CREATE)
sqlite3.DatabaseError:数据库磁盘映像格式错误

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


  • 删除/重新添加应用程序


  • 移除应用程序启动程序并重新安装它

  • 找到数据库可能带有grep的地方




没有任何工作。任何想法?

解决方案

默认日志数据库文件名是 log.db 。它存储在您的应用程序存储目录中,该目录默认位于您的 tempfile.gettempdir()目录中,名为 appengine。[appname]。[
$ b $ appname 部分从您的 app.yaml (查找应用程序条目),将
冒号替换为在code>〜 tilde(如果有)之前加下划线和删除所有内容。

所以如果你的应用程序是名为 foobar ,您的用户名是 jbj ,损坏的SQLite数据库位于:

 `python -c'import tempfile; print tempfile.gettempdir()'`/appengine.foobar.jbj/log.db 
tempfile.gettempdir()
返回一个散列路径,位于<$ c $>

code> / var / folders somewhere;它仅仅来自 TMPDIR 环境变量,所以你应该只能使用:

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

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


I've written a small application for Google App Engine and each time I want to run my app I have the following error:

*** 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

When I run an other application I've created, I don't have any error. I tried some basic ideas:

  • delete/re-add the app

  • remove the app launcher and reinstall it

  • reboot the mac

  • locate where the database could be with some grep

Nothing worked. Any idea?

解决方案

The default log database filename is log.db. It is stored in your app storage directory, which by default is located in your tempfile.gettempdir() directory, named appengine.[appname].[userid].

The appname portion takes the value from your app.yaml (look for the application entry), replaces : colons with underscores, and removes everything before the last ~ tilde (if there is any).

So if your app is called foobar and your username is jbj, the corrupted SQLite database is located in:

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

On Mac OS X, tempfile.gettempdir() returns a hashed path under /var/folders somewhere; it is simply taken from the TMPDIR environment variable, so you should just be able to use:

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

You can safely delete this file, it'll be re-created the next time you start the app.

这篇关于GoogleAppEngineLauncher:数据库磁盘映像格式不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆