Gitlab account acces error: "422 The change you requested was rejected."

Gitlab account acces error: "422 The change you requested was rejected."

这个问题asked by coderss但是重启电脑好像没有效果

422 您请求的更改已被拒绝。 确保您有权访问您尝试更改的内容。 如果您认为这是一个错误,请联系您的 GitLab 管理员。

我在 Linux 下的 Firefox 中出现上述错误,但我可以在 Chromium 中访问。 这看起来像是典型的 cookie 问题。

我尝试清除所有与 Gitlab 相关的 cookie,然后在没有任何新登录尝试的情况下重新启动计算机。并重新启动计算机 :) 是的,我只是尝试

但还是一样的错误,同样的浏览器。

我该如何处理这个问题?

此错误也发生在忘记密码部分和 Firefox 的私人选项卡中。

是否还有其他与 Gitlab 相关的 cookie?

紧随其后的是 issue 35447 and issue 40898

最后一个包括:

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.

并且:

JuKu JuKu @JuKu · 1 year ago

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

这样可以避免可怕的情况:

但这取决于使用的 GitLab 类型(gitlab.com 或本地 GitLab,以及使用的 Web 服务器类型)

例如,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.


它现在在 Manjaro 上与 Firefox 一起工作的OP maxemilian reports in

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.

这个问题不仅应该通过描述的 cookie 来解决,还应该通过时间系统的更正来解决。 我遇到了完全相同的问题:无法连接 Firefox,即使重置了 cookie,但我能够连接 Chrome。 (这听起来很奇怪,因为我的时钟系统甚至在 Chrome 上也是错误的。)

解决方案附带了非常简短的解释:

"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

在我的情况下,服务器时间晚了,我不得不更改时间,然后重新启动服务器并重新配置 gitlab。

更改服务器时间

sudo hwclock --set --Date "2015-01-12 15:00:00"

重新配置 Gitlab。

sudo gitlab-ctl reconfigure

chrome 上的清空缓存和硬重新加载可以解决问题