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

TypeError: Converting circular structure to JSON #158

Closed
SimonSiefke opened this issue Apr 18, 2023 · 10 comments · Fixed by #197
Closed

TypeError: Converting circular structure to JSON #158

SimonSiefke opened this issue Apr 18, 2023 · 10 comments · Fixed by #197
Labels
bug Something isn't working

Comments

@SimonSiefke
Copy link
Contributor

When the deployment fails, an extra error is logged TypeError: Converting circular structure to JSON.

Run actions/deploy-pages@v1
Artifact exchange URL: https://pipelines.actions.githubusercontent.com/9OtalDJVyLyDdev6inEYQsch43zFDau4CbJSKDrBmMKW7l90L0/_apis/pipelines/workflows/4736187376/artifacts?api-version=6.0-preview
Creating Pages deployment with payload:
{
	"artifact_url": "https://pipelines.actions.githubusercontent.com/9OtalDJVyLyDdev6inEYQsch43zFDau4CbJSKDrBmMKW7l90L0/_apis/pipelines/1/runs/8451/artifacts?artifactName=github-pages&%24expand=SignedContent",
	"pages_build_version": "61bafce1df6a9bf8ae2606d1728980066c6a3817",
	"oidc_token": "***"
}
Error: Creating Pages deployment failed
Error: HttpError: Deployment request failed for 61bafce1df6a9bf8ae2606d1728980066c6a3817 due to in progress deployment. Please cancel 3f30596e81bc4367e96f8af01be23cd080f83ead first or wait for it to complete.
    at /home/runner/work/_actions/actions/deploy-pages/v1/webpack:/deploy-pages/node_modules/@octokit/request/dist-node/index.js:86:1
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at createPagesDeployment (/home/runner/work/_actions/actions/deploy-pages/v1/webpack:/deploy-pages/src/api-client.js:116:1)
    at Deployment.create (/home/runner/work/_actions/actions/deploy-pages/v1/webpack:/deploy-pages/src/deployment.js:58:1)
    at main (/home/runner/work/_actions/actions/deploy-pages/v1/webpack:/deploy-pages/src/index.js:30:1)
Error: TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'TLSSocket'
    |     property '_httpMessage' -> object with constructor 'ClientRequest'
    --- property 'socket' closes the circle

I believe the issue is located here

core.debug(JSON.stringify(error))
where the function call JSON.stringify(error) fails when the error contains cyclic references.

A possible solution might be to use https://www.npmjs.com/package/serialize-error to remove the cyclic references from the error before passing the result to JSON.stringify.

@JamesMGreene JamesMGreene added the bug Something isn't working label Apr 30, 2023
@jlopp
Copy link

jlopp commented May 10, 2023

Just wanted to note that I'm seeing the same issue with one of my projects at https://github.com/jlopp/bitcoin-transaction-size-calculator/actions/runs/4940715737

@codefrau
Copy link

Same error here https://github.com/croquet/worldcore/actions/runs/4941689075

@bartvdbraak
Copy link

I am also encountering the same error currently:
https://github.com/bartvdbraak/omnidash/actions/runs/5231016740/jobs/9444935459?pr=21

@ArthurSonzogni
Copy link

Same error here:
https://github.com/ArthurSonzogni/ChromeCommitTracker/actions/runs/5444571261

@solderneer
Copy link

Just got the same error as well, not sure how helpful this additional example is 😅
https://github.com/solderneer/solderneer/actions/runs/5444544651/jobs/9903042221

@bago
Copy link

bago commented Jul 3, 2023

Same here now:
https://github.com/voidlabs/mosaico.io/actions/runs/5445090273/jobs/9903851393

UPDATE 2023/07/04 it works again.

@anibe
Copy link

anibe commented Jul 20, 2023

Can confirm that #197 deploy-pages@v2.0.3 fixes the issue. Thank you @JamesMGreene

@abinmn
Copy link

abinmn commented Aug 3, 2023

Is it possible to put #197 on v1.x? My enterprise version currently support only v1.x

@JamesMGreene
Copy link
Contributor

@abinmn That's a reasonable request! 👍🏻

I've gone ahead and backported #197 (and #187) into a new v1.2.9 release (and the latest v1 tag). Hope that helps. ❤️

@abinmn
Copy link

abinmn commented Aug 10, 2023

Thanks @JamesMGreene

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants