Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

listRemotePaths #71

Closed
wandell opened this issue Jun 19, 2016 · 9 comments · Fixed by #72
Closed

listRemotePaths #71

wandell opened this issue Jun 19, 2016 · 9 comments · Fixed by #72
Assignees
Labels

Comments

@wandell
Copy link
Contributor

wandell commented Jun 19, 2016

@benjamin-heasly

Many things are working, but unfortunately this listRemotePaths command is failing

rd = RdtClient('isetbio');
rd.listRemotePaths

Response stream is undefined
 below is a Java Error dump (truncated):
Error using urlread2 (line 217)
Java exception occurred:
java.io.IOException: Server returned HTTP response code: 403 for URL:
http://52.32.77.154/restServices/archivaServices/searchService/getAllGroupIds?selectedRepos=isetbio
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1625)

Error in rdtRequestWeb (line 91)
        responseText = urlread2(encodedUrl, 'GET', '', headers, ...

Error in rdtListRemotePaths (line 36)
response = rdtRequestWeb(configuration, resourcePath, 'queryParams', params);

Error in RdtClient/listRemotePaths (line 77)
            remotePaths = rdtListRemotePaths(obj.configuration, varargin{:});

An example of a command that works is

rd.openBrowser

or even the more complex call

rd = RdtClient('isetbio');
rd.crp('/resources/scenes/hyperspectral/manchester_database/2002');

a = rd.listArtifacts('type','mat');
sData = rd.readArtifact(a(1),'type','mat');

%%
scene = sceneFromBasis(sData);
scene = sceneSet(scene,'name','Manchester 2002 scene1');
ieAddObject(scene); sceneWindow;

Sorry to bother you, but this is beyond my debugging knowledge.

@benjamin-heasly
Copy link
Contributor

Hi @wandell .

Let me see -- the error is HTTP status 403, which means "forbidden". So somehow there is an authorization problem when listing remote paths.

It is odd that you can list artifacts, but not list remote paths. I maybe these two operations require different permissions in Archiva's view of the world.

I see your configuration is called "isetbio". Is this the standard isetbio configuration with the "guest" account?

@benjamin-heasly
Copy link
Contributor

OK, using the standard "isetbio" configuration I am able to reproduce the behavior you pasted above. So there's a good chance I can fix today. #famouslastwords

@benjamin-heasly
Copy link
Contributor

benjamin-heasly commented Jun 20, 2016

I did some testing and looked into the Archiva source code.

Indeed, the operation where we list remote paths has a restriction flag set (source). But the operation where we list artifacts does not (source).

I don't know why these operations are treated differently. But this explains why the guest user can't list remote paths.

Logged-in users can list remote paths. So that is a partial, quick workaround. It also explains why our automated tests did not catch this bug.

I will implement a better fix where we list remote paths using alternative REST calls to Archiva, which are not restricted (source).

The new implementation will have to make multiple REST calls instead of one. But this detail should be hidden by the toolbox so that our user-level Matlab scripts can stay the same.

@benjamin-heasly
Copy link
Contributor

OK, I think I've fixed this;

  • re-implemented rdtListPaths() with an alternative REST call that works with "guest" user
  • added automated tests to be sure "guest" user can list paths
  • pull request: List paths no auth #72

@benjamin-heasly
Copy link
Contributor

I went ahead and merged the PR unilaterally.

@wandell would you please pull from master and try your script again?

@wandell
Copy link
Contributor Author

wandell commented Jun 20, 2016

The listRemotePaths function now works! Great!

However, I was going to try logging in and try the function while logged in, too.

But ... the username and password that worked for me this weekend is now being rejected. Any chance you understand that?


From: Ben Heasly notifications@github.com
Sent: Monday, June 20, 2016 1:52:44 PM
To: isetbio/RemoteDataToolbox
Cc: Brian A Wandell; Mention
Subject: Re: [isetbio/RemoteDataToolbox] listRemotePaths (#71)

I went ahead and merged the PR unilaterally.

@wandellhttps://github.com/wandell would you please pull from master and try your script again?

You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com//issues/71#issuecomment-227265857, or mute the threadhttps://github.com/notifications/unsubscribe/ABwIWcTn2zlnKmEcmLgiOJiDSv5BHZwCks5qNv2cgaJpZM4I5PLR.

@wandell
Copy link
Contributor Author

wandell commented Jun 20, 2016

I should have added that this is the error

Response stream is undefined
 below is a Java Error dump (truncated):
Credentials not accepted:
Java exception occurred:
java.io.IOException: Server returned HTTP response code: 403 for URL: http://52.32.77.154/restServices/archivaServices/pingService/pingWithAuthz
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1625)

From: Brian A Wandell
Sent: Monday, June 20, 2016 1:58:42 PM
To: isetbio/RemoteDataToolbox; isetbio/RemoteDataToolbox
Cc: Mention
Subject: Re: [isetbio/RemoteDataToolbox] listRemotePaths (#71)

The listRemotePaths function now works! Great!

However, I was going to try logging in and try the function while logged in, too.

But ... the username and password that worked for me this weekend is now being rejected. Any chance you understand that?


From: Ben Heasly notifications@github.com
Sent: Monday, June 20, 2016 1:52:44 PM
To: isetbio/RemoteDataToolbox
Cc: Brian A Wandell; Mention
Subject: Re: [isetbio/RemoteDataToolbox] listRemotePaths (#71)

I went ahead and merged the PR unilaterally.

@wandellhttps://github.com/wandell would you please pull from master and try your script again?

You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com//issues/71#issuecomment-227265857, or mute the threadhttps://github.com/notifications/unsubscribe/ABwIWcTn2zlnKmEcmLgiOJiDSv5BHZwCks5qNv2cgaJpZM4I5PLR.

@benjamin-heasly
Copy link
Contributor

Oh, that's annoying about your password. I think Archiva wants you to go to the web interface and reset your password.

... which Archiva is not supposed to be doing. We encountered a password reset issue earlier this year, and it was irritating. I thought I understood the problem and fixed it at the time. Apparently I didn't succeed.

If you do reset your password I think you'll be able to keep working. I will take another look at preventing this from happening every 3 months.

@wandell
Copy link
Contributor Author

wandell commented Jun 20, 2016

So, just coincidental timing.

Anyway, you were right. I changed the password and I am back in business.

Thanks again for your help!

Brian


From: Ben Heasly notifications@github.com
Sent: Monday, June 20, 2016 2:18:04 PM
To: isetbio/RemoteDataToolbox
Cc: Brian A Wandell; Mention
Subject: Re: [isetbio/RemoteDataToolbox] listRemotePaths (#71)

Oh, that's annoying about your password. I think Archiva wants you to go to the web interface and reset your password.

... which Archiva is not supposed to be doing. We encountered a password reset issue earlier this year, and it was irritating. I thought I understood the problem and fixed it at the time. Apparently I didn't succeed.

If you do reset your password I think you'll be able to keep working. I will take another look at preventing this from happening every 3 months.

You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com//issues/71#issuecomment-227272465, or mute the threadhttps://github.com/notifications/unsubscribe/ABwIWbfQ4vGYLgo3wzKq_Xdjj5er5H2Fks5qNwOMgaJpZM4I5PLR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants