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]: storybook dev crash by file-system-cache #23189

Open
re-taro opened this issue Jun 22, 2023 · 3 comments
Open

[Bug]: storybook dev crash by file-system-cache #23189

re-taro opened this issue Jun 22, 2023 · 3 comments

Comments

@re-taro
Copy link
Contributor

re-taro commented Jun 22, 2023

Describe the bug

This is a rare error in the storybook cli and cannot be reproduced. It can be cured by deleting node_modules/.cache/storybook/dev-server.The error log is below.

> storybook dev -p 6006

@storybook/cli v7.0.22

info => Serving static files from ././public at /
info => Starting manager..
╭───────────────────────────────────────────────────╮
│                                                   │
│   Storybook 7.0.22 for react-vite started         │
│   191 ms for manager and 2.49 s for preview       │
│                                                   │
│    Local:            http://localhost:6006/       │
│    On your network:  http://192.168.11.7:6006/    │
│                                                   │
╰───────────────────────────────────────────────────╯
/home/re-taro/projects/github.com/suzuka-kosen-festa/2023-hp/node_modules/.pnpm/[email protected]/node_modules/file-system-cache/lib/common/Util.js:74
            throw new Error(`Failed to read cache value at: ${path}. ${error.message}`);
                  ^

Error: Failed to read cache value at: /home/re-taro/projects/github.com/suzuka-kosen-festa/2023-hp/node_modules/.cache/storybook/dev-server/a5a8bf6e622aef57065c6498611f40c911543d7d-f086b87885981c04ce7a583ff90a49313de83de7. /home/re-taro/projects/github.com/suzuka-kosen-festa/2023-hp/node_modules/.cache/storybook/dev-server/a5a8bf6e622aef57065c6498611f40c911543d7d-f086b87885981c04ce7a583ff90a49313de83de7: Unexpected end of JSON input
    at Object.<anonymous> (/home/re-taro/projects/github.com/suzuka-kosen-festa/2023-hp/node_modules/.pnpm/[email protected]/node_modules/file-system-cache/lib/common/Util.js:74:19)
    at Generator.throw (<anonymous>)
    at rejected (/home/re-taro/projects/github.com/suzuka-kosen-festa/2023-hp/node_modules/.pnpm/[email protected]/node_modules/file-system-cache/lib/common/Util.js:6:65)

Node.js v20.3.0
 ELIFECYCLE  Command failed with exit code 1.

To Reproduce

No response

System

System:
    OS: Linux 6.3 Arch Linux
    CPU: (12) x64 AMD Ryzen 5 5600U with Radeon Graphics
  Binaries:
    Node: 20.3.0 - ~/.asdf/installs/nodejs/20.3.0/bin/node
    npm: 9.6.7 - ~/.asdf/plugins/nodejs/shims/npm
  npmPackages:
    @storybook/addon-a11y: 7.0.22 => 7.0.22 
    @storybook/addon-essentials: 7.0.22 => 7.0.22 
    @storybook/addon-interactions: 7.0.22 => 7.0.22 
    @storybook/addon-links: 7.0.22 => 7.0.22 
    @storybook/blocks: 7.0.22 => 7.0.22 
    @storybook/react: 7.0.22 => 7.0.22 
    @storybook/react-vite: 7.0.22 => 7.0.22 
    @storybook/testing-library: 0.2.0 => 0.2.0

Additional context

No response

@shilman
Copy link
Member

shilman commented Jun 23, 2023

We should minimize the use of FS cache, starting with reverting this PR #20136. This will require some changes to how we analyze the data before we can make the change safely.

@antoinepairet
Copy link

@shilman The following issues seem to be related:

In our experience, the issue happens when we run Storybook tests in parallel. Our CI crashes randomly because of this error. I guess 2 tests are trying to access the cache at the same time and one of them fails.

Error: Failed to read cache value at: __REDACTED__/node_modules/.cache/storybook/dev-server/a5a8bf6e622aef57065c6498611f40c911543d7d-f086b87885981c04ce7a583ff90a49313de83de7.  __REDACTED__/node_modules/.cache/storybook/dev-server/a5a8bf6e622aef57065c6498611f40c911543d7d-f086b87885981c04ce7a583ff90a49313de83de7: Unexpected end of JSON input
    at Object.<anonymous> ( __REDACTED__/node_modules/file-system-cache/lib/common/Util.js:74:19)
    at Generator.throw (<anonymous>)
    at rejected ( __REDACTED__/node_modules/file-system-cache/lib/common/Util.js:6:65)

This happens on "@storybook/core-server": "7.5.1"

I will check with my team if we can provide a reproduction for this issue.

@re-taro
Copy link
Contributor Author

re-taro commented Nov 24, 2023

@antoinepairet
Hi, I’m with you on that.

In our experience, the issue happens when we run Storybook tests in parallel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

3 participants