Home » Eclipse Projects » Oomph » ResourceCopyTask appears to fail when authentication requried(Authentication is correct, and file is available, but copy fails)
|
Re: ResourceCopyTask appears to fail when authentication requried [message #1746202 is a reply to message #1746199] |
Tue, 25 October 2016 06:50 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
It should all be going through the ECFURIHandlerImpl so setting the -Doomph.setup.ecf.trace=true will trace to System.out detailed information about how each URI is processed. Perhaps that will help pinpoint the error.
Certainly I expect a given host to need authentication at most once and I've done a lot of work in the last weeks on authentication issues for a customer with very complex authentication issues. Are you using the latest 1.6 build?
I notice though that the copy task specifically uses uriConverter.exists(sourceURI, null) and that no longer just checks if an input stream can be created but rather calls getAttributes which does a HEAD request instead of a GET request so perhaps the new issue is related to poor handling of the HEAD request logic or perhaps poor handling by the server (i.e., perhaps not returning unauthorized but rather not found).
I can try to reproduce this with the customer site that I've been using, but it's EclipseCon Europe this week, so response time is down. Please feel free to open a Bugzilla if you reach the conclusion that something is not quite right in org.eclipse.oomph.setup.internal.core.util.ECFURIHandlerImpl.getRemoteAttributes(URI, Map<?, ?>) and hopefully I'll be able to reproduce that with a site that behaves similarly...
public boolean exists(URI uri, Map<?, ?> options)
{
return !getAttributes(uri, options).isEmpty();
}
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: ResourceCopyTask appears to fail when authentication requried [message #1746253 is a reply to message #1746202] |
Wed, 26 October 2016 02:59 |
Chris Lake Messages: 25 Registered: November 2015 |
Junior Member |
|
|
Hi Ed,
Thanks for the response. I have found the old install (1.4.0.2444), and worked out how to get that build running in Eclipse (just to note, the new version I'm running is 1.5.0.2683).
However, the problem I now face is that that build does not work either! So perhaps something has changed at our end, but it is odd how one authorization works but then the next does not.
Anyway, whilst I investigate, here are the traces. For 1.4.0.2444 (d2a2856) which did work:
## Initial connect to get all the custom Setup files....
> ECF: http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore uri=http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore
> ECF: http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore cacheURI=file:/C:/Users/myuser/.eclipse/org.eclipse.oomph.setup/cache/http___my.svn.repo_svn_path_to_my_setups_models_Git.ecore
> ECF: http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore eTag=null
> ECF: http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore expectedETag=null
> ECF: http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore proxy=null
> ECF: http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore username=null
> ECF: http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore password=null
> ECF: http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore authorizationHandler=org.eclipse.oomph.setup.internal.core.util.ECFURIHandlerImpl$AuthorizationHandlerImpl@f3cef4e
> ECF: http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore trying=0
> ECF: http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore triedReauthorization=0
> ECF: http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore authorization=null
> ECF: http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore transferLister.exception
org.eclipse.ecf.filetransfer.IncomingFileTransferException: Unauthorized
at org.eclipse.ecf.provider.filetransfer.httpclient4.HttpClientRetrieveFileTransfer.openStreams(HttpClientRetrieveFileTransfer.java:652)
at org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer.sendRetrieveRequest(AbstractRetrieveFileTransfer.java:885)
at org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer.sendRetrieveRequest(AbstractRetrieveFileTransfer.java:576)
at org.eclipse.ecf.provider.filetransfer.retrieve.MultiProtocolRetrieveAdapter.sendRetrieveRequest(MultiProtocolRetrieveAdapter.java:106)
at org.eclipse.oomph.setup.internal.core.util.ECFURIHandlerImpl.createInputStream(ECFURIHandlerImpl.java:581)
at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createInputStream(ExtensibleURIConverterImpl.java:360)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1269)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
at org.eclipse.oomph.setup.internal.core.util.SetupCoreUtil$1ModelResourceSet.demandLoad(SetupCoreUtil.java:227)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:406)
at org.eclipse.oomph.setup.internal.core.util.SetupCoreUtil$1ModelResourceSet.getResource(SetupCoreUtil.java:185)
at org.eclipse.oomph.setup.internal.core.util.SetupCoreUtil$1.getResource(SetupCoreUtil.java:298)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$ResourceLocator.basicGetResource(ResourceSetImpl.java:743)
at org.eclipse.oomph.setup.internal.core.util.ResourceMirror$DelegatingResourceLocator.getResource(ResourceMirror.java:192)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:352)
at org.eclipse.oomph.setup.internal.core.util.ResourceMirror.isCompleted(ResourceMirror.java:146)
at org.eclipse.oomph.setup.internal.core.util.ResourceMirror.isCompleted(ResourceMirror.java:1)
at org.eclipse.oomph.util.WorkerPool.schedule(WorkerPool.java:268)
at org.eclipse.oomph.setup.internal.core.util.ResourceMirror.access$3(ResourceMirror.java:1)
at org.eclipse.oomph.setup.internal.core.util.ResourceMirror$LoadJob.visit(ResourceMirror.java:295)
at org.eclipse.oomph.setup.internal.core.util.ResourceMirror$LoadJob.perform(ResourceMirror.java:243)
at org.eclipse.oomph.util.WorkerPool$Worker.run(WorkerPool.java:416)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
> ECF: http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore errorCode=401
> ECF: http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore trying=0
> ECF: http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore triedReauthorization=0
> ECF: http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore authorization=Authorization [user=myuser, password=]
> ECF: http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore writing cache
> ECF: http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore returning successful results
...
## Then attempting to complete the ResourceCopyTask....
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext uri=http://my.svn.repo/svn/path/to/my/setups/the_file.ext
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext cacheURI=file:/C:/Users/myuser/.eclipse/org.eclipse.oomph.setup/cache/http___my.svn.repo_svn_path_to_my_setups_the_file.ext
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext eTag=null
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext expectedETag=null
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext proxy=null
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext username=null
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext password=null
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext authorizationHandler=org.eclipse.oomph.setup.internal.core.util.ECFURIHandlerImpl$AuthorizationHandlerImpl@f3cef4e
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext trying=0
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext triedReauthorization=0
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext authorization=null
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext transferLister.exception
org.eclipse.ecf.filetransfer.BrowseFileTransferException: Unauthorized
at org.eclipse.ecf.provider.filetransfer.httpclient4.HttpClientFileSystemBrowser.runRequest(HttpClientFileSystemBrowser.java:283)
at org.eclipse.ecf.provider.filetransfer.browse.AbstractFileSystemBrowser$DirectoryJob.run(AbstractFileSystemBrowser.java:69)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext errorCode=401
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext trying=0
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext triedReauthorization=0
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext authorization=Authorization [user=myuser, password=]
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext transferLister.exception
org.eclipse.ecf.filetransfer.BrowseFileTransferException: Unauthorized
at org.eclipse.ecf.provider.filetransfer.httpclient4.HttpClientFileSystemBrowser.runRequest(HttpClientFileSystemBrowser.java:283)
at org.eclipse.ecf.provider.filetransfer.browse.AbstractFileSystemBrowser$DirectoryJob.run(AbstractFileSystemBrowser.java:69)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext errorCode=401
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext trying=0
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext triedReauthorization=1
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext authorization=Authorization [user=anotheruser, password=]
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext transferLister.exception
org.eclipse.ecf.filetransfer.BrowseFileTransferException: Unauthorized
at org.eclipse.ecf.provider.filetransfer.httpclient4.HttpClientFileSystemBrowser.runRequest(HttpClientFileSystemBrowser.java:283)
at org.eclipse.ecf.provider.filetransfer.browse.AbstractFileSystemBrowser$DirectoryJob.run(AbstractFileSystemBrowser.java:69)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext errorCode=401
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext trying=0
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext triedReauthorization=2
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext authorization=Authorization [user=myuser, password=]
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext transferLister.exception
org.eclipse.ecf.filetransfer.BrowseFileTransferException: Unauthorized
at org.eclipse.ecf.provider.filetransfer.httpclient4.HttpClientFileSystemBrowser.runRequest(HttpClientFileSystemBrowser.java:283)
at org.eclipse.ecf.provider.filetransfer.browse.AbstractFileSystemBrowser$DirectoryJob.run(AbstractFileSystemBrowser.java:69)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext errorCode=401
And the trace for current master HEAD (530f4bd) gives us:
## Initial connect to get all the custom Setup files....
> ECF: http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore uri=http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore
> ECF: http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore cacheURI=file:/C:/Users/myuser/.eclipse/org.eclipse.oomph.setup/cache/http___my.svn.repo_svn_path_to_my_setups_models_Git.ecore
> ECF: http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore eTag=null
> ECF: http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore expectedETag=null
> ECF: http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore proxy=null
> ECF: http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore username=null
> ECF: http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore password=null
> ECF: http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore authorizationHandler=org.eclipse.oomph.setup.internal.core.util.ECFURIHandlerImpl$AuthorizationHandlerImpl@5286c33a
> ECF: http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore trying=0
> ECF: http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore triedReauthorization=0
> ECF: http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore authorization=Authorization [user=myuser, password=]
> ECF: http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore writing cache
> ECF: http://my.svn.repo/svn/path/to/my/setups/models/Git.ecore returning successful results
...
## Then attempting to complete the ResourceCopyTask....
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext uri=http://my.svn.repo/svn/path/to/my/setups/the_file.ext
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext cacheURI=file:/C:/Users/myuser/.eclipse/org.eclipse.oomph.setup/cache/http___my.svn.repo_svn_path_to_my_setups_the_file.ext
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext eTag=null
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext expectedETag=null
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext proxy=null
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext username=null
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext password=null
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext authorizationHandler=org.eclipse.oomph.setup.internal.core.util.ECFURIHandlerImpl$AuthorizationHandlerImpl@5286c33a
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext trying=0
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext triedReauthorization=0
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext authorization=null
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext transferLister.exception
org.eclipse.ecf.filetransfer.BrowseFileTransferException: Unauthorized
at org.eclipse.ecf.provider.filetransfer.httpclient4.HttpClientFileSystemBrowser.runRequest(HttpClientFileSystemBrowser.java:283)
at org.eclipse.ecf.provider.filetransfer.browse.AbstractFileSystemBrowser$DirectoryJob.run(AbstractFileSystemBrowser.java:69)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext errorCode=401
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext trying=0
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext triedReauthorization=0
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext authorization=Authorization [user=myuser, password=]
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext transferLister.exception
org.eclipse.ecf.filetransfer.BrowseFileTransferException: Unauthorized
at org.eclipse.ecf.provider.filetransfer.httpclient4.HttpClientFileSystemBrowser.runRequest(HttpClientFileSystemBrowser.java:283)
at org.eclipse.ecf.provider.filetransfer.browse.AbstractFileSystemBrowser$DirectoryJob.run(AbstractFileSystemBrowser.java:69)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext errorCode=401
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext trying=0
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext triedReauthorization=1
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext authorization=Authorization [user=anotheruser, password=]
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext transferLister.exception
org.eclipse.ecf.filetransfer.BrowseFileTransferException: Unauthorized
at org.eclipse.ecf.provider.filetransfer.httpclient4.HttpClientFileSystemBrowser.runRequest(HttpClientFileSystemBrowser.java:283)
at org.eclipse.ecf.provider.filetransfer.browse.AbstractFileSystemBrowser$DirectoryJob.run(AbstractFileSystemBrowser.java:69)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext errorCode=401
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext trying=0
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext triedReauthorization=2
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext authorization=Authorization [user=myuser, password=]
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext transferLister.exception
org.eclipse.ecf.filetransfer.BrowseFileTransferException: Unauthorized
at org.eclipse.ecf.provider.filetransfer.httpclient4.HttpClientFileSystemBrowser.runRequest(HttpClientFileSystemBrowser.java:283)
at org.eclipse.ecf.provider.filetransfer.browse.AbstractFileSystemBrowser$DirectoryJob.run(AbstractFileSystemBrowser.java:69)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext errorCode=401
Digging some more, looking at ECFURIHandlerImpl as suggested I noticed the following:
private Map<String, ?> getRemoteAttributes(URI uri, Map<?, ?> options) {
...
String username;
String password;
String uriString = uri.toString();
Proxy proxy = ProxySetupHelper.getProxy(uriString);
if (proxy != null)
{
username = proxy.getUsername();
password = proxy.getPassword();
}
else
{
username = null;
password = null;
}
...
if (username != null)
{
fileBrowser.setConnectContextForAuthentication(ConnectContextFactory.createUsernamePasswordConnectContext(username, password));
}
else if (password != null)
{
fileBrowser.setConnectContextForAuthentication(ConnectContextFactory.createPasswordConnectContext(password));
}
It seemed to me that the un/pwd were never set for authorization. Indeed, if I added some test code (I don't really know how the proxy/authorization un/pwd combination is supposed to work, but I'm not behind a proxy):
else if (authorization != null && authorization.isAuthorized())
{
fileBrowser.setConnectContextForAuthentication(
ConnectContextFactory.createUsernamePasswordConnectContext(authorization.getUser(), authorization.getPassword()));
}
Then everything started to work, as the trace shows:
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext uri=http://my.svn.repo/svn/path/to/my/setups/the_file.ext
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext cacheURI=file:/C:/Users/myuser/.eclipse/org.eclipse.oomph.setup/cache/http___my.svn.repo_svn_path_to_my_setups_the_file.ext
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext eTag=null
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext expectedETag=null
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext proxy=null
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext username=null
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext password=null
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext authorizationHandler=org.eclipse.oomph.setup.internal.core.util.ECFURIHandlerImpl$AuthorizationHandlerImpl@4a11eb84
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext trying=0
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext triedReauthorization=0
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext authorization=null
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext transferLister.exception
org.eclipse.ecf.filetransfer.BrowseFileTransferException: Unauthorized
at org.eclipse.ecf.provider.filetransfer.httpclient4.HttpClientFileSystemBrowser.runRequest(HttpClientFileSystemBrowser.java:283)
at org.eclipse.ecf.provider.filetransfer.browse.AbstractFileSystemBrowser$DirectoryJob.run(AbstractFileSystemBrowser.java:69)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext errorCode=401
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext trying=0
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext triedReauthorization=0
>? ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext authorization=Authorization [user=myuser, password=]
> ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext uri=http://my.svn.repo/svn/path/to/my/setups/the_file.ext
> ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext cacheURI=file:/C:/Users/myuser/.eclipse/org.eclipse.oomph.setup/cache/http___my.svn.repo_svn_path_to_my_setups_the_file.ext
> ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext eTag=null
> ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext expectedETag=null
> ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext proxy=null
> ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext username=null
> ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext password=null
> ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext authorizationHandler=org.eclipse.oomph.setup.internal.core.util.ECFURIHandlerImpl$AuthorizationHandlerImpl@4a11eb84
> ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext trying=0
> ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext triedReauthorization=0
> ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext authorization=Authorization [user=myuser, password=]
> ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext writing cache
> ECF: http://my.svn.repo/svn/path/to/my/setups/the_file.ext returning successful results
I hope all this information is useful. I can open a BugZilla ticket if you like, and I presume you'd want most of this information in it.
Chris
|
|
|
Re: ResourceCopyTask appears to fail when authentication requried [message #1746256 is a reply to message #1746253] |
Wed, 26 October 2016 06:40 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
Chris,
Looking at the code this morning and seeing this:
// ECF doesn't support such options.
// I'm not sure how it can browser a file that's authorization protected and it also behind an authorization protected firewall.
// Map<Object, Object> requestOptions = new HashMap<Object, Object>();
// requestOptions.put(IRetrieveFileTransferOptions.CONNECT_TIMEOUT, CONNECT_TIMEOUT);
// requestOptions.put(IRetrieveFileTransferOptions.READ_TIMEOUT, READ_TIMEOUT);
// if (authorization != null && authorization.isAuthorized())
// {
// requestOptions.put(IRetrieveFileTransferOptions.REQUEST_HEADERS, Collections.singletonMap("Authorization", authorization.getAuthorization()));
// }
It's clear this cannot work as written for a host that requires authentication. But as the comment suggests, I'm not sure who the combination of a proxy that requires authentication communicating with a host that also requires authentication works. Looking deeper into ECF, I suspect I'm just not doing it quite right. I think probably I should never set the proxy because ECF appears to do this under the covers if I don't set it, and the proxy instance already contains the credentials for communicating with the proxy, so I believe now that the connect context should also be the credentials for the actual host, not the proxy...
Please open a Bugzilla for this problem. I really need to set up some kind of proxy simulator so I can properly test these proxy scenarios; there is already an outstanding bugzilla relating to proxies not working...
Note that as a workaround (maybe) you can ensure that the file is in your cache so that this part of the logic kicks in:
if (!CacheHandling.CACHE_IGNORE.equals(cacheHandling) && uriConverter.exists(cacheURI, options)
&& (!(fileSystemListener.exception instanceof RemoteFileSystemException)
|| ((BrowseFileTransferException)fileSystemListener.exception).getErrorCode() != HttpURLConnection.HTTP_NOT_FOUND))
{
return handleAttributes(requestedAttributes, uriConverter.getAttributes(cacheURI, options));
}
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
| |
Goto Forum:
Current Time: Sat Apr 20 04:11:24 GMT 2024
Powered by FUDForum. Page generated in 0.03292 seconds
|