13

This question asked by coderss but restarting the computer seems to noneffective.

422 The change you requested was rejected. Make sure you have access to the thing you tried to change. Please contact your GitLab administrator if you think this is a mistake.

I have above error in Firefox under Linux but I have access in Chromium. That's looks like typical cookie problem.

I tried clear all Gitlab related cookies then restarted computer without any new sign in attempt. and restarted computer :) yeah I just try

But still same error, same browser.

How can I handle this problem?

This error also occurs at forgot password section and in private tab of Firefox.

Is there another Gitlab related cookie?

maxemilian
  • 347
  • 1
  • 3
  • 15
  • I wouldn't prefer cleaning all cookies under preferences-->Privacy & Security-->`Cookies and Site Data`> clear data. I intent to easy way for unless cleaning all cookies but even if clean `all cokies and site data and Chached web content` doesn't work. It is amazing. I cleaned everything but Still taking 422. – maxemilian Jan 22 '21 at 03:05

7 Answers7

16

The issue should be fixed not only with cookies as discribed, but also with a correction of time system. I faced exactly the same problem: unable to connect with Firefox, even with a reset of cookies, but I was able to connect with Chrome. (That sounds strange because my clock system was false even on Chrome.)

The solution came with this very short explanation:

"it's was because my local time zone wasn't set up properly (and was messing with cookies)" Source: https://www.reddit.com/r/gitlab/comments/cv7pov/422_error_on_wwwgitlabcomuserssignin_and/ey7l7lz?utm_source=share&utm_medium=web2x&context=3

lionel
  • 196
  • 1
  • 5
  • Yeah, I have a problem with my distro's timer which little broken. I couldn't set a time zone then forced to set a time trivial. It has still broken but GitLab work nowadays. – maxemilian Mar 31 '21 at 05:44
  • Thanks. I also have this problem, because I used Windows and Ubuntu on the same machine. Whenever I start Windows then restart to Ubuntu, the clock is wrong because of two OS difference in interpreting local clock. – Anh Tuan Oct 01 '21 at 06:51
6

This was followed by issue 35447 and issue 40898.

The last one included:

Ok, I suspect the issue here for many people is that the GitLab session cookie is set to Secure here: https://gitlab.com/gitlab-org/gitlab-ce/blob/9c491bc628f5a72424b82bb01e2457150bf2e71c/config/initializers/session_store.rb#L25

Setting the right SSL headers fixes the problem.

If, for some reason, the connection doesn't appear to be an HTTPS connection, Rails won't send a cookie, and the client won't be able to login. You may be able to confirm this by checking the response headers in the GET /users/sign_in endpoint: if you see a _gitlab_session cookie being sent the first time you load the page, then things are working properly.

And:

JuKu JuKu @JuKu · 1 year ago

Solution for HaProxy:

Add these line to your frontend: reqadd X-Forwarded-Proto:\ http

After this change, it worked for me.

See also: https://www.digitalocean.com/community/tutorials/how-to-implement-ssl-termination-with-haproxy-on-ubuntu-14-04

That would avoid the dreaded:

https://gitlab.com/gitlab-org/gitlab-foss/uploads/7ef0738b531b0475e1f52a6fa700917a/Unbenannt101.PNG

But it depends on the type of GitLab used (gitlab.com or an on-premise GitLab, and the type of Web server used)

For example, issue 53085 refers to issue 54493:

The group had internal availability, while one of it's projects was public (not the one I was having so much trouble with, which was private).

Making the group public solved the problem.


The OP maxemilian reports in the comments it is working now with Firefox on Manjaro:

I checked my updates diary, but only zoom matches between Firefox access time successfully.
I pretty sure this was related to GitLab login code. Suspicious dates (Jan 6- Jan 21 and Feb 3- Feb 6).
I think This update done by GitLab the dates between Feb 3- Feb 6.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thank you for amazing compilation. I glanced all of them but I coudn't get access. Particularly Nicola Luraghi solution looks fit my situation. Still giving error. I even cleaned everything in Firefox – maxemilian Jan 22 '21 at 03:02
  • 1
    @maxemilian Darn. That is frustrating! Does it persists with a different computer? – VonC Jan 22 '21 at 09:00
  • I can sign in with firefox on android. No problem. But I deleted everything on my manjaro related Firefox then reinstalled but still same error. I have dummy face – maxemilian Jan 27 '21 at 09:47
  • It's **working** now! Solved
    I checked my updates diary, but only `zoom` matches between Firefox access time successfully.
    I pretty sure this was related to GitLab login code. Suspicious dates (Jan 6- Jan 21 and Feb 3- Feb 6). I think This update done by GitLab the dates between Feb 3- Feb 6
    BTW, **thank you** for any help.
    – maxemilian Feb 06 '21 at 10:43
  • @Max What was missing in this answer? I understand Lionel's answer adds to it, but I still provided the initial references. – VonC Dec 30 '21 at 13:33
1

In my case, server time was late and I had to change the time, then restart the server and reconfigure the gitlab.

Change server time

sudo timedatectl set-time "06:24:00"
sudo timedatectl set-time "2020-04-23"
sudo hwclock --systohc

Reconfigure Gitlab.

sudo gitlab-ctl reconfigure
  • This seems to be saying the same thing as user lionel's answer. – ryanwebjackson Apr 19 '22 at 17:54
  • 1
    @ryanwebjackson This answer is suggesting you check the time on the _gitlab server_ I found this helpful; due to a power outage, our gitlab server had a date reset from 2022 to 2010. Fixing up the server date/time allowed me to log back in! Note, I didn't have issues with command-line commits; only logging into the GUI. – Serena C Sep 27 '22 at 14:52
  • I see - same root cause, different solution. (The clocks need to be in sync.) – ryanwebjackson Sep 28 '22 at 00:44
1

In my case I was trying to fetch changes using a Git command and also got this error. It turned out that I was using the wrong URL. The .git suffix was missing. Curiously it worked the first time.

so from

https://<gitlab-url>/<user>/<repo>

to

https://<gitlab-url>/<user>/<repo>.git  //<-- notice .git ending
Eliav Louski
  • 3,593
  • 2
  • 28
  • 52
Torben Kohlmeier
  • 6,713
  • 1
  • 15
  • 15
0

Empty Cache and Hard Reload on chrome will do the trick

0

For me it was the VPN. If you are connected to a VPN set to a different timezone, turn it off, clear the cookies and you should be able to connect.

Raymond
  • 47
  • 4
0

In my case, the client date/time was set wrong. Correcting the client computer time (activating ntp) did solve the issue.