Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Unexpected end of JSON input #649

Closed
1 task done
tsusdere opened this issue Oct 27, 2023 · 2 comments · Fixed by #648
Closed
1 task done

[BUG]: Unexpected end of JSON input #649

tsusdere opened this issue Oct 27, 2023 · 2 comments · Fixed by #648
Labels
released Type: Bug Something isn't working as documented

Comments

@tsusdere
Copy link
Contributor

tsusdere commented Oct 27, 2023

What happened?

Getting an empty response data results in HttpError: invalid json response body when attempting to convert the response to json:

if (/application\/json/.test(contentType!)) {
return response.json();
}

Versions

Octokit v8.1.4

Relevant log output


### What happened?

Getting an empty response data results in `HttpError: invalid json response body` when attempting to convert the response to json:

https://github.com/octokit/request.js/blob/5c1fcdfa07f087bffe86bff3c84c9855b744de5b/src/fetch-wrapper.ts#L155-L157

### Versions

Octokit v8.1.4

### Relevant log output

##[debug]Evaluating condition for step: 'Deploy to GitHub Pages'
2##[debug]Evaluating: success()
3##[debug]Evaluating success:
4##[debug]=> true
5##[debug]Result: true
6##[debug]Starting: Deploy to GitHub Pages
7##[debug]Loading inputs
8##[debug]Evaluating: github.token
9##[debug]Evaluating Index:
10##[debug]..Evaluating github:
11##[debug]..=> Object
12##[debug]..Evaluating String:
13##[debug]..=> 'token'
14##[debug]=> '***'
15##[debug]Result: '***'
16##[debug]Loading env
17
Run actions/[email protected]
18  with:
19    emit_telemetry: false
20    token: ***
21    timeout: 600000
22    error_count: 10
23    reporting_interval: 5000
24    artifact_name: github-pages
25    preview: false
26##[debug]all variables are set
27##[debug]all variables are set
28##[debug]ID token url is https://[REDACTED]/_services/pipelines/eRhS9LBtNTGin3wENmb093bx6wzbQ19LimyrpKukvyqgYmqa0d/00000000-0000-0000-0000-000000000000/_apis/distributedtask/hubs/Actions/plans/399052e0-ae3b-4207-bd94-d869210658b3/jobs/e07742bd-189a-5079-918b-43f8b2f94b89/idtoken?api-version=2.0
29::add-mask::***
30##[debug]Actor: nilsw
31##[debug]Action ID: deployment
32##[debug]Actions Workflow Run ID: 98423
33##[debug]all variables are set
34Artifact exchange URL: https://[REDACTED]/_services/pipelines/eRhS9LBtNTGin3wENmb093bx6wzbQ19LimyrpKukvyqgYmqa0d/_apis/pipelines/workflows/98423/artifacts?api-version=6.0-preview
35##[debug]{"count":1,"value":[{"containerId":240179,"size":10240,"signedContent":null,"fileContainerResourceUrl":"https://[REDACTED]/_services/pipelines/eRhS9LBtNTGin3wENmb093bx6wzbQ19LimyrpKukvyqgYmqa0d/_apis/resources/Containers/240179","type":"actions_storage","name":"github-pages","url":"https://[REDACTED]/_services/pipelines/eRhS9LBtNTGin3wENmb093bx6wzbQ19LimyrpKukvyqgYmqa0d/_apis/pipelines/1/runs/4/artifacts?artifactName=github-pages","expiresOn":"2023-10-26T19:25:29.6207174Z","items":null}]}
36Creating Pages deployment with payload:
37{
38 "artifact_url": "https://[REDACTED]/_services/pipelines/eRhS9LBtNTGin3wENmb093bx6wzbQ19LimyrpKukvyqgYmqa0d/_apis/pipelines/1/runs/4/artifacts?artifactName=github-pages&%24expand=SignedContent",
39 "pages_build_version": "0fbfbe3039ef54252a8d6af01dec3d3020463a67",
40 "oidc_token": "***"
41}
42
Error:
Creating Pages deployment failed
43
Error:
HttpError: invalid json response body at https://[REDACTED]/api/v3/repos/security/sfdb-debug/pages/deployment reason: Unexpected end of JSON input
44    at /scratch/ghe-runners/2/_work/_actions/actions/deploy-pages/v1.2.9/webpack:/deploy-pages/node_modules/@octokit/request/dist-node/index.js:108:1
45    at processTicksAndRejections (node:internal/process/task_queues:96:5)
46    at createPagesDeployment (/scratch/ghe-runners/2/_work/_actions/actions/deploy-pages/v1.2.9/webpack:/deploy-pages/src/api-client.js:116:1)
47    at Deployment.create (/scratch/ghe-runners/2/_work/_actions/actions/deploy-pages/v1.2.9/webpack:/deploy-pages/src/deployment.js:59:1)
48    at main (/scratch/ghe-runners/2/_work/_actions/actions/deploy-pages/v1.2.9/webpack:/deploy-pages/src/index.js:30:1)
49
Error:
HttpError: invalid json response body at https://[REDACTED]/api/v3/repos/security/sfdb-debug/pages/deployment reason: Unexpected end of JSON input
50##[debug]Node Action run completed with exit code 1
51##[debug]Finishing: Deploy to GitHub Pages

Code of Conduct

  • I agree to follow this project's Code of Conduct
@tsusdere tsusdere added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Oct 27, 2023
@github-actions
Copy link

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@kfcampbell kfcampbell removed the Status: Triage This is being looked at and prioritized label Oct 27, 2023
@kfcampbell kfcampbell moved this from 🆕 Triage to 👀 In review in 🧰 Octokit Active Oct 27, 2023
wolfy1339 pushed a commit that referenced this issue Nov 9, 2023
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in 🧰 Octokit Active Nov 9, 2023
Copy link

github-actions bot commented Nov 9, 2023

🎉 This issue has been resolved in version 8.1.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Type: Bug Something isn't working as documented
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants