git-updater: GitLab Webhook Timeout Issues

Following the wiki at restful-endpoints-for-remote-management everything works as described (eg. curl related calls). When I push (test or not) to the Gitlab repository the webhook/integration trigger is triggered I get the above mentioned error: Hook execution failed: Net::ReadTimeout

Request URL: POST http://www.domainame.com/wp-admin/admin-ajax.php?action=github-updater-update&key=76bb2b7c819c36ee37292b6978a4ad61&theme=theme-name [internal error]
Trigger: Push Hook
Elapsed time: 3.29 sec

instead using this testing REST endpoint

Request URL: POST http://webhook.site/d6eb13a3-82a5-4385-abc6-91822f508b35 [200]
Trigger: Tag Push Hook
Elapsed time: 0.35 sec

from the GitLab documentation about webhooks, I read:

Your endpoint should send its HTTP response as fast as possible. If you wait too long, GitLab may decide the hook failed and retry it.

Surfing the net i found this other similiar issue (which makes me think that there is a timeout after 3 seconds…)

Is it possible that this is also due to wordpress performance limits? (eg. minimum response time) if so, it would be almost impossible to use this feature with the online version of GitLab…

Any way, thanks for the effort!

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 44 (43 by maintainers)

Commits related to this issue

Most upvoted comments

To test, I edited “sample_file.txt” within gitlab.com editor.


Request details

Request URL: <domain_name>?action=github-updater-update&key=<key>&theme=<name> Trigger: Push Hook Elapsed time: 3.33 sec

Net::ReadTimeout

Request Headers

Content-Type: application/json
X-Gitlab-Event: Push Hook

Request Body

{
  "object_kind": "push",
  "event_name": "push",
  "before": "12204c8e59e03c4795cb83822723244e134f048e",
  "after": "cceb9bfe782fd294e65f5b5b4d1392067d868172",
  "ref": "refs/heads/master",
  "checkout_sha": "cceb9bfe782fd294e65f5b5b4d1392067d868172",
  "message": null,
   ...
  "project_id": <id>,
  "project": {
    "id": <id>,
    "name": <name>,
    ...
    "namespace": <namespace>,
    "visibility_level": 0,
    "path_with_namespace": "<namespace>/<name>",
    "default_branch": "master",
    "ci_config_path": null,
    "homepage": "https://gitlab.com/<namespace>/<name>",
    ...
  },
  "commits": [
    {
      "id": "cceb9bfe782fd294e65f5b5b4d1392067d868172",
      "message": "Update sample_file.txt",
      "timestamp": "2018-04-07T21:23:42Z",
      "url": "https://gitlab.com/<namespace>/<name>/commit/cceb9bfe782fd294e65f5b5b4d1392067d868172",
      "author": {
       ...
      },
      "added": [
        "sample_file.txt"
      ],
      "modified": [

      ],
      "removed": [

      ]
    }
  ],
  "total_commits_count": 1,
  "repository": {
    "name": <name>,
    "url": "git@gitlab.com:<namespace>/<name>.git",
     ...
    "visibility_level": 0
  }
}

Response headers: <no info> Response body: <no info>


debug.log

[07-Apr-2018 22:23:57] {
    "messages": [
        "Downloading update from <span class=\"code\">https://gitlab.com/<namespace>/<name>/repository/archive.zip?ref=master&amp;private_token=<private_token></span>&#8230;",
        "Unpacking the update&#8230;",
        "Installing the latest version&#8230;",
        "Enabling Maintenance mode&#8230;",
        "Removing the old version of the theme&#8230;",
        "Disabling Maintenance mode&#8230;",
        "Theme updated successfully."
    ],
    "webhook": {
        "action": "github-updater-update",
        "key": <key>,
        "theme": <name>,
        "webhook_source": "GitLab webhook"
    },
    "elapsed_time": "9727.8940677643 ms",
    "success": true
}

After this, I can successfully see the updated file within wordpress.