更新配置文件时出现错误状态409

时间:2013-09-24 16:14:53

标签: google-api google-contacts google-api-python-client

我坚持这个:

数千个配置文件在更新时仍然失败。我不知道他们有什么问题。 你能看看这些吗?

提交的个人资料/联系人条目:

<ns0:entry xmlns:ns0="http://www.w3.org/2005/Atom" xmlns:ns1="http://schemas.google.com/g/2005" xmlns:ns2="http://www.w3.org/2007/app" xmlns:ns3="http://schemas.google.com/contact/2008" ns1:etag="&quot;WhcGQ08KRCt7I2A_&quot;"><ns0:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/contact/2008#profile" /><ns0:id>http://www.google.com/m8/feeds/profiles/domain/<domain>/full/<username></ns0:id><ns1:name><ns1:familyName>Xxxxxxxx xx Xxxx Xxxxxxx</ns1:familyName><ns1:fullName>Xxxxxxx Xxxxxxxx xx Xxxx Xxxxxxx</ns1:fullName><ns1:givenName>Xxxxxxx</ns1:givenName></ns1:name><ns0:updated>2013-09-09T21:26:21.000Z</ns0:updated><ns1:phoneNumber label="Xxxxxxxxx">1234</ns1:phoneNumber><ns1:phoneNumber rel="http://schemas.google.com/g/2005#work">123 456 789</ns1:phoneNumber><ns1:organization rel="http://schemas.google.com/g/2005#work"><ns1:orgDepartment>Xxxxxxxx 123-X</ns1:orgDepartment><ns1:orgName>Xxxxxxxx xx Xxxxxxx</ns1:orgName></ns1:organization><ns0:title>Xxxxxxx Xxxxxxxx xx Xxxx Xxxxxxx</ns0:title><ns0:link href="https://www.google.com/m8/feeds/photos/profile/<domain>/<username>" rel="http://schemas.google.com/contacts/2008/rel#photo" type="image/*" /><ns0:link href="https://www.google.com/m8/feeds/profiles/domain/<domain>/full/<username>" rel="self" type="application/atom+xml" /><ns0:link href="https://www.google.com/m8/feeds/profiles/domain/<domain>/full/<username>" rel="edit" type="application/atom+xml" /><ns1:email address="<username>@<domain>" primary="true" rel="http://schemas.google.com/g/2005#work" /><ns2:edited>2013-09-09T21:26:21.000Z</ns2:edited><ns3:status indexed="true" /></ns0:entry>

回应是:

Server responded with: 409, <?xml version='1.0' encoding='UTF-8'?><entry xmlns='http://www.w3.org/2005/Atom' xmlns:gContact='http://schemas.google.com/contact/2008' xmlns:batch='http://schemas.google.com/gdata/batch' xmlns:gd='http://schemas.google.com/g/2005' gd:etag='&quot;WxRTFUUNRit7I2Bu&quot;'><id>http://www.google.com/m8/feeds/profiles/domain/<domain>/full/<username></id><updated>2013-09-09T21:26:21.000Z</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2013-09-09T21:26:21.000Z</app:edited><category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/contact/2008#profile'/><title>Xxxxxxx Xxxxxxxx xx Xxxx Xxxxxxx</title><link rel='http://schemas.google.com/contacts/2008/rel#photo' type='image/*' href='https://www.google.com/m8/feeds/photos/profile/deusto.es/a.mdel'/><link rel='self' type='application/atom+xml' href='https://www.google.com/m8/feeds/profiles/domain/<domain>/full/<username>'/><link rel='edit' type='application/atom+xml' href='https://www.google.com/m8/feeds/profiles/domain/<domain>/full/<username>'/><gd:name><gd:fullName>Xxxxxxx Xxxxxxxx xx Xxxx Xxxxxxx</gd:fullName><gd:givenName>Xxxxxxx</gd:givenName><gd:familyName>Xxxxxxxx xx Xxxx Xxxxxxx</gd:familyName></gd:name><gContact:status indexed='true'/><gd:email rel='http://schemas.google.com/g/2005#work' address='<username>@<domain>' primary='true'/></entry>



代码

import gdata.contacts.client

client = gdata.contacts.client.ContactsClient(domain='mydomain')
client.ClientLogin(email='superuser@mydomain', password='password', source='mydomain-myapp', account_type='HOSTED', service='cp')
client.UpdateProfile(profile)

我知道ClientLogin已被弃用,但是..有人可以尝试重现此错误吗?

1 个答案:

答案 0 :(得分:0)

解决

在阅读this之后,我看到409响应状态错误正在发生,因为联系人/个人资料条目正在从两个来源更新,因此结果是版本冲突。