On Jul 16, 2014 2:12 AM, "Patrick Ohly" <patrick.ohly@intel.com> wrote:
> On Tue, 2014-07-15 at 23:37 +0800, Emfox Zhou wrote:
> > It output many lines such as:
> >
> >
> >
> > <d:href>/carddav/v1/principals/emfoxzhou@gmail.com/lists/default/xxxxxxx</d:href>
> >   <d:propstat>
> >    <d:status>HTTP/1.1 200 OK</d:status>
> >    <d:prop>
> >     <d:getetag>"2011-07-29T01:34:21.127-07:00"</d:getetag>
> >     <d:resourcetype/>
> >    </d:prop>
> >   </d:propstat>
> >  </d:response>
> That means it is talking to the server and credentials were okay.
> Now try
> SYNCEVOLUTION_DEBUG=1 syncevolution --daemon=no --export /dev/null loglevel=4 c102 addressbook
> Does that work repeatedly without authentication errors?

Yes, it repeatedly output endless before I press ctrl+c. the very last lines are:

Request ends, status 200 class 2xx, error line:200 OK
Running destroy hooks.
Request ends.
[DEBUG 00:01:37] starting GET, credentials okay, deadline in 300.0s
ah_create, for WWW-Authenticate
Running pre_send hooks
auth: Sending 'Basic' response.
Sending request headers:
GET /carddav/v1/principals/emfoxzhou%40gmail.com/lists/default/68795a1708f65ea0
Connection: TE
TE: trailers
Host: google.com
Content-Length: 0
Accept: text/vcard; charset=utf-8
Authorization: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Sending request-line and headers:
Request sent; retry is 1.

> I'm starting to suspect that you run into temporary requests by Google
> to log into their web form. SyncEvolution should work around that by
> resending requests with plain authentication.
> In your second sync output from two emails ago, the sync did proceed to
> the "download data" phase and the only unusual output were INFO
> messages, not ERRORs:
> [INFO] sync: /org/syncevolution/Session/15756214181405429789: operation
> temporarily (?) failed, going to retry in 4.8s before giving up in
> 299.8s: GET: Neon error code 3 = NE_AUTH, HTTP status 401: Could not
> authenticate to server: ignored GoogleLogin challenge
> How did that sync end? Successfully or with a failure?

Failure, the phone end up while the progress reached 6% and say "connection not usable", the server just repeatedly output the "temporarily (?) failed....." line hundred of times every several seconds, as every other time before.

> Google stopped supporting plain text authentication. At some point
> you'll have to get OAuth-based authentication working; unfortunately
> that is not easy on a headless server.

I have a big news, I tried another google account, this method works as a charm, all the contacts are synced,and my google app account, also works. from now on, 3 of other google accounts are all ok with the sync, but only not my main account. I try to find some different setting between my main account and other account, especially those security settings, but nothing useful found.  The only difference I can say is that the main account is registered long before (about 2006), and the others are later (between 2011 and 2014).