Skip to content

Using accept merge request api response 404 Not Found

Summary

I am trying to make a merge request and accept the merge request through rest api. I can make the merge request and get it successfully, but when I try to accept it, I recieved 404 response. But when I check the merge request on the website, I can see it and I have the permission to accept it through pushing the button.

Steps to reproduce

  1. Make a merge request through rest api.(POST /projects/:id/merge_requests)
  2. Get the first open merge request and iid. (GET /projects/:id/merge_requests?state=opened)
  3. Accept it through api, but recieved 404. (PUT /projects/:id/merge_requests/:merge_request_iid/merge)

What is the current bug behavior?

The merge request is existed but can not be accpeted.

What is the expected correct behavior?

Accept the merge request successfully.

Relevant logs and/or screenshots

{header:
      { server: 'nginx',
        date: 'Tue, 02 May 2017 02:37:55 GMT',
        'content-type': 'application/json',
        'content-length': '27',
        connection: 'close',
        'cache-control': 'no-cache',
        vary: 'Origin',
        'x-request-id': 'acbed2d6-666e-47cc-b749-09de8ecb708f',
        'x-runtime': '0.025052' },
     statusCode: 404,
     status: 404,
     statusType: 4,
     info: false,
     ok: false,
     redirect: false,
     clientError: true,
     serverError: false,
     error:
      { Error: cannot PUT /api/v3/projects/venustech%2Fbigdata-schedule-backend/merge_requests/287/merge (404)
          at Response.toError (/home/developer/workspace/venustech/tool/gitlab-branch-creator/node_modules/superagent/lib/node/response.js:94:13)
          at ResponseBase._setStatusProperties (/home/developer/workspace/venustech/tool/gitlab-branch-creator/node_modules/superagent/lib/response-base.js:122:16)
          at new Response (/home/developer/workspace/venustech/tool/gitlab-branch-creator/node_modules/superagent/lib/node/response.js:40:8)
          at Request._emitResponse (/home/developer/workspace/venustech/tool/gitlab-branch-creator/node_modules/superagent/lib/node/index.js:737:20)
          at /home/developer/workspace/venustech/tool/gitlab-branch-creator/node_modules/superagent/lib/node/index.js:881:38
          at IncomingMessage.<anonymous> (/home/developer/workspace/venustech/tool/gitlab-branch-creator/node_modules/superagent/lib/node/parsers/json.js:16:7)
          at emitNone (events.js:91:20)
          at IncomingMessage.emit (events.js:185:7)
          at endReadableNT (_stream_readable.js:974:12)
          at _combinedTickCallback (internal/process/next_tick.js:74:11)
        status: 404,
        text: '{"message":"404 Not found"}',
        method: 'PUT',
        path: '/api/v3/projects/venustech%2Fbigdata-schedule-backend/merge_requests/287/merge' }

Merge request

Output of checks

Happens on private gitlab started by docker.

Results of GitLab environment info

System information System: Ubuntu 14.04 Current User: git Using RVM: no Ruby Version: 2.3.3p222 Gem Version: 2.5.2 Bundler Version:1.14.3 Rake Version: 10.5.0 Sidekiq Version:4.2.7

GitLab information Version: 8.16.4 Revision: f32ee82 Directory: /home/git/gitlab DB Adapter: postgresql URL: http://gitlab.venus-bdlab.com HTTP Clone URL: http://gitlab.venus-bdlab.com/some-group/some-project.git SSH Clone URL: ssh://git@gitlab.venus-bdlab.com:10022/some-group/some-project.git Using LDAP: no Using Omniauth: no

GitLab Shell Version: 4.1.1 Repository storage paths:

  • default: /home/git/data/repositories/ Hooks: /home/git/gitlab-shell/hooks/ Git: /usr/bin/git

Results of GitLab application Check

Checking GitLab Shell ...

GitLab Shell version >= 4.1.1 ? ... OK (4.1.1) Repo base directory exists? default... yes Repo storage directories are symlinks? default... no Repo paths owned by git:git? default... yes Repo paths access is drwxrws---? default... yes hooks directories in repos are links: ... 3/43 ... ok 3/44 ... ok 3/45 ... ok 3/47 ... ok 3/48 ... ok 3/52 ... ok 3/54 ... ok 3/57 ... ok 3/61 ... ok 3/66 ... ok 3/67 ... ok 46/68 ... ok 3/73 ... ok 3/75 ... ok 3/76 ... ok 3/79 ... ok 41/80 ... ok 3/82 ... ok 3/83 ... ok 51/84 ... repository is empty 3/87 ... ok 46/89 ... ok 39/90 ... ok 53/91 ... ok 3/92 ... ok 53/93 ... repository is empty 3/94 ... ok 53/95 ... ok 53/98 ... ok 53/99 ... ok 53/101 ... ok 3/103 ... ok 53/104 ... ok 53/107 ... ok 54/109 ... ok 3/110 ... ok 3/111 ... ok 58/113 ... repository is empty 3/114 ... ok 3/115 ... ok 3/116 ... ok 3/117 ... ok 3/118 ... ok 53/119 ... ok 53/120 ... ok 53/122 ... ok 79/123 ... ok 3/124 ... ok 54/125 ... ok 53/126 ... ok 3/128 ... ok 3/129 ... ok 39/130 ... ok 39/131 ... ok 3/132 ... ok 39/133 ... ok 68/134 ... ok 68/135 ... ok 68/136 ... ok 68/137 ... ok 68/138 ... ok 68/139 ... ok 68/140 ... ok 68/143 ... ok 68/144 ... ok 68/146 ... ok 71/148 ... ok 71/150 ... ok 53/151 ... ok 72/152 ... ok 72/153 ... ok 3/156 ... repository is empty 57/158 ... ok 53/159 ... ok 53/160 ... ok 53/161 ... ok 53/162 ... ok 53/163 ... ok 76/164 ... ok 76/165 ... ok 53/166 ... ok 72/167 ... ok 53/168 ... ok 77/169 ... ok 77/170 ... ok 53/171 ... ok 53/172 ... ok 72/173 ... ok 53/174 ... ok 72/175 ... ok 72/176 ... ok 53/177 ... ok 53/178 ... ok 3/179 ... ok 53/180 ... ok 53/182 ... ok 79/183 ... ok 79/184 ... ok 79/185 ... ok 79/186 ... ok 79/187 ... ok 53/188 ... ok 79/189 ... ok 53/190 ... ok 79/191 ... ok 79/192 ... ok 53/193 ... ok 53/194 ... ok 53/195 ... ok 79/196 ... ok 79/197 ... ok 53/198 ... ok 79/201 ... repository is empty 79/202 ... ok 79/203 ... ok 4/204 ... repository is empty 53/205 ... ok 53/206 ... ok 53/207 ... ok 53/208 ... ok 53/209 ... ok 53/210 ... ok 53/211 ... ok 79/212 ... ok Running /home/git/gitlab-shell/bin/check Check GitLab API access: OK Access to /home/git/.ssh/authorized_keys: OK Send ping to redis server: OK gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... yes Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking Reply by email ...

Reply by email is disabled in config/gitlab.yml

Checking Reply by email ... Finished

Checking LDAP ...

LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab ...

Git configured with autocrlf=input? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config outdated? ... no Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory setup correctly? ... no Try fixing it: sudo chown -R git /home/git/data/uploads sudo find /home/git/data/uploads -type f -exec chmod 0644 {} ; sudo find /home/git/data/uploads -type d -not -path /home/git/data/uploads -exec chmod 0700 {} ; For more information see: doc/install/installation.md in section "GitLab" Please fix the error above and rerun the checks. Init script exists? ... yes Init script up-to-date? ... yes projects have namespace: ... 3/43 ... yes 3/44 ... yes 3/45 ... yes 3/47 ... yes 3/48 ... yes 3/52 ... yes 3/54 ... yes 3/57 ... yes 3/61 ... yes 3/66 ... yes 3/67 ... yes 46/68 ... yes 3/73 ... yes 3/75 ... yes 3/76 ... yes 3/79 ... yes 41/80 ... yes 3/82 ... yes 3/83 ... yes 51/84 ... yes 3/87 ... yes 46/89 ... yes 39/90 ... yes 53/91 ... yes 3/92 ... yes 53/93 ... yes 3/94 ... yes 53/95 ... yes 53/98 ... yes 53/99 ... yes 53/101 ... yes 3/103 ... yes 53/104 ... yes 53/107 ... yes 54/109 ... yes 3/110 ... yes 3/111 ... yes 58/113 ... yes 3/114 ... yes 3/115 ... yes 3/116 ... yes 3/117 ... yes 3/118 ... yes 53/119 ... yes 53/120 ... yes 53/122 ... yes 79/123 ... yes 3/124 ... yes 54/125 ... yes 53/126 ... yes 3/128 ... yes 3/129 ... yes 39/130 ... yes 39/131 ... yes 3/132 ... yes 39/133 ... yes 68/134 ... yes 68/135 ... yes 68/136 ... yes 68/137 ... yes 68/138 ... yes 68/139 ... yes 68/140 ... yes 68/143 ... yes 68/144 ... yes 68/146 ... yes 71/148 ... yes 71/150 ... yes 53/151 ... yes 72/152 ... yes 72/153 ... yes 3/156 ... yes 57/158 ... yes 53/159 ... yes 53/160 ... yes 53/161 ... yes 53/162 ... yes 53/163 ... yes 76/164 ... yes 76/165 ... yes 53/166 ... yes 72/167 ... yes 53/168 ... yes 77/169 ... yes 77/170 ... yes 53/171 ... yes 53/172 ... yes 72/173 ... yes 53/174 ... yes 72/175 ... yes 72/176 ... yes 53/177 ... yes 53/178 ... yes 3/179 ... yes 53/180 ... yes 53/182 ... yes 79/183 ... yes 79/184 ... yes 79/185 ... yes 79/186 ... yes 79/187 ... yes 53/188 ... yes 79/189 ... yes 53/190 ... yes 79/191 ... yes 79/192 ... yes 53/193 ... yes 53/194 ... yes 53/195 ... yes 79/196 ... yes 79/197 ... yes 53/198 ... yes 79/201 ... yes 79/202 ... yes 79/203 ... yes 4/204 ... yes 53/205 ... yes 53/206 ... yes 53/207 ... yes 53/208 ... yes 53/209 ... yes 53/210 ... yes 53/211 ... yes 79/212 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.1.0 ? ... yes (2.3.3) Your git bin path is "/usr/bin/git" Git version >= 2.7.3 ? ... yes (2.11.0) Active users: 18

Checking GitLab ... Finished