-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error transferring project #66
Comments
Sounds like you didn't make the GitLab user |
just getting back to this. gitlab-mirrors: 0.5.0 |
What does your gitlab logs say about this? Is your See Using your own user; it details what happens when you attempt to use a user that is not an Administrator. |
I, [2015-02-02T16:40:09.608846 #1745] INFO -- : Adding mirror https://github.com/biemond/biemond-orawls.git
I, [2015-02-02T16:40:09.609007 #1745] INFO -- : /home/gitmirror/gitlab-mirrors/add_mirror.sh --git --project-name biemond-orawls --mirror https://github.com/biemond/biemond-orawls.git 2>&1
E, [2015-02-02T16:40:09.609048 #1745] ERROR -- : Resolving gitlab remote.
Traceback (most recent call last):
File "lib/manage_gitlab_project.py", line 109, in <module>
found_project=createproject(project_name)
File "lib/manage_gitlab_project.py", line 95, in createproject
new_project=git.add_project(pname,description=description,**project_options)
File "/usr/lib/python2.6/site-packages/gitlab3/__init__.py", line 184, in fn
data = parent._post(api._uq_url, data=kwargs)
File "/usr/lib/python2.6/site-packages/gitlab3/__init__.py", line 418, in _post
return self._request(requests.post, api_url, addl_keys, data)
File "/usr/lib/python2.6/site-packages/gitlab3/__init__.py", line 435, in _request
self._check_status_code(r.status_code, url, data)
File "/usr/lib/python2.6/site-packages/gitlab3/__init__.py", line 411, in _check_status_code
raise self._code_to_exc[status_code](msg)
gitlab3.exceptions.ResourceNotFound: URL: http://git.corp.ositax.com/api/v3/projects, Data: {'wall_enabled': 'false', 'snippets_enabled': 'false', 'merge_requests_enabled': 'false', 'name': 'biemond-orawls', 'issues_enabled': 'false', 'wiki_enabled': 'false', 'public': 'true', 'description': 'Mirror of https://github.com/biemond/biemond-orawls.git'} The user does have full admin access. |
I think what needs to happen is in the lib/manage_gitlab_project.py script you need to check to see if a local project exists first. If it does exist that it needs to be transferred to the destination group. The manual fix for this is to transfer the gitmirror's project to the destination group. |
That's not a bad idea. There might be a way to obtain from the GitLab API whether or not the user is an admin as well. It would be good to give a helpful message and gracefully exit for that as well. |
I'll label this as an enhancement because it's possible for the |
The latest API supports looking up if a single user is an admin. The logic of that would be something along the lines of: #variable x is a returned user entry from the GitLab api (a python dictionary)
if (not 'is_admin' in x) or ('is_admin' in x and (not x['is_admin'])):
print "The gitmirrors user is not an admin" From there we could do additional checking. If |
Actually, that non-sense logic is no longer required. In old versions of GitLab, you could only create projects under your own user. However, in the latest GitLab API documentation you can pass in the parameter Doesn't look like python-gitlab3 supports the latest API interfaces for GitLab. A feature request will need to be opened with the upstream library. Either that or adopt a new library that is maintained. |
In summary the resolution for this is: adopt the new GitLab API and use the |
or just dump the python/bash script and create a wrapper around this: |
Yeah, before that I'd have to figure out how to do ruby things like a gem. We could just categorize this with the rewrite. ref link #63. |
Really love the work here. Any chance there is any updates on either the transferring project error or ruby rewrite? |
No updates at the moment in either space. But I think I can slice some time to work on getting it to work with the latest version of GitLab. Currently the library used to talk with GitLab has largely been abandoned. Just need to change the library to pyapi-gitlab which is currently maintained to the latest version of GitLab last I checked. |
That sounds awesome, and that should also make future maintenance more efficient. Smart approach! |
Ok, trying to resolve this again with a newer version of gitlab. I have rewritten some code but there still seems to be an issue with gitlab and transferring projects. I then stumbled upon https://gitlab.com/gitlab-org/gitlab-ce/issues/1522. Seems to me that once this issue is fixed, the transfer project work. |
* this attempts to fix the issue however the problem is now a gitlab api issue https://gitlab.com/gitlab-org/gitlab-ce/issues/1522
* this attempts to fix the issue however the problem is now a gitlab api issue https://gitlab.com/gitlab-org/gitlab-ce/issues/1522 * fixes the creation of the project in the correct namespace thus doesn't need to transfer the project
* this attempts to fix the issue however the problem is now a gitlab api issue https://gitlab.com/gitlab-org/gitlab-ce/issues/1522 * fixes the creation of the project in the correct namespace thus doesn't need to transfer the project
* this attempts to fix the issue however the problem is now a gitlab api issue https://gitlab.com/gitlab-org/gitlab-ce/issues/1522 * fixes the creation of the project in the correct namespace thus doesn't need to transfer the project
* this attempts to fix the issue however the problem is now a gitlab api issue https://gitlab.com/gitlab-org/gitlab-ce/issues/1522 * fixes the creation of the project in the correct namespace thus doesn't need to transfer the project
fixes #66 - error transferring project
https://gitlab.com/gitlab-org/gitlab-ce/issues/1522 Looks like this was just fixed in 7.13 release. |
I am not sure why this is happening. But when I add new projects, gitlab-mirrors clone the remote repo and create a project in the gitmirror users namespace in gitlab but fails to transfer the project and push the mirrored code. Any ideas how to fix this?
The text was updated successfully, but these errors were encountered: