Gerrit 3.6.1 loginUrl has wrong suffix

184 views
Skip to first unread message

程洋

unread,
Nov 23, 2022, 11:46:16 AM11/23/22
to Repo and Gerrit Discussion
Recently we swith our Gerrit from LDAP to CAS. everything works fine. But if i login directly from main page, it will then redirect to "https://gerrit.pt.mioffice.cn//". which has 2 slashes at the end, and in turn to 404.

After some debugging, the core function is "callback" function in "gerrit/java/com/google/gerrit/httpd/auth/openid/OpenIdServiceImpl.java". If there is not "gerrit.token" parameter in "/OpenID" request, it will just append a "/" after CanonicalWebUrl.

But gerrit 3.2.3 doesn't have such problem. Its login button href always has redirect url. But gerrit 3.6.1 login button's href is "https://gerrit.pt.mioffice.cn/login/%2F" instead of  "http://git.xiaomi.com/login/%2Fq%2Fstatus%3Aopen%2B-is%3Awip"

Is it some sort of front-end bug?1.png

程洋

unread,
Nov 23, 2022, 11:49:05 AM11/23/22
to Repo and Gerrit Discussion
This is screenshot of gerrit 3.2.3.
screensshot in the previous thread is from gerrit 3.6.1

2.png

Ben Rohlfs

unread,
Nov 23, 2022, 1:22:40 PM11/23/22
to 程洋, Repo and Gerrit Discussion
I think this is fixed, but we have not created a patch release with the fix yet:
352594: Fix the issue that 404 page is shown after login. | https://gerrit-review.git.corp.google.com/c/gerrit/+/352594

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/4576e95d-0f00-4031-ada5-819250009393n%40googlegroups.com.

Matthias Sohn

unread,
Nov 23, 2022, 2:44:05 PM11/23/22
to Ben Rohlfs, 程洋, Repo and Gerrit Discussion
On Wed, Nov 23, 2022 at 7:22 PM 'Ben Rohlfs' via Repo and Gerrit Discussion <repo-d...@googlegroups.com> wrote:
I think this is fixed, but we have not created a patch release with the fix yet:
352594: Fix the issue that 404 page is shown after login. | https://gerrit-review.git.corp.google.com/c/gerrit/+/352594

This fix is available on the branches stable-3.7 and master, could it be downported to stable-3.6 to help this user ? 

On Wed, 23 Nov 2022 at 17:49, 程洋 <d171...@gmail.com> wrote:
This is screenshot of gerrit 3.2.3.
screensshot in the previous thread is from gerrit 3.6.1

2.png

On Thursday, November 24, 2022 at 12:46:16 AM UTC+8 程洋 wrote:
Recently we swith our Gerrit from LDAP to CAS. everything works fine. But if i login directly from main page, it will then redirect to "https://gerrit.pt.mioffice.cn//". which has 2 slashes at the end, and in turn to 404.

After some debugging, the core function is "callback" function in "gerrit/java/com/google/gerrit/httpd/auth/openid/OpenIdServiceImpl.java". If there is not "gerrit.token" parameter in "/OpenID" request, it will just append a "/" after CanonicalWebUrl.

But gerrit 3.2.3 doesn't have such problem. Its login button href always has redirect url. But gerrit 3.6.1 login button's href is "https://gerrit.pt.mioffice.cn/login/%2F" instead of  "http://git.xiaomi.com/login/%2Fq%2Fstatus%3Aopen%2B-is%3Awip"

Is it some sort of front-end bug?1.png

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/4576e95d-0f00-4031-ada5-819250009393n%40googlegroups.com.

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.

Luca Milanesio

unread,
Nov 23, 2022, 2:46:33 PM11/23/22
to Repo and Gerrit Discussion, Luca Milanesio, Ben Rohlfs, 程洋, Matthias Sohn

On 23 Nov 2022, at 19:43, Matthias Sohn <matthi...@gmail.com> wrote:



On Wed, Nov 23, 2022 at 7:22 PM 'Ben Rohlfs' via Repo and Gerrit Discussion <repo-d...@googlegroups.com> wrote:
I think this is fixed, but we have not created a patch release with the fix yet:
352594: Fix the issue that 404 page is shown after login. | https://gerrit-review.git.corp.google.com/c/gerrit/+/352594

This fix is available on the branches stable-3.7 and master, could it be downported to stable-3.6 to help this user ? 

Sure, good idea.
Also, there is another fix I’m waiting for (GitWeb project root broken) and then I can do another round of patch-releases.

Luca.


On Wed, 23 Nov 2022 at 17:49, 程洋 <d171...@gmail.com> wrote:
This is screenshot of gerrit 3.2.3.
screensshot in the previous thread is from gerrit 3.6.1

程洋

unread,
Nov 23, 2022, 9:00:31 PM11/23/22
to Repo and Gerrit Discussion
https://gerrit-review.git.corp.google.com/c/gerrit/+/352594 seems to be a internal website of Google
I can compile on my own. Thanks very much

程洋

unread,
Nov 24, 2022, 9:04:50 PM11/24/22
to Repo and Gerrit Discussion
It seems that this change has a really big conflict on 3.6.1
we resolve this conflict manually but some web pages went wrong. :)

程洋

unread,
Nov 26, 2022, 11:11:08 PM11/26/22
to Repo and Gerrit Discussion
Please reminder me if the patch is released. Thanks :)

Ben Rohlfs

unread,
Nov 28, 2022, 2:20:57 AM11/28/22
to 程洋, Repo and Gerrit Discussion
Here is the downport to 3.6: 352855: Fix the issue that 404 page is shown after login | https://gerrit-review.git.corp.google.com/c/gerrit/+/352855

Ben Rohlfs

unread,
Nov 28, 2022, 2:21:33 AM11/28/22
to 程洋, Repo and Gerrit Discussion

Robert Tomczyk

unread,
Nov 28, 2022, 2:22:36 AM11/28/22
to Repo and Gerrit Discussion
Hi lucamilansio,

  Would you please say more about this bug: "Also, there is another fix I’m waiting for (GitWeb project root broken) "
  I think I'm hitting this as well, after upgrading to Gerrit 3.6.3 I'm getting 404 errors for Gitweb.

///Robert

Matthias Sohn

unread,
Nov 28, 2022, 3:51:52 AM11/28/22
to Robert Tomczyk, Repo and Gerrit Discussion
On Mon, Nov 28, 2022 at 8:22 AM Robert Tomczyk <robert.x...@gmail.com> wrote:
Hi lucamilansio,

  Would you please say more about this bug: "Also, there is another fix I’m waiting for (GitWeb project root broken) "
  I think I'm hitting this as well, after upgrading to Gerrit 3.6.3 I'm getting 404 errors for Gitweb

程洋

unread,
Dec 1, 2022, 8:51:20 PM12/1/22
to Repo and Gerrit Discussion
https://gerrit-review.git.corp.google.com/c/gerrit/+/352855

Is it a Google internal website? It seems that i cannot login.
Would mind upload it to https://gerrit-review.googlesource.com ?

Matthias Sohn

unread,
Dec 2, 2022, 4:39:34 AM12/2/22
to 程洋, Repo and Gerrit Discussion

程洋

unread,
Dec 9, 2022, 3:00:09 AM12/9/22
to Repo and Gerrit Discussion
Thanks. This change works like a charm!
Reply all
Reply to author
Forward
0 new messages