Skip to content

TypeError (Project 'project_name' ('project_name') has no repository) #38

Closed
@Sergey1000

Description

@Sergey1000

Hello. I'm try to use your awesome plugin. But I got some problem during the configuring. Here is my situation:

1. Software version (the first one - in Redmine, the seconf - in Gitlab):

Redmine version: 3.4.3.stable
Ruby version: 2.3.1-p112 (2016-04-26) [x86_64-linux-gnu]
Rails version: 4.2.8
Git: 2.7.4
redmine_gitlab_hook: 0.2.0

GitLab: 10.4.4
Ruby: 2.3.6p384
Rails: 4.2.10
Git: 2.14.3

2. Preconfiguration for Redmine:

Enable REST web service - check
Enable WS for repository management - check
Repository management WS API key - FITBJ4rk5j7jIcPQWefx

3. Projects and repositories (the first one - in Redmine, the seconf - in Gitlab):

Project name:
test_project
Repository id (linked to the test_project):
test_repo_mirror
Repository in filesystem:
/var/www/redmine/files/repos/mirror/test_repo_in_gitlab.git
How does the repository was cloning to the filesystem:
git clone --mirror [email protected]:Lastname/test_repo_in_gitlab.git

Gitlab project name:
http://gitlab.lan/Lastname/test_project_in_gitlab
Gitlab repository:
[email protected]:Lastname/test_repo_in_gitlab.git
Webhook (push events):
http://redmine.lan/gitlab_hook?project_id=test_project&key=FITBJ4rk5j7jIcPQWefx

4. What have I done:

  • launch Gitlab's webhook (click "Test -> Push events"). The output is: "Hook executed successfully but returned HTTP 500";
  • send POST request in Advanced REST Client.
    In both cases redmine/log/production.log contains the next (the only difference between Gitlab and ARC in logs - more details for the first one regards to this URL https://docs.gitlab.com/ce/user/project/integrations/webhooks.html in "Push" section):
Started POST "/gitlab_hook?project_id=test_project&key=FITBJ4rk5j7jIcPQWefx" for 192.168.0.50 at 2018-02-22 17:37:25 +0200
Processing by GitlabHookController#index as HTML
  Parameters: {"project_id"=>"test_project", "key"=>"FITBJ4rk5j7jIcPQWefx"}
Completed 500 Internal Server Error in 6ms (ActiveRecord: 1.7ms)

TypeError (Project 'test_project' ('test_project') has no repository):
  plugins/redmine_gitlab_hook/app/controllers/gitlab_hook_controller.rb:131:in `find_repository'
  plugins/redmine_gitlab_hook/app/controllers/gitlab_hook_controller.rb:11:in `index'

The same problem occured when I use ANY key too. Looks like it fails before the authorization;

  • tried to check different checkboxes in redmine_gitlab_hook. No luck.

But when I launch the next command, I can see, that repository is linked to the project:
$ curl -v -u afb7a0addad5b0cf33449512a99879ff2cf40c9d:x "http://redmine.lan/sys/projects.xml?key=FITBJ4rk5j7jIcPQWefx"
[{"id":2,"name":"test_project","is_public":true,"identifier":"test_project","status":1,"repository":{"id":11,"url":"/var/www/redmine/files/repos/mirror/test_repo_in_gitlab.git"}}]

I can't figure out, what's wrong in my situation. Could you, please, help with this? Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions