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

Inadequate error handling for failed data fetches during build #15146

Open
1 of 2 tasks
wackerow opened this issue Mar 20, 2025 · 2 comments
Open
1 of 2 tasks

Inadequate error handling for failed data fetches during build #15146

wackerow opened this issue Mar 20, 2025 · 2 comments
Assignees
Labels
bug 🐛 Something isn't working

Comments

@wackerow
Copy link
Member

Describe the bug

Recently we experienced a bug on the Layer 2 Networks page (https://ethereum.org/en/layer-2/networks/) where clicking on many of the network accordions was leading to the page immediately crashing with a 500 internal server error.

The console logs alluded to a variable being undefined which should normally have been the data from an API fetch, which is performed on the server at the time the site is built (not when the user visits the page). This was "fixed" by simply re-triggering the Netlify build, which ended up re-fetching the data successfully, and the immediate bug went away.

Despite that "fixing" the immediately issue, the underlying bug still exists where a failed data fetch does not properly surface itself, and we end up launching a deployment that has broken data and page elements.

To reproduce

Tricky to reproduce from production at the moment, but locally you could attempt to alter API fetches to mimic a response with undefined data.

Can see the endpoints being used for the layer 2 networks page inside src/pages/[locale]/layer-2/networks.tsx:

const loadData = dataLoader(
  [
    ["ethereumMarketcapData", fetchEthereumMarketcap],
    ["growThePieData", fetchGrowThePie],
    ["growThePieBlockspaceData", fetchGrowThePieBlockspace],
    ["growThePieMasterData", fetchGrowThePieMaster],
    ["l2beatData", fetchL2beat],
  ],
  REVALIDATE_TIME * 1000
)

Expected behavior

During a build, if data being fetched from these endpoints returns unsuccessfully, an error should be thrown which breaks/stops the build, preventing it from completing and being deployed.

Screenshots

No response

Desktop (please complete the following information)

No response

Smartphone (please complete the following information)

No response

Additional context

No response

Would you like to work on this issue?

  • Yes
  • No
@wackerow wackerow added the bug 🐛 Something isn't working label Mar 20, 2025
@github-actions github-actions bot added the needs triage 📥 This issue needs triaged before being worked on label Mar 20, 2025
@SamarthJ2004
Copy link
Contributor

Hi @wackerow , I would like to work on this.

@isabelladebrito isabelladebrito removed the needs triage 📥 This issue needs triaged before being worked on label Mar 20, 2025
@isabelladebrito
Copy link

Just assigned to you, @SamarthJ2004! Let us know if you need any help 👐

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

No branches or pull requests

3 participants