404 error on addressbook sync



  • Hello,

    I get regularly 404 errors. I know 404 is typcially a not found error. But

    public void propfind(HttpPropfind.Mode mode) throws URISyntaxException, IOException, DavException, HttpException {
    	@Cleanup CloseableHttpResponse response = null;
    
    	// processMultiStatus() requires knowledge of the actual content location,
    	// so we have to handle redirections manually and create a new request for the new location
    	for (int i = context.getRequestConfig().getMaxRedirects(); i > 0; i--) {
    		HttpPropfind propfind = new HttpPropfind(location, mode);
    		response = httpClient.execute(propfind, context);
    

    I can see in the debugger in the above code that location is

    http://my_server_name/owncloud/remote.php/carddav/addressbooks/familie/kontakte/

    I can call this URL on the Android device and after authentication I see the list of vCards in the browser. So it is not a network error.

    protected static void checkResponse(StatusLine statusLine) throws HttpException {
    	int code = statusLine.getStatusCode();
    

    Here code is a 404. I wonder what that could be, a "classical" 404 where the network resource is simply not reachable I would rule out since it works in the browser. It is all in my local LAN which works stable for all other usages.

    Any idea in what direction I can debug this?

    Thanks.


  • developer

    Hello,

    @Kalle said:

    I can call this URL on the Android device and after authentication I see the list of vCards in the browser. So it is not a network error.

    The error only occurs when sending a PROPFIND request. Browsers send GET requests, which have a different meaning and won't trigger the error.

    To check it with a non-DAVdroid client, you may use curl. Basic syntax:

    curl -X PROPFIND -H 'Depth: 1' -H 'Content-Type: application/xml' --data @propfind.xml -u your:credentials http://your-url
    

    with the request body in propfind.xml.

    Any idea in what direction I can debug this?

    It's a known OwnCloud bug, so I assume you're using OwnCloud (or at least a SabreDAV-based server). You can find more about it in the OwnCloud issues or even here in the forums, but I don't know where exactly (you'll have to search).

    And it's not related to DAVdroid, so I recommend to ask in your server software's support forums to get more competent help.



  • Hi,

    to me it looks that the owncloud developers have a different opinion on that. https://github.com/owncloud/core/issues/13313 What do you think?

    Second question: How does propfind.xml has to look like?

    Thanks, K.


  • developer

    @Kalle said:

    to me it looks that the owncloud developers have a different opinion on that. https://github.com/owncloud/core/issues/13313 What do you think?

    No, this is not related to your problem. The 404 discussed in this "issue" is in the response block of a single response block, and not the HTTP status. Also, it's only relevant for getcontenttype.

    You can find many related problem reports here.

    Second question: How does propfind.xml has to look like?

    Depends on what you'd like to do. You can enable verbose logging and see how the PROPFIND body sent by DAVdroid looks like, or you can construct your own one, see for instance Building a CalDAV client. See WebDAV/CalDAV/CardDAV RFCs for formal reference.



  • An update to OC 8.2.1 solved it for one device, but not for another. An update to davdroid 0.9.1.2 solved it for the other device. So not too sure what the issue was exactly.



Looks like your connection to Bitfire App Forums was lost, please wait while we try to reconnect.