MTG / acousticbrainz-client

A client to upload data to an acousticbrainz server
GNU General Public License v3.0
29 stars 22 forks source link

connection error in linux #40

Open hastyboomalert opened 9 years ago

hastyboomalert commented 9 years ago

Hey, I'm running the submitter client on ubuntu 14.04 and I get connection errors almost constantly. A typical run would go something like this:

hasty@simplex:~/abzsubmit-0.1$ ./abzsubmit ../Music/

[... ] processing /home/hasty/Music ... ... a bunch of files listed ... ... [:) done ] /home/hasty/Music/Autechre/Oversteps/14 - Yuop.m4a [:) done ] /home/hasty/Music/Autechre/Oversteps/10 - d-sho qub.m4a [:) done ] /home/hasty/Music/Autechre/Oversteps/4 - pt2ph8.m4a [:) done ] /home/hasty/Music/Autechre/Envane/3 - Laughing Quarter.mp3 [:) done ] /home/hasty/Music/Autechre/Envane/2 - Latent Quarter.mp3 [:) done ] /home/hasty/Music/Autechre/Envane/4 - Draun Quarter.mp3 [:) ] /home/hasty/Music/Autechre/Envane/1 - Goz Quarter.mp3 [:) ] /home/hasty/Music/Autechre/Exai/11 - nodezsh.flac [:) ] /home/hasty/Music/Autechre/Exai/16 - recks on.flac [:) ] /home/hasty/Music/Autechre/Exai/12 - runrepik.flac Traceback (most recent call last):echre/Exai/6 - vekoS.flac File "./abzsubmit", line 24, in main(sys.argv[1:]) File "./abzsubmit", line 15, in main acousticbrainz.process(path) File "/home/hasty/abzsubmit-0.1/abz/acousticbrainz.py", line 165, in process process_directory(path) File "/home/hasty/abzsubmit-0.1/abz/acousticbrainz.py", line 155, in process_directory process_file(os.path.abspath(os.path.join(dirpath, f))) File "/home/hasty/abzsubmit-0.1/abz/acousticbrainz.py", line 131, in process_file submit_features(recid, features) File "/home/hasty/abzsubmit-0.1/abz/acousticbrainz.py", line 91, in submit_features r = requests.post(url, data=featstr) File "/usr/lib/python2.7/dist-packages/requests/api.py", line 88, in post return request('post', url, data=data, _kwargs) File "/usr/lib/python2.7/dist-packages/requests/api.py", line 44, in request return session.request(method=method, url=url, _kwargs) File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 455, in request resp = self.send(prep, _send_kwargs) File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 558, in send r = adapter.send(request, _kwargs) File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 378, in send raise ConnectionError(e) requests.exceptions.ConnectionError: HTTPConnectionPool(host='acousticbrainz.org', port=80): Max retries exceeded with url: /154585c1-f167-41bc-a134-d9a4f691ba83/low-level (Caused by <class 'socket.error'>: [Errno 32] Broken pipe)

It will generally process up to 20-ish files before this happens. I have checked the actual connection - at least as far as pinging acousticbrainz.org goes, there are no issues. Also, a windows machine on the same LAN has no problems submitting.

alastair commented 9 years ago

Thanks for reporting this. From a quick search it looks like requests defaults to 0 retries in case of an error. It should be easy to increase this to make it retry. I'm not sure why you might not have problems on windows as opposed to linux.