gmusic-playlist icon indicating copy to clipboard operation
gmusic-playlist copied to clipboard

httplib.IncompleteRead: IncompleteRead(0 bytes read)

Open ghost opened this issue 9 years ago • 10 comments

My sync script has suddenly stopped working. Not sure if Google have changed something, Debian have pushed out some flakey Python update, or what... I have tried loads of things so far, including a total Python reinstall (which is quite hairy when Debian needs python itself to manage packages).

Logging into google music... [email protected]'s password: Traceback (most recent call last): File "/root/gmusic-playlist/ExportLists.py", line 17, in api = open_api() File "/root/gmusic-playlist/common.py", line 111, in open_api if not api.login(username, password): File "/usr/local/lib/python2.7/dist-packages/gmusicapi/clients/mobileclient.py", line 39, in login if not self.session.login(email, password): File "/usr/local/lib/python2.7/dist-packages/gmusicapi/session.py", line 147, in login success = super(Mobileclient, self).login(email, password, _args, _kwargs) File "/usr/local/lib/python2.7/dist-packages/gmusicapi/session.py", line 122, in login webclient.Init.perform(self, True) File "/usr/local/lib/python2.7/dist-packages/gmusicapi/protocol/shared.py", line 208, in perform response = session.send(req_kwargs, cls.required_auth) File "/usr/local/lib/python2.7/dist-packages/gmusicapi/session.py", line 86, in send res = self._send_with_auth(req_kwargs, desired_auth, rsession) File "/usr/local/lib/python2.7/dist-packages/gmusicapi/session.py", line 142, in _send_with_auth return rsession.request(_req_kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 465, in request resp = self.send(prep, *_send_kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 605, in send r.content File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 750, in content self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes() File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 673, in generate for chunk in self.raw.stream(chunk_size, decode_content=True): File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/response.py", line 304, in stream for line in self.read_chunked(amt): File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/response.py", line 411, in read_chunked raise httplib.IncompleteRead(''.join(line)) httplib.IncompleteRead: IncompleteRead(0 bytes read)

ghost avatar Apr 24 '15 16:04 ghost

Hi mgillespie,

Unfortunately, I am unable to reproduce the issue. It may be a connection issue between you and the google servers. The stack trace you provided indicates it to be some kind of network issue.

When did you first notice the issue and for how long has it continued? Have you tried a different network? What about a different user account?

I looked on gmusicapi's issue list and didn't see any issues like what you mentioned.

Regards

soulfx avatar Apr 25 '15 02:04 soulfx

Hi,

I also get this error today when trying to export my playlist for the first time.

@soulfx: Do you think this might be a login issue? Is it possible to get more log entries?

Regards

small87 avatar Apr 26 '15 19:04 small87

I'm seeing this same problem on 2x Linux systems (1x Debian wheezy on a RaspberryPI, 1x Linux Mint Desktop PC), there is little in common between them.

It seems like some really bad breaking changes have gone into Python 2.7 with regards to urllib3 and response libraries. Mine is a total disaster zone, even pip doesn't work anymore..

Just installing a clean Debian Jessie (testing) build to see what happens.

ghost avatar Apr 26 '15 20:04 ghost

Brand new debian install also exhibits the problem.

ghost avatar Apr 26 '15 23:04 ghost

Hi mg and small,

My searching of gmusicapi's issues for this problem wasn't as thorough as I thought. https://github.com/simon-weber/Unofficial-Google-Music-API/issues/323 - Lists a workaround the for incomplete read issue.

Can either of you try the work around and see if it fixes the issue for you?

Regards

soulfx avatar Apr 27 '15 00:04 soulfx

Tried this today, it does eventually time-out and then carry on, but it just moves the problem further on. It sounds like it's a gmusicapi problem at least.

Logging into google music... Login Successful. DEBUG:gmusicapi.Mobileclient1:Search(args=['one u2', 1], kwargs={}) Traceback (most recent call last): File "/root/gmusic-playlist/ExportLists.py", line 43, in api = open_api() File "/root/gmusic-playlist/common.py", line 117, in open_api dlog(u'Available track details: '+str(get_google_track_details())) File "/root/gmusic-playlist/common.py", line 65, in get_google_track_details return (api.search_all_access(sample_song,max_results=1) File "/usr/local/lib/python2.7/dist-packages/gmusicapi/clients/mobileclient.py", line 796, in search_all_access res = self._make_call(mobileclient.Search, query, max_results) File "/usr/local/lib/python2.7/dist-packages/gmusicapi/clients/shared.py", line 80, in _make_call return protocol.perform(self.session, self.validate, _args, *_kwargs) File "/usr/local/lib/python2.7/dist-packages/gmusicapi/protocol/shared.py", line 225, in perform raise CallFailure(err_msg, call_name) gmusicapi.exceptions.CallFailure: Search: 404 Client Error: Not Found (requests kwargs: {'url': 'https://www.googleapis.com/sj/v1.5/query', 'headers': {'Authorization': ''}, 'params': {'q': 'one u2', 'max-results': 1}, 'method': 'GET'}) (response was: '{\n "error": {\n "errors": [\n {\n "domain": "global",\n "reason": "notFound",\n "message": "Not Found"\n }\n ],\n "code": 404,\n "message": "Not Found"\n }\n}\n')

ghost avatar Apr 27 '15 07:04 ghost

Hi, have finally gotten to the bottom of this. Initially it was a debian problem with their python version, this however changed at some point during my tinkers, into a different problem caused by my Google All Access Subscription that had expired, and I wasn't aware it was a requirement on this script.

Can you add that a Google All Access Active Subscription is a requirement to the project README.md

I guess this can be closed once that's done.

ghost avatar Jun 02 '15 18:06 ghost

Hi Mark,

Updating the read me to include the prerequisite that an all access subscription is currently required is a good idea.

Feel free to submit a patch to the read me if you get around to it before me.

There may be a way to detect the lack of all access subscription via code, output a warning, and fall back to doing a personal library search only.  When I get some time I'll look into it.

I know that one would assume that the export script wouldn't need all access, but there is a portion of the common logic  between the export and import script that uses an all access query to determine what the available fields are on track  info.

Regards, Soul

soulfx avatar Jun 03 '15 02:06 soulfx

I believe the 7b715be80e5756c2222cea19a128086ae20cee7c fixes the index out of bounds issues for non all access accounts. I did a simple test using an account that didn't have all access and it was able to login and run both the import and export scritpts.

soulfx avatar Jul 05 '15 03:07 soulfx

Hmm, interesting. This still didn't initially work for me, still coming up with the exception thrown from get_google_track_details().

However I am not in the US, and the curated playlist stuff isn't available here yet. However I signed up for a free US VPN account (I used PrivateTunnel, 500Mb free: https://www.privatetunnel.com/home/?referral=FUXBNWS0PQ ) and since then this has worked, even without the VPN anymore. It's as if logging in from the US at least once is enough to set some kind of flag server-side...

ghost avatar Jul 05 '15 15:07 ghost