fmbiete / Z-Push-contrib

Z-Push fork with changes that I will try to contrib
GNU Affero General Public License v3.0
135 stars 62 forks source link

Invalid input XML: not a mobilesync responseschema. #81

Open jkaberg opened 10 years ago

jkaberg commented 10 years ago

I'm getting this everytime I try to connect to z-push/ActiveSync (from Outlook 2013),

19/08/2014 16:18:44 [ 3677] [INFO] AuthenticationRequiredException: Unauthorized - code: 0 19/08/2014 16:18:44 [ 3677] [WARN] /usr/local/lib/z-push/autodiscover/autodiscover.php:115 Undefined variable: incomingXml (8) 19/08/2014 16:18:44 [ 3677] [WARN] /usr/local/lib/z-push/autodiscover/autodiscover.php:115 Trying to get property of non-object (8) 19/08/2014 16:18:44 [ 3677] [WARN] /usr/local/lib/z-push/autodiscover/autodiscover.php:115 Trying to get property of non-object (8) 19/08/2014 16:18:44 [ 3677] [ERROR] Unable to complete autodiscover because login failed for user with email '' 19/08/2014 16:18:44 [ 3677] [FATAL] FatalException: Invalid input XML: not a mobilesync responseschema. - code: 0 19/08/2014 16:18:44 [ 3677] [ERROR] Unable to complete autodiscover because of ZPushException. Error: Invalid input XML: not a mobilesync responseschema.

Obviously becasue the schema can't be found;

http://schemas.microsoft.com/exchange/autodiscover/mobilesync/responseschema/2006

Any suggestions @fmbiete ?

jkaberg commented 10 years ago

If you have an office365 or outlook.com account you can view the (same) output here (as z-push would've pushed out) https://autodiscover-s.outlook.com/autodiscover/autodiscover.xml

fmbiete commented 10 years ago

Hi @jkaberg I fixed the undefined message and @JoshData pull request should resolve your previous error. If you can test again and let me know, that would be great :+1:

jkaberg commented 10 years ago

Thanks for looking into this @fmbiete

Still errors tho;

20/08/2014 18:46:00 [20728] [ERROR] Unable to complete autodiscover because login failed for user. Error: Unauthorized 20/08/2014 18:46:00 [20728] [FATAL] FatalException: Invalid input XML: not a mobilesync responseschema. - code: 0 20/08/2014 18:46:00 [20728] [ERROR] Unable to complete autodiscover because of ZPushException. Error: Invalid input XML: not a mobilesync responseschema.

Login details is correct, so IDK why that error msg (outlook 2013 setup wizard successfully logins via imap)

autodiscover.php can't fetch schema as it doesn't exist:

http://schemas.microsoft.com/exchange/autodiscover/mobilesync/responseschema/2006

fmbiete commented 10 years ago

Hi, since I don't have a outlook.com account. Could you post the autodiscover response? the log must be in WBXML level and use the code with the last commit, please.

What I think is happening is the response from outlook.com comes with a schema like this:

http://schemas.microsoft.com/exchange/autodiscover/mobilesync/responseschema/2006a

And we are comparing with the string http://schemas.microsoft.com/exchange/autodiscover/mobilesync/responseschema/2006

redhell commented 10 years ago

I changed the response scheme to http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006 and autodiscover works fine on iOS 7.1.2

fmbiete commented 10 years ago

Hi @redhell Could you post the autodiscover response? Thanks

redhell commented 10 years ago
<?xml version="1.0" encoding="utf-8"?>
<Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006">
<Response>
<Culture>en:us</Culture>
<User>
<DisplayName>test@domain.tld</DisplayName>
<EMailAddress>test@domain.tld</EMailAddress>
</User>
<Action>
<Settings>
<Server>
<Type>MobileSync</Type>
<Url>https://domain.tld/Microsoft-Server-ActiveSync</Url>
<Name>https://domain.tld/Microsoft-Server-ActiveSync</Name>
</Server>
</Settings>
</Action>
</Response>
</Autodiscover>
jkaberg commented 10 years ago

@redhell Tried that, still errors in /var/log/z-push/autodiscover-error.log

21/08/2014 11:50:43 [27009] [FATAL] FatalException: Invalid input XML: not a mobilesync responseschema. - code: 0 21/08/2014 11:50:43 [27009] [ERROR] Unable to complete autodiscover because of ZPushException. Error: Invalid input XML: not a mobilesync responseschema.

(latest z-push from @fmbiete master branch)

redhell commented 10 years ago

@jkaberg in the response.xml

<?xml version="1.0" encoding="utf-8"?>
<Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006">
<Response>
<Culture>en:us</Culture>
<User>
<DisplayName></DisplayName>
<EMailAddress></EMailAddress>
</User>
<Action>
<Settings>
<Server>
<Type>MobileSync</Type>
<Url></Url>
<Name></Name>
</Server>
</Settings>
</Action>
</Response>
</Autodiscover>
jkaberg commented 10 years ago

@redhell Samme error still

It's trying to download the http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006 and I'm pretty sure thats why autodiscover.php errors

And just for the record, same error with this one aswell http://schemas.microsoft.com/exchange/autodiscover/mobilesync/responseschema/2006

Note: this only seems to happend with Outlook 2013. Haven't seen it with my android device

fmbiete commented 10 years ago

@jkaberg the schema is not downloaded when parsing a XML, it doesn't need to exists. But the code checks the schema URI against a hardcoded string. So if you autodiscover returns a different uri, will fail. The same was happening to @redhell, so look into your autodiscovery response to catch the URI, and we will think about a flexible solution for various uri

tigre-bleu commented 8 years ago

There is the same issue with linux if we try to configure an account with Gnome Online Accounts

11/12/2015 19:54:30 [20838] [WBXML] ZPushAutodiscover->getIncomingXml() incoming XML data:
<?xml version="1.0"?>
<Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/requestschema/2006">
  <Request>
    <EMailAddress>account@domain.tld</EMailAddress>
    <AcceptableResponseSchema>http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a</AcceptableResponseSchema>
  </Request>
</Autodiscover>

11/12/2015 19:54:30 [20838] [FATAL] FatalException: Invalid input XML: not a mobilesync responseschema. - code: 0