Bug 412102 - cannot create a query or update config as anonymous
Summary: cannot create a query or update config as anonymous
Status: RESOLVED WORKSFORME
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Mylyn Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-02 07:57 EDT by Tomasz Zarna CLA
Modified: 2013-07-12 13:37 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz Zarna CLA 2013-07-02 07:57:55 EDT
on master, trying to connect to a 2.4.1 Gerrit repo

Steps:
1. Go to Task repos view
2. Create a new Gerrit repo
3. Enter valid url and label
4. Check the Anonymous box
5. Validate and Finish
6. Try to create a query for all open changes

=> IS: "Problem updating repository: Gerrit connection issue: Failed to obtain Gerrit configuration", nothing in the Error Log
=> SHOULD BE: able to query open changes as anonymous
Comment 1 Tomasz Zarna CLA 2013-07-05 11:54:09 EDT
This happens because GerritClient tries to parse response after calling GET on "/", expecting to get a configuration there. The actual response:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <title>Gerrit Code Review</title>
    <script type="text/javascript" language="javascript">
      var href = window.location.href;
      var p = href.indexOf('#');
      var token;
      if (p >= 0) {
        token = href.substring(p + 1);
        if (token.length != 0 && token.charAt(0) == '/') {
          token = token.substring(1);
        }
        href = href.substring(0, p);
      } else {
        token = '';
      }
      window.location.replace(href + 'login/' + token);
    </script>
  </head>
  <body>
    <p>Redirecting to <a href="login/">Gerrit Code Review</a>.</p>
  </body>
</html>
Comment 2 Miles Parker CLA 2013-07-05 19:26:22 EDT
https://git.eclipse.org/r/#/c/14328/
Comment 3 Tomasz Zarna CLA 2013-07-08 07:39:01 EDT
See also bug 412496, for an exception thrown when adding a comment as anonymous user.
Comment 4 Miles Parker CLA 2013-07-10 13:54:26 EDT
Combined with https://git.eclipse.org/r/#/c/14294/ and abandoned https://git.eclipse.org/r/#/c/14328/.
Comment 5 Miles Parker CLA 2013-07-11 13:11:01 EDT
Ok, I have a candidate solution here https://git.eclipse.org/r/#/c/14294, but Steffen believes it is too extensive for inclusion in 2.0.1. I'm going to turn this back over to triage now.
Comment 6 Steffen Pingel CLA 2013-07-12 13:37:27 EDT
This looks like the repository doesn't support anonymous access if it redirects to the login page. I don't see how it makes sense to support a case where we can't obtain the configuration that to me indicates that the repository is not accessible (for whichever reason).

I'll mark this as worksforme since I can't reproduce the problem with the latest. Tomek, please reopen if you have respository URL to reproduce the problem and we can investigate further.