{"action":"created","issue":{"url":"https://api.github.com/repos/Mic92/python-mpd2/issues/64","labels_url":"https://api.github.com/repos/Mic92/python-mpd2/issues/64/labels{/name}","comments_url":"https://api.github.com/repos/Mic92/python-mpd2/issues/64/comments","events_url":"https://api.github.com/repos/Mic92/python-mpd2/issues/64/events","html_url":"https://github.com/Mic92/python-mpd2/issues/64","id":122346017,"number":64,"title":"BrokenPipeError (?) when idle for a long time","user":{"login":"speendo","id":1668429,"avatar_url":"https://avatars.githubusercontent.com/u/1668429?v=3","gravatar_id":"","url":"https://api.github.com/users/speendo","html_url":"https://github.com/speendo","followers_url":"https://api.github.com/users/speendo/followers","following_url":"https://api.github.com/users/speendo/following{/other_user}","gists_url":"https://api.github.com/users/speendo/gists{/gist_id}","starred_url":"https://api.github.com/users/speendo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/speendo/subscriptions","organizations_url":"https://api.github.com/users/speendo/orgs","repos_url":"https://api.github.com/users/speendo/repos","events_url":"https://api.github.com/users/speendo/events{/privacy}","received_events_url":"https://api.github.com/users/speendo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-15T19:24:46Z","updated_at":"2015-12-16T07:45:50Z","closed_at":"2015-12-16T06:22:56Z","body":"Hi and thank you for this project!\r\n\r\nWhen mpd is idle (after calling `client.stop()`) for a couple of hours, I cannot successfully call `client.play()` again. I am aware of ConnectionErrors that can occur so I catch them in my script. In this case, however, I get a BrokenPipeError (sometimes I don't get an error at all, but nevertheless mpd won't start to play reproducibly).\r\n\r\nI wrote a test script (find it here: https://gist.github.com/speendo/0d9c1a028d045de3f7a6) to track the error down.\r\n\r\nI ran this script on my raspberry pi with `nohup python3 test_mpd.py &`.\r\n\r\nHere's a traceback of the Error (found in nohup.out):\r\n\r\n    Traceback (most recent call last):\r\n      File \"test_mpd.py\", line 62, in <module>\r\n        client.play()\r\n      File \"/usr/local/lib/python3.4/dist-packages/mpd.py\", line 600, in decorator\r\n        return wrapper(self, name, args, bound_decorator(self, returnValue))\r\n      File \"/usr/local/lib/python3.4/dist-packages/mpd.py\", line 236, in _execute\r\n        self._write_command(command, args)\r\n      File \"/usr/local/lib/python3.4/dist-packages/mpd.py\", line 263, in _write_command\r\n        self._write_line(\" \".join(parts))\r\n      File \"/usr/local/lib/python3.4/dist-packages/mpd.py\", line 243, in _write_line\r\n        self._wfile.flush()\r\n      File \"/usr/lib/python3.4/socket.py\", line 391, in write\r\n        return self._sock.send(b)\r\n    BrokenPipeError: [Errno 32] Broken pipe\r\n\r\nAnd here's the log:\r\n\r\n    2015-12-15 08:35:26,497 INFO: Log started\r\n    2015-12-15 08:35:26,500 INFO: Attempt to (re-)connect to mpd server\r\n    2015-12-15 08:35:26,503 INFO: Calling MPD connect('localhost', 6600, timeout=None)\r\n    2015-12-15 08:35:26,566 INFO: Finished attempt to (re-)connect to mpd server\r\n    2015-12-15 08:35:26,568 INFO: <bound method MPDClient.decorator of <mpd.MPDClient object at 0xb6a38590>>\r\n    2015-12-15 08:35:26,570 INFO: Add playlist entry\r\n    2015-12-15 08:35:26,573 DEBUG: Calling MPD clear()\r\n    2015-12-15 08:35:26,578 DEBUG: Calling MPD add('http://uwstream2.somafm.com:9016',)\r\n    2015-12-15 08:35:26,582 INFO: Start playing for the first time\r\n    2015-12-15 08:35:26,585 DEBUG: Calling MPD play()\r\n    2015-12-15 08:35:36,597 INFO: This obviously works. Switching off now for 4 hours.\r\n    2015-12-15 08:35:36,604 DEBUG: Calling MPD stop()\r\n    2015-12-15 12:35:36,725 INFO: Trying to switch on again now\r\n    2015-12-15 12:35:36,727 DEBUG: Calling MPD play()\r\n\r\nCan you help me find the source of this problem (or even solve it)?"},"comment":{"url":"https://api.github.com/repos/Mic92/python-mpd2/issues/comments/165024499","html_url":"https://github.com/Mic92/python-mpd2/issues/64#issuecomment-165024499","issue_url":"https://api.github.com/repos/Mic92/python-mpd2/issues/64","id":165024499,"user":{"login":"speendo","id":1668429,"avatar_url":"https://avatars.githubusercontent.com/u/1668429?v=3","gravatar_id":"","url":"https://api.github.com/users/speendo","html_url":"https://github.com/speendo","followers_url":"https://api.github.com/users/speendo/followers","following_url":"https://api.github.com/users/speendo/following{/other_user}","gists_url":"https://api.github.com/users/speendo/gists{/gist_id}","starred_url":"https://api.github.com/users/speendo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/speendo/subscriptions","organizations_url":"https://api.github.com/users/speendo/orgs","repos_url":"https://api.github.com/users/speendo/repos","events_url":"https://api.github.com/users/speendo/events{/privacy}","received_events_url":"https://api.github.com/users/speendo/received_events","type":"User","site_admin":false},"created_at":"2015-12-16T07:45:50Z","updated_at":"2015-12-16T07:45:50Z","body":"Hello Jörg!\r\n\r\nI'm aware of https://github.com/Mic92/python-mpd2/issues/31 and ConnectionErrors.\r\n\r\nProve me wrong, but I don't see how this issue is related to that.\r\n\r\nMy script should catch all ConnectionErrors with\r\n\r\n    try:\r\n        client.play()\r\n    except MPDConnectionError:\r\n        logging.info(\"Lost MPD connection\")\r\n        client.connect()\r\n        client.play()\r\n\r\nPlease find the whole script here: https://gist.github.com/speendo/0d9c1a028d045de3f7a6\r\n\r\nAfter a couple of hours I get a (generic) BrokenPipeError which - as far as I know - is not related to the mpd-specific ConnectionError.\r\n\r\nI would be glad if you could clarify why this is a duplicate or reopen the issue.\r\n\r\nThank you!"}}