Webhook Action call - connection Timeout #9

Closed
opened 2026-03-29 17:50:02 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @nxn-2019 on GitHub (Mar 2, 2021).

Sending webhook request to https://webhook.xxx-my-site.io/hooks/deploymentTest
(node:2719) UnhandledPromiseRejectionWarning: FetchError: request to https://webhook.nxncloud.io/hooks/deploymentTest failed, reason: connect ETIMEDOUT xx.xx.xxx.xxx:443
    at ClientRequest.<anonymous> (/home/runner/work/_actions/joelwmale/webhook-action/master/node_modules/node-fetch/lib/index.js:1461:11)
    at ClientRequest.emit (events.js:210:5)
    at TLSSocket.socketErrorListener (_http_client.js:406:9)
    at TLSSocket.emit (events.js:210:5)
    at emitErrorNT (internal/streams/destroy.js:92:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
(node:2719) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:2719) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

GitHub Action

name: deployment Test

on:
  push:
    branches:
      - 'test_branch'

jobs:
  test:
    name: Test - Unit & Integration
    runs-on: ubuntu-18.04
    
    strategy:
      matrix:
        node-version: [14.6.0]
    
    steps:

      - name: Checkout repository
        uses: actions/checkout@v2
      - name: Use Node.js 14.6.0
        uses: actions/setup-node@v1
        with: 
          node-version: 14.6.0
      - name: Config dependencies
        run: npm config set unsafe-perm true
      - name: Install dependencies
        run: npm install
      - name: Test
        run: npm test -- --coverage
      - name: Build
        run: npm run build
  docker:
    name: Publish - Docker Hub
    runs-on: ubuntu-18.04
    needs: [test]
    env:
      REPO: ${{ secrets.DOCKER_REPO }}
    steps:
      - uses: actions/checkout@v2
      - name: Login to Docker Hub
        run: echo "${{ secrets.DOCKER_PASS }}" | docker login --username ${{ secrets.DOCKER_USER }} --password-stdin
      - name: Build Docker image
        run: docker build -t $REPO:latest  .
      - name: Publish Docker image
        run: docker push $REPO

  redeploy:
    name: Redeploy webhook call
    runs-on: ubuntu-18.04
    needs: [docker]
    steps:
      - name: Deploy docker container webhook
        uses: joelwmale/webhook-action@master
        env:
          WEBHOOK_URL: https://webhook.xxx.io/hooks/deploymentTest

Webhook Url will call hooks.json
[ { "id": "deploymentTest", "execute-command": "/usr/share/nginx/html/deploymentTest/redeploy.sh", "command-working-directory": "/usr/share/nginx/html/webhooks", "response-message": "Redeploying deploymentTest." } ]

redeploy.sh
will pull and run the docker

Issue:
When we are triggering the webhook URL in browser or postman it is working fine. But inside github action throws the above error mentioned

Note: I have not added this URL in GitHub webhook settings.

Originally created by @nxn-2019 on GitHub (Mar 2, 2021). ``` Sending webhook request to https://webhook.xxx-my-site.io/hooks/deploymentTest (node:2719) UnhandledPromiseRejectionWarning: FetchError: request to https://webhook.nxncloud.io/hooks/deploymentTest failed, reason: connect ETIMEDOUT xx.xx.xxx.xxx:443 at ClientRequest.<anonymous> (/home/runner/work/_actions/joelwmale/webhook-action/master/node_modules/node-fetch/lib/index.js:1461:11) at ClientRequest.emit (events.js:210:5) at TLSSocket.socketErrorListener (_http_client.js:406:9) at TLSSocket.emit (events.js:210:5) at emitErrorNT (internal/streams/destroy.js:92:8) at emitErrorAndCloseNT (internal/streams/destroy.js:60:3) at processTicksAndRejections (internal/process/task_queues.js:80:21) (node:2719) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:2719) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. ``` **GitHub Action** ``` name: deployment Test on: push: branches: - 'test_branch' jobs: test: name: Test - Unit & Integration runs-on: ubuntu-18.04 strategy: matrix: node-version: [14.6.0] steps: - name: Checkout repository uses: actions/checkout@v2 - name: Use Node.js 14.6.0 uses: actions/setup-node@v1 with: node-version: 14.6.0 - name: Config dependencies run: npm config set unsafe-perm true - name: Install dependencies run: npm install - name: Test run: npm test -- --coverage - name: Build run: npm run build docker: name: Publish - Docker Hub runs-on: ubuntu-18.04 needs: [test] env: REPO: ${{ secrets.DOCKER_REPO }} steps: - uses: actions/checkout@v2 - name: Login to Docker Hub run: echo "${{ secrets.DOCKER_PASS }}" | docker login --username ${{ secrets.DOCKER_USER }} --password-stdin - name: Build Docker image run: docker build -t $REPO:latest . - name: Publish Docker image run: docker push $REPO redeploy: name: Redeploy webhook call runs-on: ubuntu-18.04 needs: [docker] steps: - name: Deploy docker container webhook uses: joelwmale/webhook-action@master env: WEBHOOK_URL: https://webhook.xxx.io/hooks/deploymentTest ``` **Webhook Url will call hooks.json** `[ { "id": "deploymentTest", "execute-command": "/usr/share/nginx/html/deploymentTest/redeploy.sh", "command-working-directory": "/usr/share/nginx/html/webhooks", "response-message": "Redeploying deploymentTest." } ]` **redeploy.sh** will pull and run the docker **Issue:** When we are triggering the webhook URL in browser or postman it is working fine. But inside github action throws the above error mentioned Note: I have not added this URL in GitHub webhook settings.
Author
Owner

@joelwmale commented on GitHub (Mar 9, 2021):

@nxn-2019 Is it an AWS server? Firewall? Security groups? Are you accounting for githubs random IP when hitting your server? Is it behind a proxy?

This definitely isn't anything to do with the package - at best I could just handle the issue better so will look into it.

@joelwmale commented on GitHub (Mar 9, 2021): @nxn-2019 Is it an AWS server? Firewall? Security groups? Are you accounting for githubs random IP when hitting your server? Is it behind a proxy? This definitely isn't anything to do with the package - at best I could just handle the issue better so will look into it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/webhook-action#9