Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » ResourceCopyTask appears to fail when authentication requried(Authentication is correct, and file is available, but copy fails)
ResourceCopyTask appears to fail when authentication requried [message #1746199] Tue, 25 October 2016 05:14 Go to next message
Chris Lake is currently offline Chris LakeFriend
Messages: 25
Registered: November 2015
Junior Member
Hi,

I was trying out a custom setup a couple of months back with 1.4.0 and had everything working nicely. Now I'm tasked with presenting what I worked on and have subsequently downloaded the current version to check everything is OK and found that the ResourceCopyTask no longer appears to work when needing authentication.

The eclipse-inst.ini contains:
-Doomph.redirection.mysite=http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/->http://my.svn.repo/svn/path/to/my/setups/

Note: I've tried https:// too.

Then the project.setup file contians:
  <setupTask
      xsi:type="setup:ResourceCopyTask"
      sourceURL="index:/the_file.ext"
      targetURL="configuration:/the_file.ext"/>


Now when I start the Oomph installer I'm prompted for a username/password. This works successfully and I can proceed through the wizard and the setup starts to install as expected.

Then when it gets to the ResourceCopyTask I am prompted for a username/password again, which I thought odd. Indeed, after unsuccessfully retrying 3 times using the correct credentials, the log shows:
Performing Resource Copy index:/the_file.ext --> configuration:/the_file.ext
Cannot copy non-existing http://my.svn.repo/svn/path/to/my/setups/the_file.ext to file:/C:/develop/eclipse/configuration/the_file.ext


If I copy that URL in to a web browser I can successfully view the file.

So:

  1. What am I doing wrong?
  2. Is there a place to download the older version of the setup EXE so I can do more tests?
  3. If not, can the current install be downgraded in some way so I can do more tests?


Thanks
Chris
Re: ResourceCopyTask appears to fail when authentication requried [message #1746202 is a reply to message #1746199] Tue, 25 October 2016 06:50 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
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 Go to previous messageGo to next message
Chris Lake is currently offline Chris LakeFriend
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 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
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/
Re: ResourceCopyTask appears to fail when authentication requried [message #1746389 is a reply to message #1746256] Fri, 28 October 2016 03:51 Go to previous message
Chris Lake is currently offline Chris LakeFriend
Messages: 25
Registered: November 2015
Junior Member
Hi Ed,

I opened Bug 506670.

Chris
Previous Topic:Preselect default workspace location in Eclipse Launcher
Next Topic:How can i write to the secure storage during setup?
Goto Forum:
  


Current Time: Sat Apr 20 04:11:24 GMT 2024

Powered by FUDForum. Page generated in 0.03292 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top