akonadi-ews icon indicating copy to clipboard operation
akonadi-ews copied to clipboard

Failed to process EWS request - HTTP code 400

Open simgunz opened this issue 4 years ago • 3 comments

When I try to add an EWS resource I get the following error.

Here I have configured the resource using OAtuh. The authentication seems to work but than I get a error 400 without further motivations.

Server autodiscovery fails, so I have used this link: https://myserver.com/ews/exchange.asmx

$ QT_LOGGING_RULE=log_ews_resource_request.debug=true /usr/bin/akonadi_ews_resource --identifier akonadi_ews_resource_0                                                       
Please register the custom scheme 'urn' via QWebEngineUrlScheme::registerScheme() before installing the custom scheme handler.
org.kde.pim.ews.client: Failed to process EWS request - HTTP code 400
ERROR "Failed to process EWS request - HTTP code 400"
org.kde.pim.ews.client: Failed to process EWS request - HTTP code 400
org.kde.pim.ews.client: Failed to process EWS request - HTTP code 400
org.kde.pim.ews.client: Failed to process EWS request - HTTP code 400
org.kde.pim.ews.client: Failed to process EWS request - HTTP code 400
ERROR "Failed to process EWS request - HTTP code 400"
Please register the custom scheme 'urn' via QWebEngineUrlScheme::registerScheme() before installing the custom scheme handler.
org.kde.pim.ews.client: Starting OAuth2 authentication
org.kde.pim.ews.client: Launching browser for authentication
org.kde.pim.ews.client: PKeyAuth certificates not found
js: Error parsing a meta element's content: ';' is not a valid key-value pair separator. Please use ',' instead.
qt.xkb.compose: failed to create compose table
org.kde.pim.ews.client: Authentication succeeded
org.kde.pim.ews.client: Failed to process EWS request - HTTP code 400

simgunz avatar Oct 23 '19 15:10 simgunz

Using username/password authentication plus the fix reported in https://bugs.kde.org/show_bug.cgi?id=402780 I managed to login.

simgunz avatar Oct 30 '19 09:10 simgunz

I can't use the workaround. This is the akonadi log:

[2022-11-03T17:17:19.678Z] akonadi_ews_resource default Please register the custom scheme 'urn' via QWebEngineUrlScheme::registerScheme() before installing the custom scheme handler.
[2022-11-03T17:17:19.678Z] akonadi_ews_resource org.kde.pim.ews.client Starting OAuth2 authentication
[2022-11-03T17:17:19.990Z] akonadi_ews_resource org.kde.pim.ews.client Authentication succeeded
[2022-11-03T17:17:19.998Z] akonadi_ews_resource org.kde.pim.ews.client.proto "<?xml version=\"1.0\"?><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:m=\"http://schemas.microsoft.com/exchange/services/2006/messages\" xmlns:t=\"http://schemas.microsoft.com/exchange/services/2006/types\"><soap:Header><t:RequestServerVersion Version=\"Exchange2007_SP1\"/></soap:Header><soap:Body><m:GetFolder><m:FolderShape><t:BaseShape>IdOnly</t:BaseShape></m:FolderShape><m:FolderIds><t:DistinguishedFolderId Id=\"inbox\"/></m:FolderIds></m:GetFolder></soap:Body></soap:Envelope>\n"
[2022-11-03T17:17:19.998Z] akonadi_ews_resource org.kde.pim.ews.client.request Starting GetFolder request (QVector(EwsId(Distinguished: inbox)))
[2022-11-03T17:17:20.122Z] akonadi_ews_resource org.kde.pim.ews.client.proto data KIO::TransferJob(0x5647e253a7e0) "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\"http://www.w3.org/TR/html4/strict.dtd\">\r\n<HTML><HEAD><TITLE>Bad Request</TITLE>\r\n<META HTTP-EQUIV=\"Content-Type\" Content=\"text/html; charset=us-ascii\"></HEAD>\r\n<BODY><h2>Bad Request - Invalid Header</h2>\r\n<hr><p>HTTP Error 400. The request has an invalid header name.</p>\r\n</BODY></HTML>\r\n"
[2022-11-03T17:17:20.122Z] akonadi_ews_resource org.kde.pim.ews.client.proto data KIO::TransferJob(0x5647e253a7e0) ""
[2022-11-03T17:17:20.123Z] akonadi_ews_resource org.kde.pim.ews.client.proto response dumped to "/tmp/akonadi-ews-IXJIFPF/ews_xmldump_GaBxIzI.xml"
[2022-11-03T17:17:20.123Z] akonadi_ews_resource org.kde.pim.ews.client Failed to process EWS request - HTTP code 400

@KrissN any change of getting this running?

kalmarek avatar Nov 03 '22 17:11 kalmarek

I just had this exact error, and the problem was that there was whitespace at the end of the URL. It was added there when I copied and pasted the URL from an email. Once I deleted the whitespace, the error 400 went away.

Hopefully, that was your problem, and knocking out the whitespace fixes it for you.

tilghman avatar Aug 31 '23 18:08 tilghman