syndicate-storage / syndicate

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

Error when initializing test users/volumes in MS after a git pull. #12

Closed wathsalav closed 11 years ago

wathsalav commented 11 years ago

I get the following error when initializing the MS test data store using the URL the http://localhost:8080/debug/setup/test?do_init=1&ug_name=UG-localhost&do_local_ug=1&username=wathsala@cs.princeton.edu when MS runs locally.

File "/home/wathsala/Downloads/google_appengine/ms/tests/setup.py", line 864, in test volume_key = storage.create_volume( user, name=test_volume_name, description="%s's test volume" % user_email, blocksize=61440, volume_secret="abcdef", volume_secret_salt="abcdef", active=True ) File "/home/wathsala/Downloads/google_appengine/ms/storage/storage.py", line 34, in create_volume return Volume.Create( user, **kwargs ) File "/home/wathsala/Downloads/google_appengine/ms/MS/volume.py", line 181, in Create invalid = Volume.validate_fields( kwargs ) File "/home/wathsala/Downloads/google_appengine/ms/storage/storagetypes.py", line 376, in validate_fields valid = cls.validators[attr](cls, value) File "/home/wathsala/Downloads/googleappengine/ms/MS/volume.py", line 90, in "name": (lambda cls, value: len( value.translate(dict((ord(char), None) for char in "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-.@")) ) == 0 ) TypeError: expected a character buffer object

ERROR 2013-06-30 07:20:50,533 webapp2.py:1552] 'NoneType' object has no attribute 'volume_id' 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/tests/debughandler.py", line 43, in get status, msg = test.test( path, args ) File "/home/wathsala/Downloads/google_appengine/ms/tests/setup.py", line 876, in test if volume.volume_id not in user.volumes: AttributeError: 'NoneType' object has no attribute 'volume_id' INFO 2013-06-30 07:20:50,551 recording.py:673] Saved; key: appstats:050400, part: 305 bytes, full: 50088 bytes, overhead: 0.004 + 0.015; link: http://localhost:8080/_ah/stats/details?time=1372576850447 INFO 2013-06-30 07:20:50,558 server.py:585] default: "GET /debug/setup/test?do_init=1&ug_name=UG-localhost&do_local_ug=1&username=wathsala@cs.princeton.edu HTTP/1.1" 500 1797

johnwhelchel commented 11 years ago

Issue fixed. It was a problem with unicode encoding in the volume name validator. The string.transate() method has two API's depending on whether or not a string is unicode or not. I changed translate from the non-unicode to the unicode version about a week ago, so it broke when redoing setup.py. So now it just converts the string to unicode before calling the validator. I also fixed another changed bug in setup.py.