syndicate-storage / syndicate

Internet-scale software-defined storage system
Apache License 2.0
56 stars 10 forks source link

ERROR [webapp2.py:1552] 'NoneType' object has no attribute 'size' when running MS locally #1

Closed wathsalav closed 11 years ago

wathsalav commented 11 years ago

I'm getting following error when trying to mount a volume from an MS that runs locally.

ERROR 2013-06-14 18:58:40,639 webapp2.py:1552] 'NoneType' object has no attribute 'size' Traceback (most recent call last): File "/home/wathsala/Downloads/google_appengine/lib/webapp2-2.5.2/webapp2.py", line 1535, in call rv = self.handle_exception(request, response, e) File "/home/wathsala/Downloads/google_appengine/lib/webapp2-2.5.2/webapp2.py", line 1529, in call rv = self.router.dispatch(request, response) File "/home/wathsala/Downloads/google_appengine/lib/webapp2-2.5.2/webapp2.py", line 1278, in default_dispatcher return route.handler_adapter(request, response) File "/home/wathsala/Downloads/google_appengine/lib/webapp2-2.5.2/webapp2.py", line 1102, in call return handler.dispatch() File "/home/wathsala/Downloads/google_appengine/lib/webapp2-2.5.2/webapp2.py", line 572, in dispatch return self.handle_exception(e, self.app.debug) File "/home/wathsala/Downloads/google_appengine/lib/webapp2-2.5.2/webapp2.py", line 570, in dispatch return method(_args, _kwargs) File "/home/wathsala/Downloads/google_appengine/ms/MS/handlers.py", line 215, in get reply = Resolve( UG.owner_id, volume, path ) File "/home/wathsala/Downloads/google_appengine/ms/MS/methods/resolve.py", line 100, in Resolve path_metadata, children_metadata, error = __read_path_metadata( owner_id, volume, fs_path ) File "/home/wathsala/Downloads/google_appengine/ms/MS/methods/resolve.py", line 77, in read_path_metadata children_metadata = MSEntry.ListAll( volume, fs_path ) File "/home/wathsala/Downloads/google_appengine/ms/MS/entry.py", line 817, in ListAll results = qry_ents.map( read_msentry_children_mapper, batch_size=1000 ) File "/home/wathsala/Downloads/google_appengine/google/appengine/ext/ndb/utils.py", line 136, in positional_wrapper return wrapped(_args, _kwds) File "/home/wathsala/Downloads/google_appengine/google/appengine/ext/ndb/query.py", line 1091, in map *_q_options).get_result() File "/home/wathsala/Downloads/google_appengine/google/appengine/ext/ndb/tasklets.py", line 325, in get_result self.check_success() File "/home/wathsala/Downloads/google_appengine/google/appengine/ext/ndb/context.py", line 813, in helper val = callback(ent) File "/home/wathsala/Downloads/google_appengine/google/appengine/ext/ndb/tasklets.py", line 1002, in tasklet_wrapper result = func(_args, **kwds) File "/home/wathsala/Downloads/google_appengine/ms/MS/entry.py", line 803, in __read_msentry_children_mapper msentry.populate_from_shards( shards ) File "/home/wathsala/Downloads/google_appengine/ms/storage/storagetypes.py", line 138, in populate_from_shards setattr( self, shard_field, shard_reader( self, shards ) ) File "/home/wathsala/Downloads/google_appengine/ms/MS/entry.py", line 238, in "size": (lambda ent, shards: MSEntryShard.get_size_from_shards( ent, shards )) File "/home/wathsala/Downloads/google_appengine/ms/MS/entry.py", line 125, in get_size_from_shards return sz.size AttributeError: 'NoneType' object has no attribute 'size'

jcnelson commented 11 years ago

Looks like you're trying to read an MSEntry that has no shards. The bug isn't in the fact that you're getting a NoneType exception, but rather that a shard isn't being created when you create an MSEntry.

The Resolve() method reads a path's-worth of MSEntries from the data store, and in doing so, reads both the MSEntry structure and its associated MSEntryShard structures. It then populates the MSEntry from the MSEntryShard instances. What appears to be happening is that there simply aren't any shards to read.

Are you doing something to create an MSEntry somewhere (i.e. using ms_client_create, ms_client_mkdir, etc.)? Can we walk through this on Monday?

wathsalav commented 11 years ago

I'm using both ms_client_create and ms_client_mkdir I can see MSEntrys and MSEntryShards created for this particular volume from data store viewer of app engine. Sure let's talk on Monday.