Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 0B545200B44 for ; Thu, 14 Jul 2016 21:21:34 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 09F97160A63; Thu, 14 Jul 2016 19:21:34 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 52DA1160A60 for ; Thu, 14 Jul 2016 21:21:33 +0200 (CEST) Received: (qmail 70271 invoked by uid 500); 14 Jul 2016 19:21:32 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 70261 invoked by uid 99); 14 Jul 2016 19:21:32 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jul 2016 19:21:32 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id DF667C1A4D for ; Thu, 14 Jul 2016 19:21:31 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.287 X-Spam-Level: X-Spam-Status: No, score=-0.287 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-1.287] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id Deergxkk7ukT for ; Thu, 14 Jul 2016 19:21:31 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTP id 71A395FE20 for ; Thu, 14 Jul 2016 19:21:30 +0000 (UTC) Received: from asf-bz1-us-mid.priv.apache.org (unknown [162.242.174.13]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTPS id 68B5BE05FB for ; Thu, 14 Jul 2016 19:21:29 +0000 (UTC) Received: by asf-bz1-us-mid.priv.apache.org (ASF Mail Server at asf-bz1-us-mid.priv.apache.org, from userid 33) id 3BF4660E14; Thu, 14 Jul 2016 19:21:12 +0000 (UTC) From: bugzilla@apache.org To: dev@tomcat.apache.org Subject: [Bug 59859] New: Tomcat WebDAV MOVE operation fails on Windows Date: Thu, 14 Jul 2016 19:21:27 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Tomcat 8 X-Bugzilla-Component: Catalina X-Bugzilla-Version: 8.0.36 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: csutherl@redhat.com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: dev@tomcat.apache.org X-Bugzilla-Target-Milestone: ---- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bz.apache.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 archived-at: Thu, 14 Jul 2016 19:21:34 -0000 https://bz.apache.org/bugzilla/show_bug.cgi?id=59859 Bug ID: 59859 Summary: Tomcat WebDAV MOVE operation fails on Windows Product: Tomcat 8 Version: 8.0.36 Hardware: PC Status: NEW Severity: normal Priority: P2 Component: Catalina Assignee: dev@tomcat.apache.org Reporter: csutherl@redhat.com Created attachment 34040 --> https://bz.apache.org/bugzilla/attachment.cgi?id=34040&action=edit reproducer app The WebDAV MOVE operation doesn't seem to work in tomcat8 or tomcat8.5 (it works fine in tomcat7) on Windows. Here are some reproduction steps and a reproducer to show the behavior. Note that this only occurs on Windows; I also tested on Linux and it works fine there, so I think something is wrong at the OS/java level here. Reproduction steps: 1) Install tomcat 8 on Windows 2) Add the webdav role and a user with that role to your conf/tomcat-users.xml 3) Deploy the attached webdav test application (webdavapp.war) 4) Start tomcat and make the following MOVE request: curl -i -X MOVE --header "Destination: http://localhost:8080/webdavapp/webdav/hello2.txt" --user "tomcat:tomcat" http://localhost:8080/webdavapp/webdav/hello.txt 5) Observe the 500 response Actual Results: HTTP/1.1 500 Internal Server Error Server: Apache-Coyote/1.1 Cache-Control: private Expires: Wed, 31 Dec 1969 16:00:00 PST Content-Type: text/html;charset=utf-8 Content-Language: en Content-Length: 1040 Date: Thu, 14 Jul 2016 22:35:32 GMT Connection: close Expected Results (as seen on Linux): HTTP/1.1 201 Created Server: Apache-Coyote/1.1 Cache-Control: private Expires: Wed, 31 Dec 1969 19:00:00 EST Content-Length: 0 Date: Thu, 14 Jul 2016 18:42:30 GMT Additional Information: I did spend some time tracing this in jdb and found that the MOVE is partially working...it successfully copies the resource to the destination and but it is failing to delete the old resource. I think I tracked the failure down to the following block within o.a.c.servlets.WebdavServlet.doMove(): 1745 if(!resource.isDirectory()) { 1746 if(!resource.delete()) { 1747 resp.sendError(WebdavStatus.SC_INTERNAL_SERVER_ERROR); 1748 return false; The problem occurs in the (o.a.c.webresources.CachedResource) resource.delete() call; it returns false and doesn't delete the resource for some reason (no exception is thrown, but the errorState flag is set to 1 on the response). Furthermore, if you make the same exact call again it will successfully delete the previously copied destination, copy the original to the destination again, and then fail to delete the original throwing the 500. I can't understand why the resource.delete() can fail because it passes through to what ends up being a o.a.c.webresources.FileResource.delete(). I compared the successful deletion's FileResource instance to the unsuccessful deletion and the instances match almost exactly (path's differ which is expected). I'm not sure what could be at play here unless its at the JVM level. -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org