EnigmaCurry / GMusicFS

A FUSE filesystem for Google Music
153 stars 36 forks source link

Debug Logging causes fatal error #3

Closed rickhuizinga closed 11 years ago

rickhuizinga commented 11 years ago

I've installed and configured the packages as described in the README, however a series of tracebacks are logged to the console which indicate some type of bug in the logging of debug information:

gmusicfs /mnt/gmusicfs/ INFO:gmusicapi:!-- begin debug log --! INFO:gmusicapi:version: 2013.03.1X DEBUG:gmusicapi.protocol.shared:ClientLogin() INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): www.google.com DEBUG:requests.packages.urllib3.connectionpool:"POST /accounts/ClientLogin HTTP/1.1" 200 881 DEBUG:gmusicapi.protocol.shared:Init(args=[], kwargs={}) INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): play.google.com DEBUG:requests.packages.urllib3.connectionpool:"HEAD /music/listen HTTP/1.1" 200 0 DEBUG:gmusicapi.protocol.shared: INFO:gmusicapi.api:authenticated DEBUG:gmusicapi.protocol.shared:AuthenticateUploader(args=['60:21:C0:EC:72', u'localhost (gmusicapi)'], kwargs={}) INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): android.clients.google.com DEBUG:requests.packages.urllib3.connectionpool:"POST /upsj/upauth HTTP/1.1" 200 4 Traceback (most recent call last): File "/usr/lib/python2.7/logging/init.py", line 846, in emit msg = self.format(record) File "/usr/lib/python2.7/logging/init.py", line 723, in format return fmt.format(record) File "/usr/lib/python2.7/logging/init.py", line 464, in format record.message = record.getMessage() File "/usr/lib/python2.7/logging/init.py", line 324, in getMessage msg = str(self.msg) File "/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.py", line 660, in str return text_format.MessageToString(self) File "/usr/lib/python2.7/site-packages/google/protobuf/text_format.py", line 58, in MessageToString PrintMessage(message, out, as_utf8=as_utf8, as_one_line=as_one_line) File "/usr/lib/python2.7/site-packages/google/protobuf/text_format.py", line 72, in PrintMessage PrintField(field, value, out, indent, as_utf8, as_one_line) File "/usr/lib/python2.7/site-packages/google/protobuf/text_format.py", line 101, in PrintField PrintFieldValue(field, value, out, indent, as_utf8, as_one_line) File "/usr/lib/python2.7/site-packages/google/protobuf/text_format.py", line 123, in PrintFieldValue out.write(field.enum_type.values_by_number[value].name) KeyError: 16L Logged from file shared.py, line 219 Traceback (most recent call last): File "/usr/lib/python2.7/logging/init.py", line 846, in emit msg = self.format(record) File "/usr/lib/python2.7/logging/init.py", line 723, in format return fmt.format(record) File "/usr/lib/python2.7/logging/init.py", line 464, in format record.message = record.getMessage() File "/usr/lib/python2.7/logging/init.py", line 324, in getMessage msg = str(self.msg) File "/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.py", line 660, in str return text_format.MessageToString(self) File "/usr/lib/python2.7/site-packages/google/protobuf/text_format.py", line 58, in MessageToString PrintMessage(message, out, as_utf8=as_utf8, as_one_line=as_one_line) File "/usr/lib/python2.7/site-packages/google/protobuf/text_format.py", line 72, in PrintMessage PrintField(field, value, out, indent, as_utf8, as_one_line) File "/usr/lib/python2.7/site-packages/google/protobuf/text_format.py", line 101, in PrintField PrintFieldValue(field, value, out, indent, as_utf8, as_one_line) File "/usr/lib/python2.7/site-packages/google/protobuf/text_format.py", line 123, in PrintFieldValue out.write(field.enum_type.values_by_number[value].name) KeyError: 16L Logged from file shared.py, line 219 Traceback (most recent call last): File "/usr/bin/gmusicfs", line 9, in load_entry_point('GMusicFS==0.1', 'console_scripts', 'gmusicfs')() File "/usr/lib/python2.7/site-packages/gmusicfs/gmusicfs.py", line 338, in main fuse = FUSE(GMusicFS(mountpoint, true_file_size=args.true_file_size), File "/usr/lib/python2.7/site-packages/gmusicfs/gmusicfs.py", line 193, in init true_file_size=true_file_size) File "/usr/lib/python2.7/site-packages/gmusicfs/gmusicfs.py", line 106, in init self.login(username, password) File "/usr/lib/python2.7/site-packages/gmusicfs/gmusicfs.py", line 135, in login self.api.login(username, password) File "/usr/lib/python2.7/site-packages/gmusicapi/api.py", line 112, in login uploader_name) File "/usr/lib/python2.7/site-packages/gmusicapi/api.py", line 909, in _make_call return protocol.perform(self.session, _args, *_kwargs) File "/usr/lib/python2.7/site-packages/gmusicapi/protocol/shared.py", line 223, in perform cls.check_success(response, msg) File "/usr/lib/python2.7/site-packages/gmusicapi/protocol/musicmanager.py", line 76, in check_success res_name = enum_desc.values_by_number[msg.auth_status].name KeyError: 16L

The gmusicfs.log file contains: !-- begin debug log --! version: 2013.03.1X 2013-03-19 10:49:19,236 - gmusicapi.protocol.shared (201) [DEBUG]: ClientLogin() 2013-03-19 10:49:19,471 - gmusicapi.protocol.shared (198) [DEBUG]: Init(args=[], kwargs={}) 2013-03-19 10:49:19,947 - gmusicapi.protocol.shared (219) [DEBUG]: 2013-03-19 10:49:19,947 - gmusicapi.api (90) [INFO]: authenticated 2013-03-19 10:49:19,948 - gmusicapi.protocol.shared (198) [DEBUG]: AuthenticateUploader(args=['60:21:C0:EC:72', u'localhost (gmusicapi)'], kwargs={})

EnigmaCurry commented 11 years ago

I'm not sure what is causing this, but it looks like it's happening inside the gmusicapi library not in gmusicfs. gmusicapi breaks when google makes changes to their (undocumented/non-public) protocol. It looks to me like there might be a new response code (16) that gmusicapi doesn't know about.

Your best bet is to contact Simon Weber about it.

rickhuizinga commented 11 years ago

Thank you for looking into this.

I checked the Issues for GMusicAPI, and it turns out that Google Play Music now requires OAuth authentication for uploading. See Simon Weber's comment: https://github.com/simon-weber/Unofficial-Google-Music-API/issues/111#issuecomment-14928360

Simon indicated that the issue can be bypassed by using gmusicapi in webclient-only (non-upload) mode by setting 'perform_upload_auth = False'. Since GMusicFS is read-only, is there a way to set this configuration parameter?

rickhuizinga commented 11 years ago

It looks like line 135 of the source file gmusicfs.py needs to be changed from:

 self.api.login(username, password)

to:

 self.api.login(username, password, perform_upload_auth=False)
EnigmaCurry commented 11 years ago

I wasn't able to reproduce the original problem, which is typical of google-music, they tend to release new things to only a few people at a time. However, I've committed the fix and it's still working for me, so you'll have to test and see if it fixes it for you.

rickhuizinga commented 11 years ago

Thanks.

I also modified my local source with the same change and verified that it successfully bypasses the problem.

EnigmaCurry commented 11 years ago

great!

simon-weber commented 11 years ago

Sorry I didn't chime in earlier: yup, perform_upload_auth=False is exactly what you want here.

ps, congrats on all the gmusicfs coverage lately! this is an awesome hack =)