{"action":"opened","issue":{"url":"https://api.github.com/repos/pyload/pyload/issues/1536","labels_url":"https://api.github.com/repos/pyload/pyload/issues/1536/labels{/name}","comments_url":"https://api.github.com/repos/pyload/pyload/issues/1536/comments","events_url":"https://api.github.com/repos/pyload/pyload/issues/1536/events","html_url":"https://github.com/pyload/pyload/issues/1536","id":90495496,"number":1536,"title":"Trouble starting download with sleeping drive","user":{"login":"nomad71","id":6671386,"avatar_url":"https://avatars.githubusercontent.com/u/6671386?v=3","gravatar_id":"","url":"https://api.github.com/users/nomad71","html_url":"https://github.com/nomad71","followers_url":"https://api.github.com/users/nomad71/followers","following_url":"https://api.github.com/users/nomad71/following{/other_user}","gists_url":"https://api.github.com/users/nomad71/gists{/gist_id}","starred_url":"https://api.github.com/users/nomad71/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nomad71/subscriptions","organizations_url":"https://api.github.com/users/nomad71/orgs","repos_url":"https://api.github.com/users/nomad71/repos","events_url":"https://api.github.com/users/nomad71/events{/privacy}","received_events_url":"https://api.github.com/users/nomad71/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-23T21:31:49Z","updated_at":"2015-06-23T21:31:49Z","closed_at":null,"body":"The drive that my pyload uses goes into sleep mode (spin down) after 2h of idle. If I add some files now I get errors like these:\r\n\r\n```\r\n Traceback (most recent call last):\r\n  File \"/usr/share/pyload/module/PluginThread.py\", line 186, in run\r\n    self.m.core.hookManager.downloadPreparing(pyfile)\r\n  File \"/usr/share/pyload/module/utils.py\", line 165, in new\r\n    return func(*args)\r\n  File \"/usr/share/pyload/module/HookManager.py\", line 214, in downloadPreparing\r\n    plugin.downloadPreparing(pyfile)\r\n  File \"/home/pi/.pyload/userplugins/hooks/UserAgentSwitcher.py\", line 43, in downloadPreparing\r\n    pyfile.plugin.req.http.c.setopt(pycurl.USERAGENT, useragent)\r\nerror: cannot invoke setopt() - perform() is currently running\r\n```\r\n\r\n\r\n```\r\n Traceback (most recent call last):\r\n  File \"/usr/share/pyload/module/PluginThread.py\", line 187, in run\r\n    pyfile.plugin.preprocessing(self)\r\n  File \"/home/pi/.pyload/userplugins/internal/Plugin.py\", line 269, in preprocessing\r\n    return self.process(self.pyfile)\r\n  File \"/home/pi/.pyload/userplugins/hoster/BasePlugin.py\", line 56, in process\r\n    self.download(link, ref=False, disposition=True)\r\n  File \"/home/pi/.pyload/userplugins/internal/Plugin.py\", line 512, in download\r\n    makedirs(location, int(self.core.config[\"permission\"][\"folder\"], 8))\r\n  File \"/usr/lib/python2.7/os.py\", line 157, in makedirs\r\n    mkdir(name, mode)\r\nOSError: [Errno 17] File exists: '/media/drive/folder'\r\n```\r\n\r\nThere are some things I noticed and tried:\r\n\r\nUpon adding, the download of the first file is startet multiple times. If the hoster allows multiDL its essentially startet as often as \"Max Parallel Downloads\" allows. \"Max connections for one download\" seems to have no influence. I have it set to 1.\r\n\r\nAfter all these download threads have failed, the last one is left as \"failed\" in the list of running downloads. It can't be removed, and so the package that contains the failed download can't be.\r\n\r\nI managed to solve this problem for a specific case. I have flexget set up to read some rss feeds at night. Usually the drive is asleep at this point of time. I call flexget via cron and simply added \r\n\r\n```\r\ntouch /media/drive/wakeup && rm /media/drive/wakeup &&\r\n```\r\nThis way before pyload is even concerned, I wake up the drive by creating and immediately deleting an empty file called \"wakeup\".\r\n\r\nSo in my understanding the errors occur because of the multiple calling of the same download. So they are merely symptoms of the underlying problem, that the download is called multiple times in the first place. This on the other hand is caused by the sleeping HDD and I have no Idea why or how."}}