samrocketman / gitlab-mirrors

A set of scripts adding the ability of managing remote mirrors to GitLab.
MIT License
818 stars 169 forks source link

gitlab3.exceptions.MissingRequiredAttribute #72

Closed ijyun closed 9 years ago

ijyun commented 9 years ago

gitmirror@DevOps-Gitlab-MirrorTool:~/mirror-management/Test/gitlab-mirrors$ ./add_mirror.sh --git --project-name showcase4 --mirror http://git.domain.com/ysdp/showcase.git Resolving gitlab remote. Traceback (most recent call last): File "lib/manage_gitlab_project.py", line 109, in 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/local/lib/python2.7/dist-packages/gitlab3-0.5.4-py2.7.egg/gitlab3/init**.py", line 184, in fn data = parent._post(api._uq_url, data=kwargs) File "/usr/local/lib/python2.7/dist-packages/gitlab3-0.5.4-py2.7.egg/gitlab3/init.py", line 418, in _post return self._request(requests.post, api_url, addl_keys, data) File "/usr/local/lib/python2.7/dist-packages/gitlab3-0.5.4-py2.7.egg/gitlab3/init.py", line 435, in _request self._check_status_code(r.status_code, url, data) File "/usr/local/lib/python2.7/dist-packages/gitlab3-0.5.4-py2.7.egg/gitlab3/init.py", line 411, in _check_status_code raise self._code_to_excstatus_code gitlab3.exceptions.MissingRequiredAttribute: URL: http://10.10.23.108//api/v3/projects, Data: {'wall_enabled': 'false', 'snippets_enabled': 'false', 'merge_requests_enabled': 'true', 'name': 'showcase4', 'issues_enabled': 'true', 'wiki_enabled': 'true', 'public': 'true', 'description': 'Mirror of http://git.domain.com/ysdp/showcase.git'} There was an unknown issue with manage_gitlab_project.py

ijyun commented 9 years ago

I have checked #27 by the version of python-gitlab3 is 0.5.4,I really don't know what is wrong in my configuration. config.sh

Environment file

#

gitlab-mirrors settings

#

The user git-mirrors will run as.

system_user="gitmirror"

The home directory path of the $system_user

user_home="/home/${system_user}"

The repository directory where gitlab-mirrors will contain copies of mirrored

repositories before pushing them to gitlab.

repo_dir="${user_home}/repositories"

colorize output of add_mirror.sh, update_mirror.sh, and git-mirrors.sh

commands.

enable_colors=true

These are additional options which should be passed to git-svn. On the command

line type "git help svn"

git_svn_additional_options="-s"

Force gitlab-mirrors to not create the gitlab remote so a remote URL must be

provided. (superceded by no_remote_set)

no_create_set=false

Force gitlab-mirrors to only allow local remotes only.

no_remote_set=false

Enable force fetching and pushing. Will overwrite references if upstream

forced pushed. Applies to git projects only.

force_update=false

This option is for pruning mirrors. If a branch is deleted upstream then that

change will propagate into your GitLab mirror. Aplies to git projects only.

prune_mirrors=false #

Gitlab settings

#

This is the Gitlab group where all project mirrors will be grouped.

gitlab_namespace="Test"

This is the base web url of your Gitlab server.

gitlab_url="http://10.10.23.108/"

Special user you created in Gitlab whose only purpose is to update mirror sites

and admin the $gitlab_namespace group.

gitlab_user="gitmirror"

Generate a token for your $gitlab_user and set it here.

gitlab_user_token_secret="$(head -n1 "${user_home}/mirror-management/Test/private_token" 2> /dev/null || echo "")"

Verify signed SSL certificates?

ssl_verify=true

Push to GitLab over http? Otherwise will push projects via SSH.

http_remote=false #

Gitlab new project default settings. If a project needs to be created by

gitlab-mirrors then it will assign the following values as defaults.

#

values must be true or false

issues_enabled=true wall_enabled=false wiki_enabled=true snippets_enabled=false merge_requests_enabled=true public=true

samrocketman commented 9 years ago

This is a duplicate issue. Please refer to #68 to track when this gets resolved. The work around is to manually move the project.