posborne / putio-sync

Python daemon that automatically downloads files from put.io
MIT License
29 stars 12 forks source link

Since two days i get a "Unexpected error while performing check/download" #30

Closed xsteadfastx closed 8 years ago

xsteadfastx commented 8 years ago

When i start putiosync i get this:

~ putiosync ~/Downloads/putio
2016-06-21 09:38:22,154 | putiosync    | WARNING  | Starting main application
w3m: Can't load http://localhost:7001/.
w3m: Can't load http://localhost:7001/.
2016-06-21 09:38:22,732 | putiosync    | ERROR    | Unexpected error while performing check/download

and no new files get downloaded. Anything i can do to investigate more?

posborne commented 8 years ago

With what version? The latest from git? The latest release from pypi?

xsteadfastx commented 8 years ago

the latest version from pypi.

domainzero commented 8 years ago

I'm getting this too using the latest git version. Or I was... as I was typing this out I watched it stop erroring out.

The error was occuring once every 2 seconds prior though.

posborne commented 8 years ago

Interesting, I have not seen this myself running the latest development. I think I may have seen problems in the past with file names with specific characters in them. Maybe try seeing what is on the top of your download queue?

domainzero commented 8 years ago

I cleaned out my entire put.io box, still experiencing the problem.

I did notice that put.io unhid the "items shared with me folder" briefly so that could be the root cause of this. Is there a way to check what putio-sync is actively trying to download?

posborne commented 8 years ago

I haven't seen the problem. If you are able, there are a couple quick hacks you can try to get additional logging:

  1. Modify https://github.com/posborne/putio-sync/blob/ac4b41dcf958e7a28c9560f977e565c67bb72c5e/putiosync/core.py#L196 to do logger.exception instead of logging.error (I should probably change this behavior but with some additional checking)
  2. Modify https://github.com/posborne/putio-sync/blob/ac4b41dcf958e7a28c9560f977e565c67bb72c5e/putiosync/core.py#L25 to set the base level to logging.DEBUG

Not ideal, but you should be able to track down the python files even if installed via pip to make this work. The location depends on your OS.

domainzero commented 8 years ago

Alright, looks like when it queries the api and hits that hidden shared folder things blow up. I sanitized my OAUTH token below.

2016-06-23 11:13:02,669 | putio        | DEBUG    | url: https://api.put.io/v2/files/list
2016-06-23 11:13:02,835 | requests.packages.urllib3.connectionpool | DEBUG    | "GET /v2/files/list?parent_id=333998564&oauth_token=XXXXXXXX HTTP/1.1" 200 601
2016-06-23 11:13:02,837 | putio        | DEBUG    | response: <Response [200]>
2016-06-23 11:13:02,837 | putio        | DEBUG    | content: {
  "cursor": null, 
  "files": [], 
  "parent": {
    "content_type": "application/x-directory", 
    "crc32": null, 
    "created_at": "2016-01-17T00:10:26", 
    "extension": null, 
    "file_type": "FOLDER", 
    "first_accessed_at": null, 
    "folder_type": "SHARED_ROOT", 
    "icon": "https://api.put.io/images/file_types/folder.png", 
    "id": 333998564, 
    "is_hidden": true, 
    "is_mp4_available": false, 
    "is_shared": true, 
    "name": "items shared with you", 
    "opensubtitles_hash": null, 
    "parent_id": 0, 
    "screenshot": null, 
    "size": 0
  }, 
  "status": "OK"
}
2016-06-23 11:13:02,837 | putio        | DEBUG    | url: https://api.put.io/v2/files/delete
c2016-06-23 11:13:03,003 | requests.packages.urllib3.connectionpool | DEBUG    | "POST /v2/files/delete?oauth_token=XXXXXXXX HTTP/1.1" 400 218
2016-06-23 11:13:03,005 | putio        | DEBUG    | response: <Response [400]>
2016-06-23 11:13:03,005 | putio        | DEBUG    | content: {
  "error_message": "The browser (or proxy) sent a request that this server could not understand.",
  "error_type": "BadRequest",
  "error_uri": "http://api.put.io/v2/docs",
  "status": "ERROR",
  "status_code": 400
}
2016-06-23 11:13:03,005 | putiosync    | ERROR    | Unexpected error while performing check/download
Traceback (most recent call last):
  File "build/bdist.freebsd-10.3-STABLE-amd64/egg/putiosync/core.py", line 194, in _perform_single_check
    self._queue_download(putio_file)
  File "build/bdist.freebsd-10.3-STABLE-amd64/egg/putiosync/core.py", line 185, in _queue_download
    putio_file.delete()
  File "/usr/local/lib/python2.7/site-packages/putio.py", line 208, in delete
    data={'file_ids': str(self.id)})
  File "/usr/local/lib/python2.7/site-packages/putio.py", line 106, in request
    raise Exception(response['error_type'])
Exception: BadRequest

Not an issue on putiosync's end unless you want to change the way it handles the "items shared with you" folder since it can't be deleted/removed and putio-sync's default behavior is to remove empty folders.

I contacted put.io and had them remove that folder from my box but they just un-hid it.

Updated for clarity.

domainzero commented 8 years ago

This issue has gone away for me. Put.io must have changed the visibility of that folder now. Are you still getting this issue, @xsteadfastx?

xsteadfastx commented 8 years ago

Looks good to me. Yeah ☺️

Am 5. Juli 2016 19:17:49 MESZ, schrieb domainzero notifications@github.com:

This issue has gone away for me. Put.io must have changed the visibility of that folder now. Are you still getting this issue, @xsteadfastx?


You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/posborne/putio-sync/issues/30#issuecomment-230542630

posborne commented 8 years ago

👍