Archiva
  1. Archiva
  2. MRM-234

Moving files between repos through webdav doesn't work

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: 1.1
    • Component/s: WebDAV Interface
    • Labels:
      None

      Description

      The goal is to move files from one repo to another through the webdav interface, using a webdav client, like Windows My Network Places or BitKinex

      Two repos where created and accessed with username/password
      http://localhost:8092/repository/repo1
      http://localhost:8092/repository/repo2

      Copying from one to another fails.
      Copying from any other webdav server to them works
      Copying from them to any other webdav server works
      Copying from local to them and from them to local of course works

      I tried with latest svn code from could.it which includes this MOVE improvement http://issues.apache.org/jira/browse/HADOOP-505 that makes a real move and not a copy+delete

      1. client.log
        15 kB
        Carlos Sanchez
      2. server.log
        49 kB
        Carlos Sanchez
      3. webdav-0.5-dev.jar
        105 kB
        Carlos Sanchez

        Issue Links

          Activity

          Carlos Sanchez created issue -
          Carlos Sanchez made changes -
          Field Original Value New Value
          Link This issue is related to MRM-172 [ MRM-172 ]
          Hide
          Carlos Sanchez added a comment -

          The code I tested from could.it is http://could.it/repo/webdav/head rev# 262

          Show
          Carlos Sanchez added a comment - The code I tested from could.it is http://could.it/repo/webdav/head rev# 262
          Hide
          Carlos Sanchez added a comment -

          Client and server logs

          Show
          Carlos Sanchez added a comment - Client and server logs
          Carlos Sanchez made changes -
          Attachment server.log [ 24207 ]
          Attachment client.log [ 24206 ]
          Hide
          Carlos Sanchez added a comment -

          Built version of http://could.it/repo/webdav/head rev# 262

          Show
          Carlos Sanchez added a comment - Built version of http://could.it/repo/webdav/head rev# 262
          Carlos Sanchez made changes -
          Attachment webdav-0.5-dev.jar [ 24208 ]
          Brett Porter made changes -
          Fix Version/s 1.0 [ 12113 ]
          Hide
          Joakim Erdfelt added a comment -

          What's happening (Technical)

          Request

          MOVE /repository/corporate/cas HTTP/1.1
          Content-Language: en-us
          Accept-Language: en-us
          Overwrite: F
          Destination: http://192.168.1.104:9091/repository/snapshots/cas
          Translate: f
          User-Agent: Microsoft Data Access Internet Publishing Provider DAV
          Host: 192.168.1.104:9091
          Content-Length: 0
          Connection: Keep-Alive
          Cookie: JSESSIONID=1ia9oq074832f
          Authorization: Basic YWRtaW46Ym9iMQ==
          

          Response

          HTTP/1.1 500 URI_scheme_is_not_file
          Content-Type: text/html; charset=ISO-8859-1
          Content-Length: 3887
          Server:  Archiva : CouldIT-WebDAV/0.4
          DAV: 1
          MS-Author-Via: DAV
          Connection: keep-alive
          
          <h2>HTTP ERROR: 500</h2><pre>URI scheme is not "file"</pre>
          <p>RequestURI=/repository/corporate/cas</p><h3>Caused by:</h3><pre>java.lang.IllegalArgumentException: URI scheme is not "file"
          .at java.io.File.<init>(File.java:324)
          .at it.could.webdav.DAVRepository.getResource(DAVRepository.java:125)
          .at it.could.webdav.methods.COPY.process(COPY.java:52)
          .at it.could.webdav.methods.MOVE.process(MOVE.java:47)
          .at it.could.webdav.DAVProcessor.process(DAVProcessor.java:79)
          .at org.apache.maven.archiva.web.servlet.repository.RepositoryAccess.servletRequest(RepositoryAccess.java:227)
          .at org.apache.maven.archiva.web.servlet.PlexusComponentServlet.service(PlexusComponentServlet.java:129)
          .at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:445)
          .at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1049)
          .at com.opensymphony.webwork.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:189)
          .at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1040)
          .at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
          

          The webdav servlet is being passed 2 pieces of information.

          The webdav servlet cannot handle moving a resource out to another URL.
          It expects local to repository moves only.
          That's why we get the URI scheme is not "file" error message.

          Potential Solutions:

          1. Deny COPY and MOVE requests from working.
          2. Adjust the destination header if it is determined to belong to another archiva repository before it.could.webdav handles the request.
          3. Create support for remove URL webdav move in it.could.webdav sourcebase using slide-webdav-client libraries.
          4. Dump it.could.webdav in favor of slide-webdav-servlet

          None of these solutions seem like a good idea to me.
          Any opinions?

          Show
          Joakim Erdfelt added a comment - What's happening (Technical) Request MOVE /repository/corporate/cas HTTP/1.1 Content-Language: en-us Accept-Language: en-us Overwrite: F Destination: http: //192.168.1.104:9091/repository/snapshots/cas Translate: f User-Agent: Microsoft Data Access Internet Publishing Provider DAV Host: 192.168.1.104:9091 Content-Length: 0 Connection: Keep-Alive Cookie: JSESSIONID=1ia9oq074832f Authorization: Basic YWRtaW46Ym9iMQ== Response HTTP/1.1 500 URI_scheme_is_not_file Content-Type: text/html; charset=ISO-8859-1 Content-Length: 3887 Server: Archiva : CouldIT-WebDAV/0.4 DAV: 1 MS-Author-Via: DAV Connection: keep-alive <h2>HTTP ERROR: 500</h2><pre>URI scheme is not "file" </pre> <p>RequestURI=/repository/corporate/cas</p><h3>Caused by:</h3><pre>java.lang.IllegalArgumentException: URI scheme is not "file" .at java.io.File.<init>(File.java:324) .at it.could.webdav.DAVRepository.getResource(DAVRepository.java:125) .at it.could.webdav.methods.COPY.process(COPY.java:52) .at it.could.webdav.methods.MOVE.process(MOVE.java:47) .at it.could.webdav.DAVProcessor.process(DAVProcessor.java:79) .at org.apache.maven.archiva.web.servlet.repository.RepositoryAccess.servletRequest(RepositoryAccess.java:227) .at org.apache.maven.archiva.web.servlet.PlexusComponentServlet.service(PlexusComponentServlet.java:129) .at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:445) .at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1049) .at com.opensymphony.webwork.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:189) .at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1040) .at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118) The webdav servlet is being passed 2 pieces of information. Source File to Move From: /repository/corporate/cas Destination to Move To: http://192.168.1.104:9091/repository/snapshots/cas The webdav servlet cannot handle moving a resource out to another URL. It expects local to repository moves only. That's why we get the URI scheme is not "file" error message. Potential Solutions: Deny COPY and MOVE requests from working. Adjust the destination header if it is determined to belong to another archiva repository before it.could.webdav handles the request. Create support for remove URL webdav move in it.could.webdav sourcebase using slide-webdav-client libraries. Dump it.could.webdav in favor of slide-webdav-servlet None of these solutions seem like a good idea to me. Any opinions?
          Hide
          Brett Porter added a comment -

          what's the downside of using slide?

          of them all, (2) seems like the "best" solution, assuming that is fairly straightfoward?

          Show
          Brett Porter added a comment - what's the downside of using slide? of them all, (2) seems like the "best" solution, assuming that is fairly straightfoward?
          Joakim Erdfelt made changes -
          Fix Version/s 1.0 [ 12113 ]
          Fix Version/s 1.0-alpha-2 [ 13518 ]
          Hide
          Joakim Erdfelt added a comment -

          The biggest concern in implementing solution #2 is the security aspect.
          This would mean the webdav impl is now aware of redback and archiva itself. (unless we do some smoke and mirrors on the incoming HttpServletRequest before the webdav impl gets it)

          Supporting the WebDav MOVE operation is going to be tricky.

          Show
          Joakim Erdfelt added a comment - The biggest concern in implementing solution #2 is the security aspect. This would mean the webdav impl is now aware of redback and archiva itself. (unless we do some smoke and mirrors on the incoming HttpServletRequest before the webdav impl gets it) Supporting the WebDav MOVE operation is going to be tricky.
          Joakim Erdfelt made changes -
          Fix Version/s 1.0-alpha-2 [ 13518 ]
          Fix Version/s 1.0.x [ 13571 ]
          james.w.dumay made changes -
          Assignee James William Dumay [ james.w.dumay ]
          Hide
          James William Dumay added a comment -

          Moving to webdav component

          Show
          James William Dumay added a comment - Moving to webdav component
          james.w.dumay made changes -
          Component/s WebDAV interface [ 12504 ]
          Component/s repository interface [ 12049 ]
          james.w.dumay made changes -
          Link This issue is superceded by MRM-781 [ MRM-781 ]
          Hide
          James William Dumay added a comment -

          This functionality should work once the migration to Jackrabbits webdav API is complete.

          Show
          James William Dumay added a comment - This functionality should work once the migration to Jackrabbits webdav API is complete.
          james.w.dumay made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          james.w.dumay made changes -
          Fix Version/s 1.x [ 13571 ]
          Fix Version/s 1.1 [ 13861 ]
          Hide
          James William Dumay added a comment -

          MRM-781 is now complete.

          Show
          James William Dumay added a comment - MRM-781 is now complete.
          james.w.dumay made changes -
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Closed [ 6 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 08:30:08 UTC 2015 [ 1428222608952 ]
          Mark Thomas made changes -
          Workflow jira [ 12707071 ] Default workflow, editable Closed status [ 12736483 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 21:01:51 UTC 2015 [ 1428267711911 ]
          Mark Thomas made changes -
          Workflow jira [ 12945482 ] Default workflow, editable Closed status [ 12982757 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open In Progress In Progress
          591d 2h 36m 1 james.w.dumay 05/Jul/08 00:05
          In Progress In Progress Closed Closed
          7m 29s 1 james.w.dumay 05/Jul/08 00:12

            People

            • Assignee:
              james.w.dumay
              Reporter:
              Carlos Sanchez
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development