cloudflare / pages-action

MIT License
440 stars 91 forks source link

RequestError [HttpError]: invalid json response body #96

Closed ed3ath closed 1 year ago

ed3ath commented 1 year ago

2 days ago, my workflow is working fine. today, I'm experiencing this error.


        throw new requestError.RequestError(error.message, 500, {
              ^

RequestError [HttpError]: invalid json response body at https://api.github.com/repos/[reducted]/[reducted]/deployments/964768590/statuses reason: Unexpected end of JSON input
    at /home/runner/work/_actions/cloudflare/pages-action/v1/index.js:5879:15
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async createGitHubDeploymentStatus (/home/runner/work/_actions/cloudflare/pages-action/v1/index.js:***132:5)
    at async /home/runner/work/_actions/cloudflare/pages-action/v1/index.js:***187:7 {
  status: 500,
  request: {
    method: 'POST',
    url: 'https://api.github.com/repos/[reducted]/[reducted]/deployments/964768590/statuses',
    headers: {
      accept: 'application/vnd.github.v3+json',
      'user-agent': 'octokit-core.js/3.6.0 Node.js/16.16.0 (linux; x64)',
      authorization: 'token [REDACTED]',
      'content-type': 'application/json; charset=utf-8'
    },
    body: '{"environment":"[reducted]-cms2 (Production)","environment_url":"https://4836f9fb.[reducted]-cms2.pages.dev","production_environment":true,"log_url":"https://dash.cloudflare.com/***/pages/view/[reducted]-cms2/4836f9fb-33af-4b65-87bc-a6[23](https://github.com/[reducted]/[reducted]/actions/runs/5408250101/jobs/9827123761#step:9:24)d9f90f0d","description":"Cloudflare Pages","state":"success","auto_inactive":false}',
    request: {
      agent: Agent {
        _events: [Object: null prototype] {
          free: [Function (anonymous)],
          newListener: [Function: maybeEnableKeylog]
        },
        _eventsCount: 2,
        _maxListeners: undefined,
        defaultPort: 443,
        protocol: 'https:',
        options: [Object: null prototype] { path: null },
        requests: [Object: null prototype] {},
        sockets: [Object: null prototype] {
          'api.github.com:443:::::::::::::::::::::': [ [TLSSocket] ]
        },
        freeSockets: [Object: null prototype] {},
        keepAliveMsecs: 1000,
        keepAlive: false,
        maxSockets: Infinity,
        maxFreeSockets: [25](https://github.com/[reducted]/[reducted]/actions/runs/5408250101/jobs/9827123761#step:9:26)6,
        scheduling: 'lifo',
        maxTotalSockets: Infinity,
        totalSocketCount: 1,
        maxCachedSessions: 100,
        _sessionCache: {
          map: {
            'api.github.com:4[43](https://github.com/[reducted]/[reducted]/actions/runs/5408250101/jobs/9827123761#step:9:44):::::::::::::::::::::': [Buffer [Uint8Array]]
          },
          list: [ 'api.github.com:[44](https://github.com/[reducted]/[reducted]/actions/runs/5408250101/jobs/9827123761#step:9:45)3:::::::::::::::::::::' ]
        },
        [Symbol(kCapture)]: false
      },
      hook: [Function: bound bound register]
    }
  }
}```
amanasterdio commented 1 year ago

Getting the same issue from my end.

/home/runner/work/_actions/cloudflare/pages-action/v1/index.js:5879
        throw new requestError.RequestError(error.message, 500, {
              ^

RequestError [HttpError]: invalid json response body at https://api.github.com/repos/asterdio/AgrobaseAPI_dash/deployments/964768218/statuses reason: Unexpected end of JSON input
    at /home/runner/work/_actions/cloudflare/pages-action/v1/index.js:5879:15
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async createGitHubDeploymentStatus (/home/runner/work/_actions/cloudflare/pages-action/v1/index.js:22132:5)
    at async /home/runner/work/_actions/cloudflare/pages-action/v1/index.js:22187:7 {
  status: 500,
  request: {
    method: 'POST',
    url: 'https://api.github.com/repos/asterdio/AgrobaseAPI_dash/deployments/964768218/statuses',
    headers: {
      accept: 'application/vnd.github.v3+json',
      'user-agent': 'octokit-core.js/3.6.0 Node.js/16.16.0 (linux; x64)',
      authorization: 'token [REDACTED]',
      'content-type': 'application/json; charset=utf-8'
    },
    body: '{"environment":"agrobaseapi-dash (Production)","environment_url":"https://fb45a970.agrobaseapi-dash.pages.dev","production_environment":true,"log_url":"https://dash.cloudflare.com/61eeb0010bc8560a5d28ea1e81a073e5/pages/view/agrobaseapi-dash/fb45a970-f7ed-4e6a-9e97-ce2f589fd8ad","description":"Cloudflare Pages","state":"success","auto_inactive":false}',
    request: {
      agent: Agent {
        _events: [Object: null prototype] {
          free: [Function (anonymous)],
          newListener: [Function: maybeEnableKeylog]
        },
        _eventsCount: 2,
        _maxListeners: undefined,
        defaultPort: 4[43](https://github.com/asterdio/AgrobaseAPI_dash/actions/runs/5408157608/jobs/9827084229#step:10:44),
        protocol: 'https:',
        options: [Object: null prototype] { path: null },
        requests: [Object: null prototype] {},
        sockets: [Object: null prototype] {
          'api.github.com:[44](https://github.com/asterdio/AgrobaseAPI_dash/actions/runs/5408157608/jobs/9827084229#step:10:45)3:::::::::::::::::::::': [ [TLSSocket] ]
        },
        freeSockets: [Object: null prototype] {},
        keepAliveMsecs: 1000,
        keepAlive: false,
        maxSockets: Infinity,
        maxFreeSockets: 2[56](https://github.com/asterdio/AgrobaseAPI_dash/actions/runs/5408157608/jobs/9827084229#step:10:57),
        scheduling: 'lifo',
        maxTotalSockets: Infinity,
        totalSocketCount: 1,
        maxCachedSessions: 100,
        _sessionCache: {
          map: {
            'api.github.com:443:::::::::::::::::::::': [Buffer [Uint8Array]]
          },
          list: [ 'api.github.com:443:::::::::::::::::::::' ]
        },
        [Symbol(kCapture)]: false
      },
      hook: [Function: bound bound register]
    }
  }
davidcollom commented 1 year ago

This feels and looks like an issue on Githubs end, I've seen that my static pages have actually been updated, and that the action failed whilst greating the the github deployment.

Confirming this with the exception stacktrace of:

at async createGitHubDeploymentStatus (/home/runner/work/_actions/cloudflare/pages-action/v1/index.js:22132:5)
amanasterdio commented 1 year ago

Yes seems like it so. But checking it again and seems like its stable now. The status is seen succeed on GitHub's end too. I think we can close this issue now.

WalshyDev commented 1 year ago

GitHub was having an incident last night - https://www.githubstatus.com/incidents/ws2l6203cs7g

All good now so closing :)