codesandbox / codesandbox/codesandbox-client

yarn cache dir fills up completely on cloud sandbox

Open
#7,697 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
13.6k
Forks
2.4k
Avg merge
6d 19h
Merged PRs (30d)
2

Description

🐛 bug report

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project
    adheres to.
  • I have searched the issue tracker for an issue that matches the one I want
    to file, without success.

Description of the problem

I have some links to cloud sandboxes. The underlying folder updates from time to time. The yarn cache in the cloud sandbox keeps growing as dependencies are added/updated, but unused ones stay in the cache. This goes on until the sandbox fails to initialize due to ENOSPC errors.

How has this issue affected you? What are you trying to accomplish?

All our codesandbox examples break after a while.

To Reproduce
  1. create link to cloud sandbox. e.g. https://codesandbox.io/p/sandbox/github/mui/mui-toolpad/tree/master/examples/custom-datagrid-column
  2. over time update the package.json in that folder with new/updated dependencies
  3. watch the link break over time
  4. forked sandboxes have the same problem

You can observe by forking https://codesandbox.io/p/sandbox/github/mui/mui-toolpad/tree/master/examples/custom-datagrid-column

run

du -sh $(yarn cache dir)
yarn cache clean
yarn
du -sh $(yarn cache dir)

Notice how the second time around the sandbox installs correctly, and the cache folder size is much smaller

I also noticed yarn cache list fails

$ yarn cache list    
yarn cache v1.22.19
error An unexpected error occurred: "There should only be one folder in a package cache (got  in /project/home/janpot/.cache/yarn/v6/npm-@emotion-react-11.11.1-b2c36afac95b184f73b08da8c214fdf861fa4157-integrity/node_modules/@emotion)".
info If you think this is a bug, please open a bug report with the information provided in "/project/home/janpot/workspace/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/cache for documentation about this command.
Link to sandbox: link
Your Environment

Version: 3e519ff
Environment: production
Sandbox: 6yl6gb
Pitcher: 0.293.4
Manager: 1.23.2
Cluster: fc-eu-0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the cloud sandbox failure with the linked example, then compare the Yarn cache before and after running yarn cache clean and yarn. Investigate the sandbox's dependency-cache handling and the reported yarn cache list failure. Done means repeated dependency updates no longer exhaust the sandbox or leave the example unable to initialize.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cloud, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.