Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Install Synchronator
-
@bennr01
Thanks. That's clear. -
I have been doing a substantial amount of debugging on Synchronator and have discovered that requests tends to be the problem. Don't get me wrong, it is a wonderful module, but it has introduced dependencies that make it tricky to use in Pythonista.
First, Synchronator is dependent on the dropbox and requests modules. HOWEVER, requests is dependent on a number of modules that MUST be there before it can run. These are certifi, chardet, idna, and urllib3. Install the latest updates of these FIRST.
Once these are installed you should be able to install requests. If you ALREADY have requests installed, it is possible that it will prevent the other modules from installing. If you encounter this uninstall requests and install the other modules first. Then reinstall requests.
I was able to do all of this with the Stash module from within Pythonista.
Just a side note, all of these modules are Python 3 compatible so they can be moved into the site-packages directory.
At this point be sure to QUIT the Pythonista app and restart it. Now you should be able to run Synchronator.
This fixes a number of the issues people have reported, that were due to old versions of the requests module.
In addition I have fixed Synchronator to preserve the case of the directories that it copies to/from Dropbox.
Sorry for the delay on my part getting to these issues.
-
I have successfully been using Synchronator for sometime now but recently I started to have a problem on my iPhone with version 1.8. I downloaded the latest version 1.11 and now I am getting a different error. Can someone help me diagnose the problem?
-
Dropbox File Syncronization *
Loading Local State
Cannot Find State File -- Creating New Local State
Updating From Dropbox
Traceback (most recent call last):
File "/private/var/mobile/Containers/Shared/AppGroup/A7D4C56F-A77A-4D88-87AC-A52286C0CF04/Pythonista3/Documents/Synchronator/Synchronator.py", line 403, in <module>
check_remote(dbx, state)
File "/private/var/mobile/Containers/Shared/AppGroup/A7D4C56F-A77A-4D88-87AC-A52286C0CF04/Pythonista3/Documents/Synchronator/Synchronator.py", line 282, in check_remote
state.execute_delta(dbx)
File "/private/var/mobile/Containers/Shared/AppGroup/A7D4C56F-A77A-4D88-87AC-A52286C0CF04/Pythonista3/Documents/Synchronator/Synchronator.py", line 149, in execute_delta
results = dbx.files_list_folder(path='', recursive=True)
File "/private/var/mobile/Containers/Shared/AppGroup/A7D4C56F-A77A-4D88-87AC-A52286C0CF04/Pythonista3/Documents/site-packages-2/dropbox/base.py", line 1618, in files_list_folder
None,
File "/private/var/mobile/Containers/Shared/AppGroup/A7D4C56F-A77A-4D88-87AC-A52286C0CF04/Pythonista3/Documents/site-packages-2/dropbox/dropbox.py", line 274, in request
timeout=timeout)
File "/private/var/mobile/Containers/Shared/AppGroup/A7D4C56F-A77A-4D88-87AC-A52286C0CF04/Pythonista3/Documents/site-packages-2/dropbox/dropbox.py", line 365, in request_json_string_with_retry
timeout=timeout)
File "/private/var/mobile/Containers/Shared/AppGroup/A7D4C56F-A77A-4D88-87AC-A52286C0CF04/Pythonista3/Documents/site-packages-2/dropbox/dropbox.py", line 449, in request_json_string
timeout=timeout,
File "/var/containers/Bundle/Application/A44E8EB4-608D-4EBA-A6D7-8A2F5E7B7D3C/Pythonista3.app/Frameworks/Py2Kit.framework/pylib/site-packages/requests/sessions.py", line 505, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/var/containers/Bundle/Application/A44E8EB4-608D-4EBA-A6D7-8A2F5E7B7D3C/Pythonista3.app/Frameworks/Py2Kit.framework/pylib/site-packages/requests/sessions.py", line 462, in request
resp = self.send(prep, **send_kwargs)
File "/var/containers/Bundle/Application/A44E8EB4-608D-4EBA-A6D7-8A2F5E7B7D3C/Pythonista3.app/Frameworks/Py2Kit.framework/pylib/site-packages/requests/sessions.py", line 574, in send
r = adapter.send(request, **kwargs)
File "/var/containers/Bundle/Application/A44E8EB4-608D-4EBA-A6D7-8A2F5E7B7D3C/Pythonista3.app/Frameworks/Py2Kit.framework/pylib/site-packages/requests/adapters.py", line 371, in send
timeout=timeout
File "/var/containers/Bundle/Application/A44E8EB4-608D-4EBA-A6D7-8A2F5E7B7D3C/Pythonista3.app/Frameworks/Py2Kit.framework/pylib/site-packages/urllib3/connectionpool.py", line 566, in urlopen
timeout_obj = self._get_timeout(timeout)
File "/var/containers/Bundle/Application/A44E8EB4-608D-4EBA-A6D7-8A2F5E7B7D3C/Pythonista3.app/Frameworks/Py2Kit.framework/pylib/site-packages/urllib3/connectionpool.py", line 309, in _get_timeout
return Timeout.from_float(timeout)
File "/var/containers/Bundle/Application/A44E8EB4-608D-4EBA-A6D7-8A2F5E7B7D3C/Pythonista3.app/Frameworks/Py2Kit.framework/pylib/site-packages/urllib3/util/timeout.py", line 155, in from_float
return Timeout(read=timeout, connect=timeout)
File "/var/containers/Bundle/Application/A44E8EB4-608D-4EBA-A6D7-8A2F5E7B7D3C/Pythonista3.app/Frameworks/Py2Kit.framework/pylib/site-packages/urllib3/util/timeout.py", line 98, in init
self._connect = self._validate_timeout(connect, 'connect')
File "/var/containers/Bundle/Application/A44E8EB4-608D-4EBA-A6D7-8A2F5E7B7D3C/Pythonista3.app/Frameworks/Py2Kit.framework/pylib/site-packages/urllib3/util/timeout.py", line 128, in _validate_timeout
"int or float." % (name, value))
ValueError: Timeout value connect was Timeout(connect=30, read=30, total=None), but it must be an int or float. -
-
Did you check all the versions of modules, as I described in an earlier message?
-
Yes, I thought I had all the correct versions installed but I just redid some and now the iPad can run Synchronator just fine. However, on the iPhone I redid some installs and now there is a problem with 'import requests' in that it seems to be missing chardet. If I try pip update chardet or pip install chardet, I get the message No module Chardet. Catch-22?
-
OK, I deleted the site-packages version of requests and did all of the installs per @markhamilton1 and now Synchronator runs for a bit and then crashes with:
Traceback (most recent call last):
File "/private/var/mobile/Containers/Shared/AppGroup/A7D4C56F-A77A-4D88-87AC-A52286C0CF04/Pythonista3/Documents//site-packages-2/Synchronator/Synchronator.py", line 403, in <module>
check_remote(dbx, state)
File "/private/var/mobile/Containers/Shared/AppGroup/A7D4C56F-A77A-4D88-87AC-A52286C0CF04/Pythonista3/Documents//site-packages-2/Synchronator/Synchronator.py", line 282, in check_remote
state.execute_delta(dbx)
File "/private/var/mobile/Containers/Shared/AppGroup/A7D4C56F-A77A-4D88-87AC-A52286C0CF04/Pythonista3/Documents//site-packages-2/Synchronator/Synchronator.py", line 152, in execute_delta
self.__process_remote_entries(results.entries, current_remote_file_paths)
File "/private/var/mobile/Containers/Shared/AppGroup/A7D4C56F-A77A-4D88-87AC-A52286C0CF04/Pythonista3/Documents//site-packages-2/Synchronator/Synchronator.py", line 242, in __process_remote_entries
self.download_remote(dbx, entry_path, '-- Not Found Locally')
File "/private/var/mobile/Containers/Shared/AppGroup/A7D4C56F-A77A-4D88-87AC-A52286C0CF04/Pythonista3/Documents//site-packages-2/Synchronator/Synchronator.py", line 139, in download_remote
result = dbx.files_download_to_file(path, os.path.join('/', path))
File "/private/var/mobile/Containers/Shared/AppGroup/A7D4C56F-A77A-4D88-87AC-A52286C0CF04/Pythonista3/Documents/site-packages-2/dropbox/base.py", line 1175, in files_download_to_file
None,
File "/private/var/mobile/Containers/Shared/AppGroup/A7D4C56F-A77A-4D88-87AC-A52286C0CF04/Pythonista3/Documents/site-packages-2/dropbox/dropbox.py", line 296, in request
user_message_locale)
dropbox.exceptions.ApiError: ApiError('1905da0107ff33cb011b4305be613b5f', DownloadError(u'path', LookupError(u'not_found', None))) -
It's interesting that I never installed requests, certifi, idna, or chardet on the iPad yet Synchronator runs fine. On the iPhone those installs seem to be necessary, yet it crashes.
-
It looks like the iPad is running Synchronator v1.8 (works) and iPhone has v1.11 (crashes).
-
I tried deleting Synchronator and starting all over again on the iPhone following the directions above. Synchronator starts and begins Updating from Dropbox, downloads a dozen files and then the script dies. The traceback is as follows:
Traceback (most recent call last):
File "/private/var/mobile/Containers/Shared/AppGroup/A7D4C56F-A77A-4D88-87AC-A52286C0CF04/Pythonista3/Documents/Synchronator/Synchronator.py", line 403, in <module>
check_remote(dbx, state)
File "/private/var/mobile/Containers/Shared/AppGroup/A7D4C56F-A77A-4D88-87AC-A52286C0CF04/Pythonista3/Documents/Synchronator/Synchronator.py", line 282, in check_remote
state.execute_delta(dbx)
File "/private/var/mobile/Containers/Shared/AppGroup/A7D4C56F-A77A-4D88-87AC-A52286C0CF04/Pythonista3/Documents/Synchronator/Synchronator.py", line 152, in execute_delta
self.__process_remote_entries(results.entries, current_remote_file_paths)
File "/private/var/mobile/Containers/Shared/AppGroup/A7D4C56F-A77A-4D88-87AC-A52286C0CF04/Pythonista3/Documents/Synchronator/Synchronator.py", line 242, in __process_remote_entries
self.download_remote(dbx, entry_path, '-- Not Found Locally')
File "/private/var/mobile/Containers/Shared/AppGroup/A7D4C56F-A77A-4D88-87AC-A52286C0CF04/Pythonista3/Documents/Synchronator/Synchronator.py", line 139, in download_remote
result = dbx.files_download_to_file(path, os.path.join('/', path))
File "/private/var/mobile/Containers/Shared/AppGroup/A7D4C56F-A77A-4D88-87AC-A52286C0CF04/Pythonista3/Documents/site-packages/dropbox/base.py", line 1175, in files_download_to_file
None,
File "/private/var/mobile/Containers/Shared/AppGroup/A7D4C56F-A77A-4D88-87AC-A52286C0CF04/Pythonista3/Documents/site-packages/dropbox/dropbox.py", line 296, in request
user_message_locale)
dropbox.exceptions.ApiError: ApiError('da9c4c00582c7cfa99818f98393be092', DownloadError('path', LookupError('not_found', None)))I would really like to get this working (reliably) on the iPad and iPhone. Can someone please help?
-
Can anyone please tell me what the problem is here or suggest how I can debug it? Synchronator (v1.11) gets to this point after downloading some files and then fails with the api error.
-
Looks like she synchronator is trying to download a file that doesn't exist in Dropbox. Why not fire up
import pdb
pdb.pm()And figure out which file it is trying to download..
Alternatively it might be saying that your destination path doesn't exist - you'd have to look at the code to see specifically what the issue is
-
Seems
path
needs to be the full remote Dropbox path. Maybe synchronator needs to know how you have your Dropbox folders set up .. -
pdb.pm() shows:
pdb.pm()
/private/var/mobile/Containers/Shared/AppGroup/A7D4C56F-A77A-4D88-87AC-A52286C0CF04/Pythonista3/Documents/site-packages/dropbox/dropbox.py(296)request()
-> user_message_locale)
(Pdb)I thought it was possible for me to sync my iPhone and iPad to the same Dropbox directory so that any changes to one would be reflected in changes to the other but perhaps I can't do that?
-
pdb lets you enter a debugging state, that lets you walk up the stack frame, interrogating variables, etc.
for instance here i would be interested in you pressin
u
a few times until you are at line 242 in Synchronator:self.download_remote(dbx, entry_path, '-- Not Found Locally')
then typing
print(entry_path)
(press q to exit pdb)
Alternatively, add a print(entry_path) before that line, and then we can see which(if any) files succeed, and which one failed, then figure out which one failed.
if you are saying it works for a while, then craps out, it may be you are violating a dropbox rate api, and need to add some time.sleep's between each file.
-
I did what you said and the Print(entry_path) shows Examples/Calculator.py/Calculator.py
AFAICT that file is not on the iPhone nor is it in the Dropbox backup.
I can replace everything on the iPhone with the Dropbox backup (which is from the iPad) but I don't know of an option in Synchronator to do that.
-
hmm. you could just try/except around the line throwing the failure you are getting, so at least the valid files get restored.
Do you have an Examples/Calculator.py?
-
Oddly ther is a directory with that name but it is empty. I tried putting a copy of Calculator.py in there and I get the same error from Synchronator for the same file. ??
-
@ihf If you have to many issues with getting dropbox to run, you can also use the
mc
andmount
commands in StaSh with py2, which support dropbox. For help, seeman mounting
.