Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

always getting empty ACES #359

Closed
courville opened this issue Mar 4, 2023 · 14 comments
Closed

always getting empty ACES #359

courville opened this issue Mar 4, 2023 · 14 comments

Comments

@courville
Copy link

courville commented Mar 4, 2023

Hi, thanks a lot for sardine that I am trying to integrate into my application (nova video player).
I need to check if I can read or write on a specific url and I am trying to use:

boolean canRead = (sardine.getAcl(url).getAces().get(0).getGranted().get(0) == "read");
boolean canWrite = (sardine.getAcl(url).getAces().get(0).getGranted().get(1) == "write");

Unfortunately sardine.getAcl(url).getAces() is always empty and acl.getOwner(), acl.getGroup() are always null.
I used this following simple code (that works with sardine.list(url)):

package org.courville.sardinetest;

import com.github.sardine.*;

import java.io.IOException;
import java.util.List;

public class Main {
    public static void main(String[] args) {
        // arguments are: user password url
        Sardine sardine = SardineFactory.begin();
        sardine.setCredentials(args[0], args[1]);
        String url = args[2];

        DavAcl acl;
        try {
            acl = sardine.getAcl(url);
            System.out.println("fromUri owner=" + acl.getOwner() + ", group=" + acl.getGroup());
            List<DavAce> aces = acl.getAces();
            boolean canRead = false;
            boolean canWrite = false;
            if (! aces.isEmpty()) {
                canRead = (aces.get(0).getGranted().get(0) == "read");
                canWrite = (aces.get(0).getGranted().get(1) == "write");
            } else {
                System.out.println("fromUri: aces empty for uri=" + url);
            }
            System.out.println("fromUri: uri=" + url + ", canWrite=" + canWrite + ", canRead=" + canRead);
        } catch (IOException e) {
            System.out.println("IOException in getAcl");
        }
        //List<DavResource> resources = sardine.list(httpUri.toString());
    }
}

which outputs:

fromUri owner=null, group=null
fromUri: aces empty for uri=https://redacted/file.txt
fromUri: uri=https://redacted/file.txt, canWrite=false, canRead=false

Is this normal or am I doing something wrong?
Thank you in advance for any hints that would help me progress.

P.S.: some related comments can be found here #109

@lookfirst
Copy link
Owner

The best thing would be to turn on logging for the http client stuff and take a look at the request/response stuff at the http level.

@courville
Copy link
Author

courville commented Mar 23, 2023

@lookfirst, sorry, I should have provided wire/header logs in the first place and not a sample code to reproduce, here you go:

2023-03-23 15:17:17,372 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> PROPFIND /directory/file.mkv HTTP/1.1
2023-03-23 15:17:17,372 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Depth: 0
2023-03-23 15:17:17,372 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Content-Type: text/xml; charset=utf-8
2023-03-23 15:17:17,372 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Content-Length: 124
2023-03-23 15:17:17,372 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Host: home.courville.org:5006
2023-03-23 15:17:17,372 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Connection: Keep-Alive
2023-03-23 15:17:17,372 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> User-Agent: Sardine/5.10
2023-03-23 15:17:17,372 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Accept-Encoding: gzip,deflate
2023-03-23 15:17:17,373 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "PROPFIND /directory/file.mkv HTTP/1.1[\r][\n]"
2023-03-23 15:17:17,373 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Depth: 0[\r][\n]"
2023-03-23 15:17:17,373 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Content-Type: text/xml; charset=utf-8[\r][\n]"
2023-03-23 15:17:17,373 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Content-Length: 124[\r][\n]"
2023-03-23 15:17:17,373 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Host: home.courville.org:5006[\r][\n]"
2023-03-23 15:17:17,373 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
2023-03-23 15:17:17,373 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "User-Agent: Sardine/5.10[\r][\n]"
2023-03-23 15:17:17,373 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]"
2023-03-23 15:17:17,373 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "[\r][\n]"
2023-03-23 15:17:17,374 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "<?xml version="1.0" encoding="UTF-8" standalone="yes"?><propfind xmlns="DAV:"><prop><owner/><group/><acl/></prop></propfind>"
2023-03-23 15:17:17,542 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "HTTP/1.1 401 Unauthorized[\r][\n]"
2023-03-23 15:17:17,542 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Date: Thu, 23 Mar 2023 14:17:17 GMT[\r][\n]"
2023-03-23 15:17:17,542 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Server: Apache[\r][\n]"
2023-03-23 15:17:17,543 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "WWW-Authenticate: Basic realm="SYNO_WebDAV Storage"[\r][\n]"
2023-03-23 15:17:17,543 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Content-Length: 381[\r][\n]"
2023-03-23 15:17:17,543 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Keep-Alive: timeout=5, max=100[\r][\n]"
2023-03-23 15:17:17,543 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Connection: Keep-Alive[\r][\n]"
2023-03-23 15:17:17,543 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Content-Type: text/html; charset=iso-8859-1[\r][\n]"
2023-03-23 15:17:17,543 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "[\r][\n]"
2023-03-23 15:17:17,543 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">[\n]"
2023-03-23 15:17:17,543 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<html><head>[\n]"
2023-03-23 15:17:17,543 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<title>401 Unauthorized</title>[\n]"
2023-03-23 15:17:17,543 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "</head><body>[\n]"
2023-03-23 15:17:17,543 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<h1>Unauthorized</h1>[\n]"
2023-03-23 15:17:17,543 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<p>This server could not verify that you[\n]"
2023-03-23 15:17:17,543 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "are authorized to access the document[\n]"
2023-03-23 15:17:17,543 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "requested.  Either you supplied the wrong[\n]"
2023-03-23 15:17:17,543 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "credentials (e.g., bad password), or your[\n]"
2023-03-23 15:17:17,543 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "browser doesn't understand how to supply[\n]"
2023-03-23 15:17:17,543 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "the credentials required.</p>[\n]"
2023-03-23 15:17:17,543 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "</body></html>[\n]"
2023-03-23 15:17:17,546 [main] DEBUG org.apache.http.headers - http-outgoing-0 << HTTP/1.1 401 Unauthorized
2023-03-23 15:17:17,546 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Date: Thu, 23 Mar 2023 14:17:17 GMT
2023-03-23 15:17:17,546 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Server: Apache
2023-03-23 15:17:17,547 [main] DEBUG org.apache.http.headers - http-outgoing-0 << WWW-Authenticate: Basic realm="SYNO_WebDAV Storage"
2023-03-23 15:17:17,547 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Content-Length: 381
2023-03-23 15:17:17,547 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Keep-Alive: timeout=5, max=100
2023-03-23 15:17:17,547 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Connection: Keep-Alive
2023-03-23 15:17:17,547 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Content-Type: text/html; charset=iso-8859-1
2023-03-23 15:17:17,570 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> PROPFIND /directory/file.mkv HTTP/1.1
2023-03-23 15:17:17,571 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Depth: 0
2023-03-23 15:17:17,571 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Content-Type: text/xml; charset=utf-8
2023-03-23 15:17:17,571 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Content-Length: 124
2023-03-23 15:17:17,571 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Host: home.courville.org:5006
2023-03-23 15:17:17,571 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Connection: Keep-Alive
2023-03-23 15:17:17,571 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> User-Agent: Sardine/5.10
2023-03-23 15:17:17,571 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Accept-Encoding: gzip,deflate
2023-03-23 15:17:17,571 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Authorization: Basic bHVya2VyOmFpZzlVeWVp
2023-03-23 15:17:17,571 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "PROPFIND /directory/file.mkv HTTP/1.1[\r][\n]"
2023-03-23 15:17:17,571 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Depth: 0[\r][\n]"
2023-03-23 15:17:17,571 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Content-Type: text/xml; charset=utf-8[\r][\n]"
2023-03-23 15:17:17,571 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Content-Length: 124[\r][\n]"
2023-03-23 15:17:17,571 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Host: home.courville.org:5006[\r][\n]"
2023-03-23 15:17:17,571 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
2023-03-23 15:17:17,571 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "User-Agent: Sardine/5.10[\r][\n]"
2023-03-23 15:17:17,571 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]"
2023-03-23 15:17:17,571 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Authorization: Basic bHVya2VyOmFpZzlVeWVp[\r][\n]"
2023-03-23 15:17:17,571 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "[\r][\n]"
2023-03-23 15:17:17,571 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "<?xml version="1.0" encoding="UTF-8" standalone="yes"?><propfind xmlns="DAV:"><prop><owner/><group/><acl/></prop></propfind>"
2023-03-23 15:17:18,963 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "HTTP/1.1 207 Multi-Status[\r][\n]"
2023-03-23 15:17:18,967 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Date: Thu, 23 Mar 2023 14:17:17 GMT[\r][\n]"
2023-03-23 15:17:18,967 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Server: Apache[\r][\n]"
2023-03-23 15:17:18,967 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Content-Length: 358[\r][\n]"
2023-03-23 15:17:18,967 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Keep-Alive: timeout=5, max=99[\r][\n]"
2023-03-23 15:17:18,967 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Connection: Keep-Alive[\r][\n]"
2023-03-23 15:17:18,967 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Content-Type: text/xml; charset="utf-8"[\r][\n]"
2023-03-23 15:17:18,967 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "[\r][\n]"
2023-03-23 15:17:18,967 [main] DEBUG org.apache.http.headers - http-outgoing-0 << HTTP/1.1 207 Multi-Status
2023-03-23 15:17:18,967 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Date: Thu, 23 Mar 2023 14:17:17 GMT
2023-03-23 15:17:18,967 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Server: Apache
2023-03-23 15:17:18,967 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Content-Length: 358
2023-03-23 15:17:18,967 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Keep-Alive: timeout=5, max=99
2023-03-23 15:17:18,967 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Connection: Keep-Alive
2023-03-23 15:17:18,967 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Content-Type: text/xml; charset="utf-8"
2023-03-23 15:17:19,014 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<?xml version="1.0" encoding="utf-8"?>[\n]"
2023-03-23 15:17:19,015 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:multistatus xmlns:D="DAV:" xmlns:ns0="DAV:">[\n]"
2023-03-23 15:17:19,015 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:response xmlns:g0="DAV:">[\n]"
2023-03-23 15:17:19,015 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:href>/directory/file.mkv</D:href>[\n]"
2023-03-23 15:17:19,015 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:propstat>[\n]"
2023-03-23 15:17:19,015 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:prop>[\n]"
2023-03-23 15:17:19,015 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<g0:owner/>[\n]"
2023-03-23 15:17:19,015 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<g0:group/>[\n]"
2023-03-23 15:17:19,015 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<g0:acl/>[\n]"
2023-03-23 15:17:19,015 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "</D:prop>[\n]"
2023-03-23 15:17:19,015 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:status>HTTP/1.1 404 Not Found</D:status>[\n]"
2023-03-23 15:17:19,015 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "</D:propstat>[\n]"
2023-03-23 15:17:19,015 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "</D:response>[\n]"
2023-03-23 15:17:19,015 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "</D:multistatus>[\n]"
[]
2023-03-23 15:17:19,022 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> PROPFIND /directory/file.mkv HTTP/1.1
2023-03-23 15:17:19,023 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Depth: 0
2023-03-23 15:17:19,023 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Content-Type: text/xml; charset=utf-8
2023-03-23 15:17:19,023 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Content-Length: 124
2023-03-23 15:17:19,023 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Host: home.courville.org:5006
2023-03-23 15:17:19,023 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Connection: Keep-Alive
2023-03-23 15:17:19,023 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> User-Agent: Sardine/5.10
2023-03-23 15:17:19,023 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Accept-Encoding: gzip,deflate
2023-03-23 15:17:19,023 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Authorization: Basic bHVya2VyOmFpZzlVeWVp
2023-03-23 15:17:19,023 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "PROPFIND /directory/file.mkv HTTP/1.1[\r][\n]"
2023-03-23 15:17:19,023 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Depth: 0[\r][\n]"
2023-03-23 15:17:19,023 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Content-Type: text/xml; charset=utf-8[\r][\n]"
2023-03-23 15:17:19,023 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Content-Length: 124[\r][\n]"
2023-03-23 15:17:19,023 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Host: home.courville.org:5006[\r][\n]"
2023-03-23 15:17:19,023 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
2023-03-23 15:17:19,023 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "User-Agent: Sardine/5.10[\r][\n]"
2023-03-23 15:17:19,023 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]"
2023-03-23 15:17:19,023 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Authorization: Basic bHVya2VyOmFpZzlVeWVp[\r][\n]"
2023-03-23 15:17:19,023 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "[\r][\n]"
2023-03-23 15:17:19,023 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "<?xml version="1.0" encoding="UTF-8" standalone="yes"?><propfind xmlns="DAV:"><prop><owner/><group/><acl/></prop></propfind>"
2023-03-23 15:17:19,657 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "HTTP/1.1 207 Multi-Status[\r][\n]"
2023-03-23 15:17:19,660 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Date: Thu, 23 Mar 2023 14:17:19 GMT[\r][\n]"
2023-03-23 15:17:19,660 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Server: Apache[\r][\n]"
2023-03-23 15:17:19,660 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Content-Length: 358[\r][\n]"
2023-03-23 15:17:19,660 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Keep-Alive: timeout=5, max=98[\r][\n]"
2023-03-23 15:17:19,660 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Connection: Keep-Alive[\r][\n]"
2023-03-23 15:17:19,660 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Content-Type: text/xml; charset="utf-8"[\r][\n]"
2023-03-23 15:17:19,660 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "[\r][\n]"
2023-03-23 15:17:19,661 [main] DEBUG org.apache.http.headers - http-outgoing-0 << HTTP/1.1 207 Multi-Status
2023-03-23 15:17:19,661 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Date: Thu, 23 Mar 2023 14:17:19 GMT
2023-03-23 15:17:19,661 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Server: Apache
2023-03-23 15:17:19,661 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Content-Length: 358
2023-03-23 15:17:19,661 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Keep-Alive: timeout=5, max=98
2023-03-23 15:17:19,662 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Connection: Keep-Alive
2023-03-23 15:17:19,662 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Content-Type: text/xml; charset="utf-8"
2023-03-23 15:17:19,665 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<?xml version="1.0" encoding="utf-8"?>[\n]"
2023-03-23 15:17:19,666 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:multistatus xmlns:D="DAV:" xmlns:ns0="DAV:">[\n]"
2023-03-23 15:17:19,666 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:response xmlns:g0="DAV:">[\n]"
2023-03-23 15:17:19,666 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:href>/directory/file.mkv</D:href>[\n]"
2023-03-23 15:17:19,666 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:propstat>[\n]"
2023-03-23 15:17:19,666 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:prop>[\n]"
2023-03-23 15:17:19,666 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<g0:owner/>[\n]"
2023-03-23 15:17:19,666 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<g0:group/>[\n]"
2023-03-23 15:17:19,666 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<g0:acl/>[\n]"
2023-03-23 15:17:19,666 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "</D:prop>[\n]"
2023-03-23 15:17:19,666 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:status>HTTP/1.1 404 Not Found</D:status>[\n]"
2023-03-23 15:17:19,666 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "</D:propstat>[\n]"
2023-03-23 15:17:19,666 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "</D:response>[\n]"
2023-03-23 15:17:19,666 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "</D:multistatus>[\n]"
fromUri owner=null, group=null

It seems that server response is indeed empty.

@lookfirst
Copy link
Owner

Deleted my first response as I was quick to judge and didn't read the full log. My apologies.

@lookfirst
Copy link
Owner

It looks like you're getting 404, file not found back from the server after authentication.

2023-03-23 15:17:19,666 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:status>HTTP/1.1 404 Not Found</D:status>[\n]"

@courville
Copy link
Author

courville commented Mar 23, 2023

@lookfirst, thanks for the feedback. I checked the url and credentials and I can confirm that I can download the file from a browser.
I can also list the file with sardine.list(url) using the same program and everything works "as expected" (cf. below logs e.g. <lp1:getcontentlength>325129119</lp1:getcontentlength>). However as you spotted, it fails when doing sardine.getAcl(url) with 404 which to me is strange.

To be clear following code:

try {
            System.out.println("Let's try sardine.list(url)");
            List<DavResource> resources = sardine.list(url);
            System.out.println("Now let's try sardine.getAcl(url)");
            acl = sardine.getAcl(url);
} catch (IOException e) {
            System.out.println("IOException in getAcl");
}

Yields:

Let's try sardine.list(url)
2023-03-23 20:08:18,902 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> PROPFIND /download/file.mkv HTTP/1.1
2023-03-23 20:08:18,902 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Depth: 1
2023-03-23 20:08:18,902 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Content-Type: text/xml; charset=utf-8
2023-03-23 20:08:18,902 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Content-Length: 99
2023-03-23 20:08:18,902 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Host: home.courville.org:5006
2023-03-23 20:08:18,902 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Connection: Keep-Alive
2023-03-23 20:08:18,902 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> User-Agent: Sardine/5.10
2023-03-23 20:08:18,902 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Accept-Encoding: gzip,deflate
2023-03-23 20:08:18,903 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "PROPFIND /download/file.mkv HTTP/1.1[\r][\n]"
2023-03-23 20:08:18,903 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Depth: 1[\r][\n]"
2023-03-23 20:08:18,903 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Content-Type: text/xml; charset=utf-8[\r][\n]"
2023-03-23 20:08:18,903 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Content-Length: 99[\r][\n]"
2023-03-23 20:08:18,903 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Host: home.courville.org:5006[\r][\n]"
2023-03-23 20:08:18,903 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
2023-03-23 20:08:18,903 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "User-Agent: Sardine/5.10[\r][\n]"
2023-03-23 20:08:18,903 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]"
2023-03-23 20:08:18,903 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "[\r][\n]"
2023-03-23 20:08:18,904 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "<?xml version="1.0" encoding="UTF-8" standalone="yes"?><propfind xmlns="DAV:"><allprop/></propfind>"
2023-03-23 20:08:18,909 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "HTTP/1.1 401 Unauthorized[\r][\n]"
2023-03-23 20:08:18,909 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Date: Thu, 23 Mar 2023 19:08:18 GMT[\r][\n]"
2023-03-23 20:08:18,909 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Server: Apache[\r][\n]"
2023-03-23 20:08:18,909 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "WWW-Authenticate: Basic realm="SYNO_WebDAV Storage"[\r][\n]"
2023-03-23 20:08:18,909 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Content-Length: 381[\r][\n]"
2023-03-23 20:08:18,909 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Keep-Alive: timeout=5, max=100[\r][\n]"
2023-03-23 20:08:18,909 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Connection: Keep-Alive[\r][\n]"
2023-03-23 20:08:18,909 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Content-Type: text/html; charset=iso-8859-1[\r][\n]"
2023-03-23 20:08:18,909 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "[\r][\n]"
2023-03-23 20:08:18,909 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">[\n]"
2023-03-23 20:08:18,909 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<html><head>[\n]"
2023-03-23 20:08:18,909 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<title>401 Unauthorized</title>[\n]"
2023-03-23 20:08:18,909 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "</head><body>[\n]"
2023-03-23 20:08:18,909 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<h1>Unauthorized</h1>[\n]"
2023-03-23 20:08:18,909 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<p>This server could not verify that you[\n]"
2023-03-23 20:08:18,909 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "are authorized to access the document[\n]"
2023-03-23 20:08:18,910 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "requested.  Either you supplied the wrong[\n]"
2023-03-23 20:08:18,910 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "credentials (e.g., bad password), or your[\n]"
2023-03-23 20:08:18,910 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "browser doesn't understand how to supply[\n]"
2023-03-23 20:08:18,910 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "the credentials required.</p>[\n]"
2023-03-23 20:08:18,910 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "</body></html>[\n]"
2023-03-23 20:08:18,915 [main] DEBUG org.apache.http.headers - http-outgoing-0 << HTTP/1.1 401 Unauthorized
2023-03-23 20:08:18,915 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Date: Thu, 23 Mar 2023 19:08:18 GMT
2023-03-23 20:08:18,915 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Server: Apache
2023-03-23 20:08:18,915 [main] DEBUG org.apache.http.headers - http-outgoing-0 << WWW-Authenticate: Basic realm="SYNO_WebDAV Storage"
2023-03-23 20:08:18,915 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Content-Length: 381
2023-03-23 20:08:18,915 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Keep-Alive: timeout=5, max=100
2023-03-23 20:08:18,915 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Connection: Keep-Alive
2023-03-23 20:08:18,915 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Content-Type: text/html; charset=iso-8859-1
2023-03-23 20:08:18,931 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> PROPFIND /download/file.mkv HTTP/1.1
2023-03-23 20:08:18,932 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Depth: 1
2023-03-23 20:08:18,932 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Content-Type: text/xml; charset=utf-8
2023-03-23 20:08:18,932 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Content-Length: 99
2023-03-23 20:08:18,932 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Host: home.courville.org:5006
2023-03-23 20:08:18,932 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Connection: Keep-Alive
2023-03-23 20:08:18,932 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> User-Agent: Sardine/5.10
2023-03-23 20:08:18,932 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Accept-Encoding: gzip,deflate
2023-03-23 20:08:18,932 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Authorization: Basic bHVya2VyOmFpZzlVeWVp
2023-03-23 20:08:18,932 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "PROPFIND /download/file.mkv HTTP/1.1[\r][\n]"
2023-03-23 20:08:18,932 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Depth: 1[\r][\n]"
2023-03-23 20:08:18,932 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Content-Type: text/xml; charset=utf-8[\r][\n]"
2023-03-23 20:08:18,932 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Content-Length: 99[\r][\n]"
2023-03-23 20:08:18,932 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Host: home.courville.org:5006[\r][\n]"
2023-03-23 20:08:18,932 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
2023-03-23 20:08:18,932 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "User-Agent: Sardine/5.10[\r][\n]"
2023-03-23 20:08:18,932 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]"
2023-03-23 20:08:18,932 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Authorization: Basic bHVya2VyOmFpZzlVeWVp[\r][\n]"
2023-03-23 20:08:18,932 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "[\r][\n]"
2023-03-23 20:08:18,932 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "<?xml version="1.0" encoding="UTF-8" standalone="yes"?><propfind xmlns="DAV:"><allprop/></propfind>"
2023-03-23 20:08:18,943 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "HTTP/1.1 207 Multi-Status[\r][\n]"
2023-03-23 20:08:18,944 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Date: Thu, 23 Mar 2023 19:08:18 GMT[\r][\n]"
2023-03-23 20:08:18,944 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Server: Apache[\r][\n]"
2023-03-23 20:08:18,944 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Content-Length: 922[\r][\n]"
2023-03-23 20:08:18,944 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Keep-Alive: timeout=5, max=99[\r][\n]"
2023-03-23 20:08:18,945 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Connection: Keep-Alive[\r][\n]"
2023-03-23 20:08:18,945 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Content-Type: text/xml; charset="utf-8"[\r][\n]"
2023-03-23 20:08:18,945 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "[\r][\n]"
2023-03-23 20:08:18,945 [main] DEBUG org.apache.http.headers - http-outgoing-0 << HTTP/1.1 207 Multi-Status
2023-03-23 20:08:18,945 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Date: Thu, 23 Mar 2023 19:08:18 GMT
2023-03-23 20:08:18,945 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Server: Apache
2023-03-23 20:08:18,945 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Content-Length: 922
2023-03-23 20:08:18,945 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Keep-Alive: timeout=5, max=99
2023-03-23 20:08:18,945 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Connection: Keep-Alive
2023-03-23 20:08:18,945 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Content-Type: text/xml; charset="utf-8"
2023-03-23 20:08:18,978 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<?xml version="1.0" encoding="utf-8"?>[\n]"
2023-03-23 20:08:18,979 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:multistatus xmlns:D="DAV:" xmlns:ns0="DAV:">[\n]"
2023-03-23 20:08:18,979 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:response xmlns:lp2="http://apache.org/dav/props/" xmlns:lp1="DAV:">[\n]"
2023-03-23 20:08:18,979 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:href>/download/file.mkv</D:href>[\n]"
2023-03-23 20:08:18,980 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:propstat>[\n]"
2023-03-23 20:08:18,980 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:prop>[\n]"
2023-03-23 20:08:18,980 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<lp1:resourcetype/>[\n]"
2023-03-23 20:08:18,980 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<lp1:creationdate>2023-03-23T18:54:56Z</lp1:creationdate>[\n]"
2023-03-23 20:08:18,980 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<lp1:getcontentlength>325129119</lp1:getcontentlength>[\n]"
2023-03-23 20:08:18,980 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<lp1:getlastmodified>Thu, 23 Mar 2023 18:54:56 GMT</lp1:getlastmodified>[\n]"
2023-03-23 20:08:18,980 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<lp1:getetag>"1361139f-5f795d00d8d29"</lp1:getetag>[\n]"
2023-03-23 20:08:18,980 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<lp2:executable>T</lp2:executable>[\n]"
2023-03-23 20:08:18,980 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:supportedlock>[\n]"
2023-03-23 20:08:18,980 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:lockentry>[\n]"
2023-03-23 20:08:18,980 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:lockscope><D:exclusive/></D:lockscope>[\n]"
2023-03-23 20:08:18,980 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:locktype><D:write/></D:locktype>[\n]"
2023-03-23 20:08:18,980 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "</D:lockentry>[\n]"
2023-03-23 20:08:18,980 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:lockentry>[\n]"
2023-03-23 20:08:18,980 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:lockscope><D:shared/></D:lockscope>[\n]"
2023-03-23 20:08:18,980 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:locktype><D:write/></D:locktype>[\n]"
2023-03-23 20:08:18,980 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "</D:lockentry>[\n]"
2023-03-23 20:08:18,980 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "</D:supportedlock>[\n]"
2023-03-23 20:08:18,980 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:lockdiscovery/>[\n]"
2023-03-23 20:08:18,980 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:getcontenttype>video/x-matroska</D:getcontenttype>[\n]"
2023-03-23 20:08:18,980 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "</D:prop>[\n]"
2023-03-23 20:08:18,980 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:status>HTTP/1.1 200 OK</D:status>[\n]"
2023-03-23 20:08:18,980 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "</D:propstat>[\n]"
2023-03-23 20:08:18,980 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "</D:response>[\n]"
2023-03-23 20:08:18,980 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "</D:multistatus>[\n]"
Now let's try sardine.getAcl(url)
2023-03-23 20:08:19,081 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> PROPFIND /download/file.mkv HTTP/1.1
2023-03-23 20:08:19,082 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Depth: 0
2023-03-23 20:08:19,082 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Content-Type: text/xml; charset=utf-8
2023-03-23 20:08:19,082 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Content-Length: 124
2023-03-23 20:08:19,082 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Host: home.courville.org:5006
2023-03-23 20:08:19,082 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Connection: Keep-Alive
2023-03-23 20:08:19,082 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> User-Agent: Sardine/5.10
2023-03-23 20:08:19,082 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Accept-Encoding: gzip,deflate
2023-03-23 20:08:19,082 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Authorization: Basic bHVya2VyOmFpZzlVeWVp
2023-03-23 20:08:19,082 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "PROPFIND /download/file.mkv HTTP/1.1[\r][\n]"
2023-03-23 20:08:19,083 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Depth: 0[\r][\n]"
2023-03-23 20:08:19,083 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Content-Type: text/xml; charset=utf-8[\r][\n]"
2023-03-23 20:08:19,083 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Content-Length: 124[\r][\n]"
2023-03-23 20:08:19,083 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Host: home.courville.org:5006[\r][\n]"
2023-03-23 20:08:19,083 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
2023-03-23 20:08:19,083 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "User-Agent: Sardine/5.10[\r][\n]"
2023-03-23 20:08:19,083 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]"
2023-03-23 20:08:19,083 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Authorization: Basic bHVya2VyOmFpZzlVeWVp[\r][\n]"
2023-03-23 20:08:19,083 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "[\r][\n]"
2023-03-23 20:08:19,083 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "<?xml version="1.0" encoding="UTF-8" standalone="yes"?><propfind xmlns="DAV:"><prop><owner/><group/><acl/></prop></propfind>"
2023-03-23 20:08:19,093 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "HTTP/1.1 207 Multi-Status[\r][\n]"
2023-03-23 20:08:19,093 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Date: Thu, 23 Mar 2023 19:08:19 GMT[\r][\n]"
2023-03-23 20:08:19,093 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Server: Apache[\r][\n]"
2023-03-23 20:08:19,094 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Content-Length: 307[\r][\n]"
2023-03-23 20:08:19,094 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Keep-Alive: timeout=5, max=98[\r][\n]"
2023-03-23 20:08:19,094 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Connection: Keep-Alive[\r][\n]"
2023-03-23 20:08:19,094 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Content-Type: text/xml; charset="utf-8"[\r][\n]"
2023-03-23 20:08:19,094 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "[\r][\n]"
2023-03-23 20:08:19,094 [main] DEBUG org.apache.http.headers - http-outgoing-0 << HTTP/1.1 207 Multi-Status
2023-03-23 20:08:19,094 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Date: Thu, 23 Mar 2023 19:08:19 GMT
2023-03-23 20:08:19,094 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Server: Apache
2023-03-23 20:08:19,094 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Content-Length: 307
2023-03-23 20:08:19,094 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Keep-Alive: timeout=5, max=98
2023-03-23 20:08:19,094 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Connection: Keep-Alive
2023-03-23 20:08:19,094 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Content-Type: text/xml; charset="utf-8"
2023-03-23 20:08:19,097 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<?xml version="1.0" encoding="utf-8"?>[\n]"
2023-03-23 20:08:19,097 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:multistatus xmlns:D="DAV:" xmlns:ns0="DAV:">[\n]"
2023-03-23 20:08:19,097 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:response xmlns:g0="DAV:">[\n]"
2023-03-23 20:08:19,097 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:href>/download/file.mkv</D:href>[\n]"
2023-03-23 20:08:19,097 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:propstat>[\n]"
2023-03-23 20:08:19,097 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:prop>[\n]"
2023-03-23 20:08:19,097 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<g0:owner/>[\n]"
2023-03-23 20:08:19,097 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<g0:group/>[\n]"
2023-03-23 20:08:19,097 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<g0:acl/>[\n]"
2023-03-23 20:08:19,097 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "</D:prop>[\n]"
2023-03-23 20:08:19,097 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<D:status>HTTP/1.1 404 Not Found</D:status>[\n]"
2023-03-23 20:08:19,097 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "</D:propstat>[\n]"
2023-03-23 20:08:19,097 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "</D:response>[\n]"
2023-03-23 20:08:19,097 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "</D:multistatus>[\n]"

@courville
Copy link
Author

courville commented Mar 23, 2023

BTW I failed to say thanks for sardine! It has just been integrated in the open source Android nova video player https://github.com/nova-video-player/aos-AVP for webdav network share support: it is working great (just trying to get the canRead/canWrite wired in).

@lookfirst
Copy link
Owner

lookfirst commented Mar 23, 2023

I had an idea... try setting the depth:

2023-03-23 15:17:17,571 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Depth: 0

You can set it to some high number like 10 or something.

@courville
Copy link
Author

courville commented Mar 23, 2023

OK I increased depth to 10 in getAcl leading to 400 badrequest

Now let's try sardine.getAcl(url)
2023-03-23 21:47:58,196 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> PROPFIND /download/file.mkv HTTP/1.1
2023-03-23 21:47:58,196 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Depth: 10
2023-03-23 21:47:58,196 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Content-Type: text/xml; charset=utf-8
2023-03-23 21:47:58,196 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Content-Length: 124
2023-03-23 21:47:58,196 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Host: home.courville.org:5006
2023-03-23 21:47:58,196 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Connection: Keep-Alive
2023-03-23 21:47:58,196 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> User-Agent: Sardine/5.11-SNAPSHOT
2023-03-23 21:47:58,196 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Accept-Encoding: gzip,deflate
2023-03-23 21:47:58,196 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Authorization: Basic bHVya2VyOmFpZzlVeWVp
2023-03-23 21:47:58,196 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "PROPFIND /download/file.mkv HTTP/1.1[\r][\n]"
2023-03-23 21:47:58,197 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Depth: 10[\r][\n]"
2023-03-23 21:47:58,197 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Content-Type: text/xml; charset=utf-8[\r][\n]"
2023-03-23 21:47:58,197 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Content-Length: 124[\r][\n]"
2023-03-23 21:47:58,197 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Host: home.courville.org:5006[\r][\n]"
2023-03-23 21:47:58,197 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
2023-03-23 21:47:58,197 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "User-Agent: Sardine/5.11-SNAPSHOT[\r][\n]"
2023-03-23 21:47:58,197 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]"
2023-03-23 21:47:58,197 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Authorization: Basic bHVya2VyOmFpZzlVeWVp[\r][\n]"
2023-03-23 21:47:58,197 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "[\r][\n]"
2023-03-23 21:47:58,197 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "<?xml version="1.0" encoding="UTF-8" standalone="yes"?><propfind xmlns="DAV:"><prop><owner/><group/><acl/></prop></propfind>"
2023-03-23 21:47:58,217 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "HTTP/1.1 400 Bad Request[\r][\n]"
2023-03-23 21:47:58,217 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Date: Thu, 23 Mar 2023 20:47:58 GMT[\r][\n]"
2023-03-23 21:47:58,218 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Server: Apache[\r][\n]"
2023-03-23 21:47:58,218 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Content-Length: 226[\r][\n]"
2023-03-23 21:47:58,218 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Connection: close[\r][\n]"
2023-03-23 21:47:58,218 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Content-Type: text/html; charset=iso-8859-1[\r][\n]"
2023-03-23 21:47:58,218 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "[\r][\n]"
2023-03-23 21:47:58,218 [main] DEBUG org.apache.http.headers - http-outgoing-0 << HTTP/1.1 400 Bad Request
2023-03-23 21:47:58,218 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Date: Thu, 23 Mar 2023 20:47:58 GMT
2023-03-23 21:47:58,218 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Server: Apache
2023-03-23 21:47:58,218 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Content-Length: 226
2023-03-23 21:47:58,218 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Connection: close
2023-03-23 21:47:58,218 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Content-Type: text/html; charset=iso-8859-1
2023-03-23 21:47:58,219 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">[\n]"
2023-03-23 21:47:58,219 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<html><head>[\n]"
2023-03-23 21:47:58,219 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<title>400 Bad Request</title>[\n]"
2023-03-23 21:47:58,219 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "</head><body>[\n]"
2023-03-23 21:47:58,219 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<h1>Bad Request</h1>[\n]"
2023-03-23 21:47:58,219 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<p>Your browser sent a request that this server could not understand.<br />[\n]"
2023-03-23 21:47:58,219 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "</p>[\n]"
2023-03-23 21:47:58,219 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "</body></html>[\n]"
IOException in getAcl

@lookfirst
Copy link
Owner

Ok, maybe too far, try depth: 1

=)

@courville
Copy link
Author

OK:

  • http-outgoing-0 >> Depth: 0 yields: http-outgoing-0 << "<title>404 Not Found</title>
  • http-outgoing-0 >> Depth: 1 yields: http-outgoing-0 << "<title>404 Not Found</title>
  • http-outgoing-0 >> Depth: 2 yields: http-outgoing-0 << "<title>400 Bad Request</title>
  • http-outgoing-0 >> Depth: 3 yields: http-outgoing-0 << "<title>400 Bad Request</title>
  • http-outgoing-0 >> Depth: 10 yields: http-outgoing-0 << "<title>400 Bad Request</title>

@courville
Copy link
Author

FYI I tried both on synology NAS and some other webdav server like koofr.net and same behavior.

@lookfirst
Copy link
Owner

So the 400 bad request could be related to the DavDepthInfinity setting.

Now, what I'm thinking is that some sort of other parameter is missing from the request that the server is expecting here. What I'd do is spend some time reading the mod_webdav source code to see what happens when a PROPFIND comes in and what it expects. Looking to see where it returns 404 vs. 400 is another one.

Maybe also @gstein can help too (sorry to ping you buddy).

@courville
Copy link
Author

Any hope on addressing the issue?

@lookfirst
Copy link
Owner

What I'd do is spend some time reading the mod_webdav source code to see what happens when a PROPFIND comes in and what it expects. Looking to see where it returns 404 vs. 400 is another one.

That was my next suggestion. Have you done that?

Repository owner locked and limited conversation to collaborators Jun 15, 2023
@dkocher dkocher converted this issue into discussion #402 Jun 15, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants