当前位置: 动力学知识库 > 问答 > 编程问答 >

google app engine - GAE - I can't clear datastore and the datastore is corrupted I believe

问题描述:

Somehow my local datastore is broken and I want to clear it but I failed to do so.

I seems can't run any code that use datastore now because it is in error state.

I use the following commnand:

dev_appserver.py --clear_datastore GoogleAppEngine

where GoogleAppEngine is my app folder

and here is the log on the console:

and since I am using GO instead of JAVA, I can't find and delete file like

./WEB-INF/appengine-generated/local_db.bin anywhere.

M:\nick\svn\projects>dev_appserver.py --clear_datastore GoogleAppEngine

Traceback (most recent call last):

File "M:\Softwares\Dev Tools\SDK\google_appengine\dev_appserver.py", line 182, in <module>

_run_file(__file__, globals())

File "M:\Softwares\Dev Tools\SDK\google_appengine\dev_appserver.py", line 178, in _run_file

execfile(script_path, globals_)

File "M:\Softwares\Dev Tools\SDK\google_appengine\google\appengine\tools\devappserver2\devappserver2.py", line 689, in <module>

main()

File "M:\Softwares\Dev Tools\SDK\google_appengine\google\appengine\tools\devappserver2\devappserver2.py", line 679, in main

options = PARSER.parse_args()

File "C:\Python27\lib\argparse.py", line 1688, in parse_args

args, argv = self.parse_known_args(args, namespace)

File "C:\Python27\lib\argparse.py", line 1720, in parse_known_args

namespace, args = self._parse_known_args(args, namespace)

File "C:\Python27\lib\argparse.py", line 1926, in _parse_known_args

start_index = consume_optional(start_index)

File "C:\Python27\lib\argparse.py", line 1866, in consume_optional

take_action(action, args, option_string)

File "C:\Python27\lib\argparse.py", line 1794, in take_action

action(self, namespace, argument_values, option_string)

File "M:\Softwares\Dev Tools\SDK\google_appengine\google\appengine\tools\boolean_action.py", line 67, in __call__

raise ValueError('must be "yes" or "no", not %r' % values)

ValueError: must be "yes" or "no", not 'GoogleAppEngine'

M:\nick\svn\projects>dev_appserver.py --clear_datastore GoogleAppEngine

And here is the screen content when I try to visit the DataStore Viewer page.

Traceback (most recent call last):

File "M:\Softwares\Dev Tools\SDK\google_appengine\lib\webapp2-2.5.1\webapp2.py", line 1536, in __call__

rv = self.handle_exception(request, response, e)

File "M:\Softwares\Dev Tools\SDK\google_appengine\lib\webapp2-2.5.1\webapp2.py", line 1530, in __call__

rv = self.router.dispatch(request, response)

File "M:\Softwares\Dev Tools\SDK\google_appengine\lib\webapp2-2.5.1\webapp2.py", line 1278, in default_dispatcher

return route.handler_adapter(request, response)

File "M:\Softwares\Dev Tools\SDK\google_appengine\lib\webapp2-2.5.1\webapp2.py", line 1102, in __call__

return handler.dispatch()

File "M:\Softwares\Dev Tools\SDK\google_appengine\google\appengine\tools\devappserver2\admin\admin_request_handler.py", line 95, in dispatch

super(AdminRequestHandler, self).dispatch()

File "M:\Softwares\Dev Tools\SDK\google_appengine\lib\webapp2-2.5.1\webapp2.py", line 572, in dispatch

return self.handle_exception(e, self.app.debug)

File "M:\Softwares\Dev Tools\SDK\google_appengine\lib\webapp2-2.5.1\webapp2.py", line 570, in dispatch

return method(*args, **kwargs)

File "M:\Softwares\Dev Tools\SDK\google_appengine\google\appengine\tools\devappserver2\admin\datastore_viewer.py", line 721, in get

start))

File "M:\Softwares\Dev Tools\SDK\google_appengine\google\appengine\tools\devappserver2\admin\datastore_viewer.py", line 658, in _get_entity_template_data

cls.NUM_ENTITIES_PER_PAGE)

File "M:\Softwares\Dev Tools\SDK\google_appengine\google\appengine\tools\devappserver2\admin\datastore_viewer.py", line 131, in _get_entities

entities = query.Get(count, start)

File "M:\Softwares\Dev Tools\SDK\google_appengine\google\appengine\api\datastore.py", line 1674, in Get

return list(self.Run(limit=limit, offset=offset, **kwargs))

File "M:\Softwares\Dev Tools\SDK\google_appengine\google\appengine\datastore\datastore_query.py", line 2892, in next

next_batch = self.__batcher.next()

File "M:\Softwares\Dev Tools\SDK\google_appengine\google\appengine\datastore\datastore_query.py", line 2754, in next

return self.next_batch(self.AT_LEAST_ONE)

File "M:\Softwares\Dev Tools\SDK\google_appengine\google\appengine\datastore\datastore_query.py", line 2791, in next_batch

batch = self.__next_batch.get_result()

File "M:\Softwares\Dev Tools\SDK\google_appengine\google\appengine\api\apiproxy_stub_map.py", line 604, in get_result

return self.__get_result_hook(self)

File "M:\Softwares\Dev Tools\SDK\google_appengine\google\appengine\datastore\datastore_query.py", line 2558, in __query_result_hook

self.__results = self._process_results(query_result.result_list())

File "M:\Softwares\Dev Tools\SDK\google_appengine\google\appengine\datastore\datastore_query.py", line 2591, in _process_results

for result in results]

File "M:\Softwares\Dev Tools\SDK\google_appengine\google\appengine\datastore\datastore_rpc.py", line 156, in pb_to_query_result

return self.pb_to_entity(pb)

File "M:\Softwares\Dev Tools\SDK\google_appengine\google\appengine\api\datastore.py", line 347, in pb_to_entity

return Entity._FromPb(pb)

File "M:\Softwares\Dev Tools\SDK\google_appengine\google\appengine\api\datastore.py", line 1126, in _FromPb

(prop.name(), traceback.format_exc()))

Error: Property IdString is corrupt in the datastore:

Traceback (most recent call last):

File "M:\Softwares\Dev Tools\SDK\google_appengine\google\appengine\api\datastore.py", line 1122, in _FromPb

value = datastore_types.FromPropertyPb(prop)

File "M:\Softwares\Dev Tools\SDK\google_appengine\google\appengine\api\datastore_types.py", line 1847, in FromPropertyPb

value = unicode(value, 'utf-8')

UnicodeDecodeError: 'utf8' codec can't decode byte 0xcc in position 14: invalid continuation byte

I don't understand why and how i can broke the datastore.

I am learning GAE with Go and this event really scare me...

网友答案:

The first traceback tells you exactly what you're doing wrong. You've passed --clear_datastore GoogleAppEngine, but it's expecting --clear_datastore=yes GoogleAppEngine (or 'no').

The correct syntax is documented.

网友答案:

For Java Users Solution is: Delete local_db.bin file

分享给朋友:
您可能感兴趣的文章:
随机阅读: