Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove gdata bundling as submodule to make ASynK work as a Debian package #93

Closed
dieter-wilhelm opened this issue May 14, 2016 · 19 comments

Comments

@dieter-wilhelm
Copy link
Contributor

I downloaded the latest release and tried:
$ ./asynk.py -h
Traceback (most recent call last):
File "./asynk.py", line 31, in
from asynk_core import Asynk, AsynkParserError
File "/appl/tools/ASynK-2.2.0/asynk/asynk_core.py", line 40, in
from sync import Sync
File "/appl/tools/ASynK-2.2.0/asynk/sync.py", line 28, in
import atom, gdata
ImportError: No module named atom

what do you suggest? It is not clear to me from the files requirements.txt if the names are python or distribution packages, how can I check the dependencies or download them?

@skarra
Copy link
Owner

skarra commented May 25, 2016

I suspect you did not clone recursively. The missing libraries are a part of the a submodule.

@dieter-wilhelm
Copy link
Contributor Author

Sriram Karra [email protected] writes:

I suspect you did not clone recursively. The missing libraries are a part of the a submodule.

I see. In fact I downloaded the latest release (v2.2.0) as a gzipped
file...

I'll try now to clone your repo and try from there.

Thanks a lot for the hint

   Dieter


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub

Best wishes
H. Dieter Wilhelm
Kelkheim, Germany

@vincentbernat
Copy link

Another solution would be to install python-gdata package.

@dieter-wilhelm
Copy link
Contributor Author

Thanks Vincent for the pointer, I installed python-gdata (and had to install python-httplib2 as well)
but now I'm stuck again:
ImportError: No module named apiclient
where do I get the apiclient module from?
Have a nice day
Dieter

@vincentbernat
Copy link

It's python-googleapi.

@dieter-wilhelm
Copy link
Contributor Author

dieter-wilhelm commented May 31, 2016

Excuse my inexperience...
Now the python executable is running 👍 Thank you

@skarra
Copy link
Owner

skarra commented May 31, 2016

Regarding Zip file not including the submodules, that is a limitation of Github that we have to live with for now: wbond/package_control#126 (comment)

With regards to using python-googleapi, the reason I bundle it as a submodule is because it contains a patch that is required for ASynK to work properly. Can one of you confirm that you are able to use ASynK to do bi-directional sync using the python-googleapi library?

@vincentbernat
Copy link

In my case, I wasn't able to but I didn't know the exact reason.

Maybe, you could consider monkey-patching instead? I would like to take over this ITP in Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=709161. And ASynK should work with what is packaged in Debian for this to be possible.

@skarra
Copy link
Owner

skarra commented May 31, 2016

I see; I will explore that option.

@skarra skarra changed the title Import Error: No module named atom, ASynK-2.2.0 on Debian 8.4 (with pyhon 2.7.9) Remove gdata bundling as submodule to make ASynK work as a Debian package May 31, 2016
@dieter-wilhelm
Copy link
Contributor Author

dieter-wilhelm commented Jun 1, 2016

I tried first:
./asynk.py --op=list-folders --dry-run --log=debug --db=gc
this shows (after other messages):

  INFO:root:Staring the wonderful oAuth dance...
[08:08:36.170     INFO] Staring the wonderful oAuth dance...
Traceback (most recent call last):
  File "./asynk.py", line 321, in <module>
    main()
  File "./asynk.py", line 318, in main
    asynk.dispatch()
  File "/appl/tools/ASynK-2.2.0/asynk/asynk_core.py", line 97, in dispatch
    res = getattr(self, self.get_op())()
  File "/appl/tools/ASynK-2.2.0/asynk/asynk_core.py", line 116, in op_list_folders
    self._login()
  File "/appl/tools/ASynK-2.2.0/asynk/asynk_core.py", line 85, in _login
    coll.login()
  File "/appl/tools/ASynK-2.2.0/asynk/state_collection.py", line 336, in login
    self.get_username(), self.get_pwd())
  File "/appl/tools/ASynK-2.2.0/asynk/pimdb_gc.py", line 66, in __init__
    self.gc_init()
  File "/appl/tools/ASynK-2.2.0/asynk/pimdb_gc.py", line 267, in gc_init
    self.credentials = self._oauth_dance(storage)
  File "/appl/tools/ASynK-2.2.0/asynk/pimdb_gc.py", line 245, in _oauth_dance
    redirect_uri='http://localhost:%d' % port)
  File "/usr/lib/python2.7/dist-packages/oauth2client/util.py", line 132, in positional_wr
apper                                                                                    
    return wrapped(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/oauth2client/client.py", line 1343, in flow_from_
clientsecrets                                                                            
    client_type, client_info = clientsecrets.loadfile(filename, cache=cache)
  File "/usr/lib/python2.7/dist-packages/oauth2client/clientsecrets.py", line 145, in load
file                                                                                     
    return _loadfile(filename)
  File "/usr/lib/python2.7/dist-packages/oauth2client/clientsecrets.py", line 107, in _loa
dfile                                                                                    
    raise InvalidClientSecretsError('File not found: "%s"' % filename)
oauth2client.clientsecrets.InvalidClientSecretsError: File not found: "/appl/tools/ASynK-2
.2.0/XXXXXXX"    

Where XXXXX is representing my clear text password!? I was doing this in an
Emacs terminal window (if that matters).
Could you please tell me how I should proceed? Thanks a lot...

@vincentbernat
Copy link

@skarra Note that you can keep the unmodified bundle if it makes things easier for people. We just need to ensure it also works without the bundle.

@vincentbernat
Copy link

@dieter-wilhelm For Google Calendar, you need to follow instructions here: https://github.com/skarra/ASynK/blob/master/README-google-oauth.md

@dieter-wilhelm
Copy link
Contributor Author

dieter-wilhelm commented Jun 1, 2016

@vincentbernat thanks, I created now credentials (for a web application) and submitted the .json file as my "password" but this isn't working either:

File "/appl/tools/ASynK-2.2.0/asynk/pimdb_gc.py", line 267, in gc_init
    self.credentials = self._oauth_dance(storage)
  File "/appl/tools/ASynK-2.2.0/asynk/pimdb_gc.py", line 245, in _oauth_dance
    redirect_uri='http://localhost:%d' % port)
  File "/usr/lib/python2.7/dist-packages/oauth2client/util.py", line 132, in positional_wr
apper                                                                                    
    return wrapped(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/oauth2client/client.py", line 1343, in flow_from_
clientsecrets                                                                            
    client_type, client_info = clientsecrets.loadfile(filename, cache=cache)
  File "/usr/lib/python2.7/dist-packages/oauth2client/clientsecrets.py", line 145, in load
file                                                                                     
    return _loadfile(filename)
  File "/usr/lib/python2.7/dist-packages/oauth2client/clientsecrets.py", line 108, in _loa
dfile                                                                                    
    return _validate_clientsecrets(obj)
  File "/usr/lib/python2.7/dist-packages/oauth2client/clientsecrets.py", line 81, in _vali
date_clientsecrets                                                                       
    client_type))
oauth2client.clientsecrets.InvalidClientSecretsError: Missing property "redirect_uris" in 
a client type of "web".                                                                  


@skarra
Copy link
Owner

skarra commented Jun 1, 2016

It looks like the JSON file you have is "corrupted" in some form. Your JSON should look like this:

{
    "installed":{
        "auth_uri":"https://accounts.google.com/o/oauth2/auth",
        "client_secret":"XXXXXX",
        "token_uri":"https://accounts.google.com/o/oauth2/token",
        "client_email":"",
        "redirect_uris":[
            "urn:ietf:wg:oauth:2.0:oob",
            "oob"
        ],
        "client_x509_cert_url":"",
        "client_id":"YYYYYY.apps.googleusercontent.com",
        "auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs"
    }
}

@dieter-wilhelm
Copy link
Contributor Author

@skarra well, it looks like this:

{"web":
  {"client_id":"301031998349-gqo4e56hud2mmcrjipql1gh1s3rb95b9.apps.googleusercontent.com",
"project_id":"asynk-1329",
"auth_uri":"https://accounts.google.com/o/oauth2/auth",
"token_uri":"https://accounts.google.com/o/oauth2/token",
"auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs",
"client_secret":"XXXXXXXXXXXXXX"}}

@skarra
Copy link
Owner

skarra commented Jun 1, 2016

I think you have not followed all the steps in this doc correctly: https://github.com/skarra/ASynK/blob/master/README-google-oauth.md Specifically I think bullet 6 of Step 1.

@dieter-wilhelm
Copy link
Contributor Author

@skarra i'm sorry you are right, I'll redo it this evening... and thanks a lot!

@dieter-wilhelm
Copy link
Contributor Author

dieter-wilhelm commented Jun 1, 2016

@skarra hurrah it seems to work, there is some Glib-Critical assertion (please see below, I had to click in my browser some confirmation about accessing data...) but still I'm getting folders from my Google contacts. :-)

[22:04:39.428     INFO] Staring the wonderful oAuth dance...

(process:17251): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' fail
ed                                                                                       
INFO:oauth2client.client:Successfully retrieved access token
[22:04:57.424     INFO] Successfully retrieved access token
DEBUG:root:Getting Group List to populate folders...
[22:04:57.928    DEBUG] Getting Group List to populate folders...
DEBUG:root:Processing Folder: System Group: My Contacts...
[22:04:58.212    DEBUG] Processing Folder: System Group: My Contacts...
DEBUG:root:Processing Folder: System Group: Friends...

@skarra
Copy link
Owner

skarra commented Jun 2, 2016

Interesting; I don't recognize that assertion. But I am glad you are able to list your google contacts folders. I wll close this issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants