简体   繁体   English

GitLab:将项目转移到组显示403禁止错误

[英]GitLab: Transferring project to Group shows 403 Forbidden error

$ curl -k -X --request POST -H "Private-Token:Gybr7vzbGHuKDv9PM62z" https://gitlab_host/api/v3/groups/2257/projects/2884 $ curl -k -X --request POST -H "Private-Token:Gybr7vzbGHuKDv9PM62z" https://gitlab_host/api/v3/groups/2257/projects/2884

{"message":"403 Forbidden"} {“消息”:“403 禁止”}

I get the above error.我收到上述错误。 The private token I am using is of my userid and I own both the group (groupid=2257) and the project(projectid=2884).我使用的私有令牌是我的用户 ID,我同时拥有组 (groupid=2257) 和项目 (projectid=2884)。 I can also transfer the project from the GUI.我还可以从 GUI 传输项目。 The above problem is only with the API.上述问题仅适用于 API。 What might be the problem?可能是什么问题?

Looks like only the gitlab administrator is allowed to move a project to a group using the API (see here ). 看起来只允许gitlab管理员使用API​​将项目移至组(请参阅此处 )。

Transfer a project to the Group namespace. 将项目传输到组名称空间。 Available only for admin 仅适用于管理员

I found a solution here - to create the project by specifying the namespace_id (groupid). 我在这里找到了解决方案-通过指定namespace_id(groupid)创建项目。 It seems to be adding into the group. 它似乎正在加入该组。

curl -k -X POST -H "Private-Token: XXXXXXXXXXX" " https://gitlab_host/api/v3/projects?name=Team9&namespace_id=2257 " curl -k -X POST -H“私人令牌:XXXXXXXXXXX”“ https:// gitlab_host / api / v3 / projects?name = Team9&namespace_id = 2257

where 2257 is the groupid. 其中2257是groupid。

See GitLab 15.4 (September 2022) can help with:请参阅GitLab 15.4 (2022 年 9 月)可以帮助:

API endpoint to get group transfer locations API 端点获取组转移位置

We added a new Groups API endpoint that returns a list of groups to which you can transfer the current group.我们添加了一个新的 Groups API 端点,该端点返回您可以将当前组转移到的组列表。

See Documentation and Issue .请参阅文档问题

That way, you can list first the groups to which you can transfer the current group of your current project.这样,您可以首先列出您可以将当前项目的当前组传输到的组。
Meaning you will transfer your project to a group you know you can transfer to (no 403)这意味着您会将您的项目转移到您知道可以转移到的组(没有 403)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Gitlab v4 api 403 project.variables.list 禁止错误(get_all=True) - Gitlab v4 api 403 forbidden error for project.variables.list(get_all=True) 错误 403:需要权限 iam.serviceAccounts.create 才能对项目 projects/ 执行此操作,禁止 - Error 403: Permission iam.serviceAccounts.create is required to perform this operation on project projects/, forbidden 403 文件上传时收到禁止的错误 - 403 Forbidden error is received on file upload 打开我的 Cloud Run 服务的 URL 时出现 403“错误:禁止” - 403 "Error: Forbidden" when opening the URL of my Cloud Run service 尝试创建子用户时 sendgrid 错误“403 访问被禁止” - sendgrid error "403 access forbidden" when trying to create sub user AWS EMR jupyter 错误 403 Forbidden (Workspace is not attached to cluster) - AWS EMR jupyter error 403 Forbidden (Workspace is not attached to cluster) 403 禁止错误:运行 API 请求命令时 - 403 Forbidden Error: While running the API request command 与 Firebase 安装服务器通信时出错 API - 403 Forbidden - Error when communicating with the Firebase Installations server API - 403 Forbidden 无法使用 HTTP 在本地测试 Sendgrid 错误 403:禁止 - Unable to test Sendgrid locally with HTTP Error 403: Forbidden 通过 python 访问 API 得到一个奇怪的错误 403 禁止 - Getting a strange error 403 forbidden for accessing an API through python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM