Skip to content

webdav issue on PUT #243

Open
Open

Description

@elehcim

Hello, I'm running a webdav server using this image http:bookworm as base.

When I try to PUT a file with:

curl -T po.txt http://myserver.me/dir/

I get:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
</body></html>

And the log from the server is:

[Mon Nov 13 14:45:07.242571 2023] [mpm_event:notice] [pid 1:tid 140536338677056] AH00489: Apache/2.4.57 (Unix) OpenSSL/1.1.1n configured -- resuming normal operations
[Mon Nov 13 14:45:07.242576 2023] [mpm_event:info] [pid 1:tid 140536338677056] AH00490: Server built: Jun 13 2023 06:36:54
[Mon Nov 13 14:45:07.242543 2023] [mpm_event:debug] [pid 1:tid 140536338677056] event.c(740): Child 2 started: pid 15, gen 0, active 3/16, total 3/3/16
[Mon Nov 13 14:45:07.242571 2023] [mpm_event:notice] [pid 1:tid 140536338677056] AH00489: Apache/2.4.57 (Unix) OpenSSL/1.1.1n configured -- resuming normal operations
[Mon Nov 13 14:45:07.242576 2023] [mpm_event:info] [pid 1:tid 140536338677056] AH00490: Server built: Jun 13 2023 06:36:54
[Mon Nov 13 14:45:07.242623 2023] [core:notice] [pid 1:tid 140536338677056] AH00094: Command line: 'httpd -D FOREGROUND'
[Mon Nov 13 14:45:07.242633 2023] [core:debug] [pid 1:tid 140536338677056] log.c(1570): AH02639: Using SO_REUSEPORT: yes (1)
[Mon Nov 13 14:45:07.242623 2023] [core:notice] [pid 1:tid 140536338677056] AH00094: Command line: 'httpd -D FOREGROUND'
[Mon Nov 13 14:45:07.242633 2023] [core:debug] [pid 1:tid 140536338677056] log.c(1570): AH02639: Using SO_REUSEPORT: yes (1)
[Mon Nov 13 14:45:07.242904 2023] [mpm_event:debug] [pid 13:tid 140536332662528] event.c(2401): AH02471: start_threads: Using epoll (wakeable)
[Mon Nov 13 14:45:07.242904 2023] [mpm_event:debug] [pid 13:tid 140536332662528] event.c(2401): AH02471: start_threads: Using epoll (wakeable)
[Mon Nov 13 14:45:07.243825 2023] [mpm_event:debug] [pid 15:tid 140536332662528] event.c(2401): AH02471: start_threads: Using epoll (wakeable)
[Mon Nov 13 14:45:07.243825 2023] [mpm_event:debug] [pid 15:tid 140536332662528] event.c(2401): AH02471: start_threads: Using epoll (wakeable)
[Mon Nov 13 14:45:07.244010 2023] [mpm_event:debug] [pid 14:tid 140536332662528] event.c(2401): AH02471: start_threads: Using epoll (wakeable)
[Mon Nov 13 14:45:07.244010 2023] [mpm_event:debug] [pid 14:tid 140536332662528] event.c(2401): AH02471: start_threads: Using epoll (wakeable)
[Mon Nov 13 14:45:48.061367 2023] [authz_core:debug] [pid 13:tid 140536324269824] mod_authz_core.c(815): [client 10.42.0.0:21709] AH01626: authorization result of Require all granted: granted
[Mon Nov 13 14:45:48.061462 2023] [authz_core:debug] [pid 13:tid 140536324269824] mod_authz_core.c(815): [client 10.42.0.0:21709] AH01626: authorization result of <RequireAny>: granted
[Mon Nov 13 14:45:48.061367 2023] [authz_core:debug] [pid 13:tid 140536324269824] mod_authz_core.c(815): [client 10.42.0.0:21709] AH01626: authorization result of Require all granted: granted
[Mon Nov 13 14:45:48.061462 2023] [authz_core:debug] [pid 13:tid 140536324269824] mod_authz_core.c(815): [client 10.42.0.0:21709] AH01626: authorization result of <RequireAny>: granted
BDB0004 fop_read_meta: /var/lib/dav/DavLock: unexpected file type or format
BDB0004 fop_read_meta: /var/lib/dav/DavLock: unexpected file type or format
BDB0004 fop_read_meta: /var/lib/dav/DavLock: unexpected file type or format
BDB0004 fop_read_meta: /var/lib/dav/DavLock: unexpected file type or format
BDB0004 fop_read_meta: /var/lib/dav/DavLock: unexpected file type or format
BDB0004 fop_read_meta: /var/lib/dav/DavLock: unexpected file type or format
BDB0004 fop_read_meta: /var/lib/dav/DavLock: unexpected file type or format
BDB0004 fop_read_meta: /var/lib/dav/DavLock: unexpected file type or format
BDB0004 fop_read_meta: /var/lib/dav/DavLock: unexpected file type or format
BDB0004 fop_read_meta: /var/lib/dav/DavLock: unexpected file type or format
[Mon Nov 13 14:45:48.072406 2023] [:error] [pid 13:tid 140536324269824] AH: ctx->lock_filename: /po.txt.lock.
[Mon Nov 13 14:45:48.072406 2023] [:error] [pid 13:tid 140536324269824] AH: ctx->lock_filename: /po.txt.lock.
[Mon Nov 13 14:45:48.072481 2023] [:error] [pid 13:tid 140536324269824] AH: Unable to open lock file /po.txt.lock.
[Mon Nov 13 14:45:48.072481 2023] [:error] [pid 13:tid 140536324269824] AH: Unable to open lock file /po.txt.lock.
[Mon Nov 13 14:45:48.089338 2023] [dav:error] [pid 13:tid 140536324269824] (2)No such file or directory: [client 10.42.0.0:21709] An error occurred while reading the request body (URI: /dir/po.txt)  [400, #0]
[Mon Nov 13 14:45:48.089338 2023] [dav:error] [pid 13:tid 140536324269824] (2)No such file or directory: [client 10.42.0.0:21709] An error occurred while reading the request body (URI: /dir/po.txt)  [400, #0]

When I created the image I installed the apr and aprutil packages with this line:

apt-get install -y libtool libaprutil1-dev libapr1-dev libaprutil1 libapr1

I saw the line BDB0004 fop_read_meta: /var/lib/dav/DavLock: unexpected file type or format may be linked to this issue, but I'm on debian bookworm.
Any hint about what may be the problem?
Thanks

Activity

  1. LaurentGoderre commented on Nov 13, 2023

    @LaurentGoderre
    Member

    I wonder if this could be your issue: https://serverfault.com/a/716789

  2. elehcim commented on Nov 28, 2023

    @elehcim
    Author

    I wonder if this could be your issue: https://serverfault.com/a/716789

    Thanks for the link, I checked and tested the permissions but it's not that unfortunately.

    I do not understand this error log line:

    BDB0004 fop_read_meta: /var/lib/dav/DavLock: unexpected file type or format
    
  3. LaurentGoderre commented on Nov 28, 2023

    @LaurentGoderre
    Member

    It looks like it's trying to put the file in a location that isn't allowed by Apache (it seems to be trying to put it either in root or /dir)

  4. LaurentGoderre commented on Nov 28, 2023

    @LaurentGoderre
    Member

    Have you tried using the the directive:

    DavLockDB /usr/local/apache/var/DavLock
    

    Source: https://httpd.apache.org/docs/2.4/mod/mod_dav.html

  5. elehcim commented on Nov 28, 2023

    @elehcim
    Author

    Have you tried using the the directive:

    DavLockDB /usr/local/apache/var/DavLock
    

    Source: https://httpd.apache.org/docs/2.4/mod/mod_dav.html

    yes I tried this, but still doesn't work. I also checked the permissions on the root and /dir folder without success.

    Another thing is that exploring with the browser the webdav url, I see many empty files called like: .davfs.tmp00fea1

  6. LaurentGoderre commented on Nov 28, 2023

    @LaurentGoderre
    Member

    the var/DavLock don't exist in the base image so you would need to create it first.

  7. elehcim commented on Nov 28, 2023

    @elehcim
    Author

    Yeah I created it.

    webdav:/var/lib/dav# ls -la
    total 8
    drwxrwxr-x. 1 www-data www-data    33 Nov 13 14:43 .
    drwxr-xr-x. 1 root     root        17 Nov 13 14:43 ..
    -rwxrwxrwx. 1 www-data www-data 12288 Nov 28 10:55 DavLock
    drwxr-xr-x. 1 www-data www-data    19 Nov 28 15:13 data
    

    dav.conf:

    DavLockDB "/var/lib/dav/DavLock"
    Alias / "/var/lib/dav/data/"
    <Directory "/var/lib/dav/data/">
      Dav On
      Options Indexes FollowSymLinks
    
      <RequireAny>
        Require all granted
      </RequireAny>
    </Directory>
    
  8. elehcim commented on Nov 28, 2023

    @elehcim
    Author

    This is my starting point https://github.com/rucio/containers/tree/master/webdav I opened an issue there, no response yet

  9. elehcim commented on Jun 20, 2024

    @elehcim
    Author

    This is my starting point https://github.com/rucio/containers/tree/master/webdav I opened an issue there, no response yet

    The issue above has been resolved here.

  10. tianon commented on Jun 20, 2024

    @tianon
    Member

    It's still weird that our webdav support isn't working, but I'm glad your use case is fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions