Archiva

Moving files between repos through webdav doesn't work

Details

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

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
    21/Nov/06 8:39 PM
    15 kB
    Carlos Sanchez
  2. server.log
    21/Nov/06 8:39 PM
    49 kB
    Carlos Sanchez

Issue Links

Activity

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
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
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. 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?
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?
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.
Hide
James William Dumay added a comment -

Moving to webdav component

Show
James William Dumay added a comment - Moving to webdav component
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.
Hide
James William Dumay added a comment -

MRM-781 is now complete.

Show
James William Dumay added a comment - MRM-781 is now complete.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: