Skip to content

[Bug]: ISR Not Working #1189

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

Closed
2 tasks
jadamconnor opened this issue Feb 2, 2022 · 15 comments
Closed
2 tasks

[Bug]: ISR Not Working #1189

jadamconnor opened this issue Feb 2, 2022 · 15 comments
Labels
type: bug code to address defects in shipped code

Comments

@jadamconnor
Copy link

Summary

I have a site that isn't updating without a full redeploy, though fallback is set to blocking, and revalidate is set to 60. This is a decoupled Wordpress setup that fetches its data through a plugin that extends it to GraphQL. Here is an example of my code from one page, but the problem is site-wide. None of the pages update. Here's an example page, but the problem is site-wide.

export async function getStaticProps({ params }) {
    const data = await getJobOpenings() // Fetches from GraphQL
    const primaryNavMenu = await getPrimaryMenu() // Fetches from GraphQL
    const footerNavMenu = await getFooterMenu() // Fetches from GraphQL

    return {
        props: {
            openingFields: data.nodes,
            primaryNav: primaryNavMenu.menus.edges[0].node,
            footerNav: footerNavMenu.menus.edges[0].node,
            slug: params.slug,
        },
        revalidate: 60
    }
}

export async function getStaticPaths() {
    const data = await getJobOpenings()
	
	return {
		paths: data?.nodes.filter((opening) => opening.openingFields.agency === 'JusticePoint').map((node) => `/jp-apply/${node.slug}`) || [],
		fallback: 'blocking'
	}
}

I'm not building using the CLI. I'm simply pushing to GitHub, which triggers the deploy. This site is a near copy of another site, and that site is revalidating. The function logs seem to reveal an issue in which the server is closing the connection, but I'm not sure if this is server related, or because of the behavior of the plugin.

Steps to reproduce

  1. Make update in CMS
  2. Wait interval specified by revalidate property in getStaticProps return object + ~60s for updating.
  3. Refresh page.

Content not updating to CMS content.

A link to a reproduction repository

No response

Plugin version

4.2.2

More information about your build

  • I am building using the CLI
  • I am building using file-based configuration (netlify.toml)

What OS are you using?

No response

Your netlify.toml file

`netlify.toml`
# Paste content of your `netlify.toml` file here

Your public/_redirects file

`_redirects`
# Paste content of your `_redirects` file here

Your next.config.js file

`next.config.js`
module.exports = {
  reactStrictMode: true,
  images: {
    domains: ['localhost', 'sironarecovery.wpengine.com'],
  }
}

Builds logs (or link to your logs)

Build logs
# Paste logs here

Function logs

Function logs
10:05:53 AM 7d4c1655 ERROR  FetchError: request to https://sironarecovery.wpengine.com/graphql failed, reason: Client network socket disconnected before secure TLS connection was established
    at ClientRequest.<anonymous> (/var/task/node_modules/next/dist/compiled/node-fetch/index.js:1:64142)
    at ClientRequest.emit (events.js:400:28)
    at TLSSocket.socketErrorListener (_http_client.js:475:9)
    at TLSSocket.emit (events.js:400:28)
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  type: 'system',
  errno: 'ECONNRESET',
  code: 'ECONNRESET'
}
10:05:53 AM 7d4c1655 ERROR  FetchError: request to https://sironarecovery.wpengine.com/graphql failed, reason: Client network socket disconnected before secure TLS connection was established
    at ClientRequest.<anonymous> (/var/task/node_modules/next/dist/compiled/node-fetch/index.js:1:64142)
    at ClientRequest.emit (events.js:400:28)
    at TLSSocket.socketErrorListener (_http_client.js:475:9)
    at TLSSocket.emit (events.js:400:28)
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  type: 'system',
  errno: 'ECONNRESET',
  code: 'ECONNRESET'
}
10:05:53 AM 7d4c1655 ERROR  FetchError: request to https://sironarecovery.wpengine.com/graphql failed, reason: socket hang up
    at ClientRequest.<anonymous> (/var/task/node_modules/next/dist/compiled/node-fetch/index.js:1:64142)
    at ClientRequest.emit (events.js:400:28)
    at TLSSocket.socketOnEnd (_http_client.js:499:9)
    at TLSSocket.emit (events.js:412:35)
    at endReadableNT (internal/streams/readable.js:1334:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  type: 'system',
  errno: 'ECONNRESET',
  code: 'ECONNRESET'
}
10:05:54 AM 065e9a86 INFO   [GET] /careers/pretrial-case-manager-5 (ISR)
10:05:54 AM 065e9a86 Duration: 929.93 ms	Memory Usage: 98 MB
10:06:10 AM b4583650 INFO   [GET] /justicepoint-careers (ISR)
10:06:10 AM b4583650 Duration: 194.56 ms	Memory Usage: 110 MB
10:06:10 AM 5c6c9850 INFO   [GET] /_next/data/2ApuxsqUdUIwtNZvk6Vpj/careers/case-manager-2.json (ISR)
10:06:10 AM 5c6c9850 Duration: 9.54 ms	Memory Usage: 110 MB
10:06:11 AM eaec00f4 INFO   [GET] /_next/data/2ApuxsqUdUIwtNZvk6Vpj/jp-apply/case-manager-2.json (ISR)
10:06:11 AM eaec00f4 Duration: 8.81 ms	Memory Usage: 110 MB
10:06:11 AM a13403c4 INFO   [GET] /_next/data/2ApuxsqUdUIwtNZvk6Vpj/justicepoint-careers/case-manager-2.json (ISR)
10:06:11 AM a13403c4 Duration: 8.86 ms	Memory Usage: 110 MB
10:06:11 AM c1b8696a INFO   [GET] /_next/data/2ApuxsqUdUIwtNZvk6Vpj/careers/pretrial-case-manager-3.json (ISR)
10:06:11 AM c1b8696a Duration: 6.98 ms	Memory Usage: 110 MB
10:06:11 AM 2543b5b7 INFO   [GET] /_next/data/2ApuxsqUdUIwtNZvk6Vpj/justicepoint-careers/pretrial-case-manager-3.json (ISR)
10:06:11 AM 2543b5b7 Duration: 8.30 ms	Memory Usage: 110 MB
10:06:11 AM 49e72fc9 INFO   [GET] /_next/data/2ApuxsqUdUIwtNZvk6Vpj/jp-apply/pretrial-case-manager-3.json (ISR)
10:06:11 AM 49e72fc9 Duration: 8.80 ms	Memory Usage: 110 MB
10:06:13 AM 67a12168 INFO   [GET] /_next/data/2ApuxsqUdUIwtNZvk6Vpj/careers/jail-screening-specialist-4.json (ISR)
10:06:13 AM 67a12168 Duration: 22.93 ms	Memory Usage: 110 MB
10:06:13 AM eb526fb6 INFO   [GET] /_next/data/2ApuxsqUdUIwtNZvk6Vpj/justicepoint-careers/jail-screening-specialist-4.json (ISR)
10:06:13 AM eb526fb6 Duration: 5.25 ms	Memory Usage: 110 MB
10:06:13 AM 3a37d95c ERROR  FetchError: request to https://sironarecovery.wpengine.com/graphql failed, reason: Client network socket disconnected before secure TLS connection was established
    at ClientRequest.<anonymous> (/var/task/node_modules/next/dist/compiled/node-fetch/index.js:1:64142)
    at ClientRequest.emit (events.js:400:28)
    at TLSSocket.socketErrorListener (_http_client.js:475:9)
    at TLSSocket.emit (events.js:400:28)
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  type: 'system',
  errno: 'ECONNRESET',
  code: 'ECONNRESET'
}
10:06:13 AM 3a37d95c ERROR  FetchError: request to https://sironarecovery.wpengine.com/graphql failed, reason: Client network socket disconnected before secure TLS connection was established
    at ClientRequest.<anonymous> (/var/task/node_modules/next/dist/compiled/node-fetch/index.js:1:64142)
    at ClientRequest.emit (events.js:400:28)
    at TLSSocket.socketErrorListener (_http_client.js:475:9)
    at TLSSocket.emit (events.js:400:28)
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  type: 'system',
  errno: 'ECONNRESET',
  code: 'ECONNRESET'
}
10:06:13 AM 3a37d95c ERROR  FetchError: request to https://sironarecovery.wpengine.com/graphql failed, reason: Client network socket disconnected before secure TLS connection was established
    at ClientRequest.<anonymous> (/var/task/node_modules/next/dist/compiled/node-fetch/index.js:1:64142)
    at ClientRequest.emit (events.js:400:28)
    at TLSSocket.socketErrorListener (_http_client.js:475:9)
    at TLSSocket.emit (events.js:400:28)
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  type: 'system',
  errno: 'ECONNRESET',
  code: 'ECONNRESET'
}
10:06:13 AM 90e629ea INFO   [GET] /_next/data/2ApuxsqUdUIwtNZvk6Vpj/jp-apply/jail-screening-specialist-4.json (ISR)
10:06:13 AM 90e629ea Duration: 14.42 ms	Memory Usage: 142 MB
10:06:15 AM d2be0a00 INFO   [GET] /_next/data/2ApuxsqUdUIwtNZvk6Vpj/careers/case-manager.json (ISR)
10:06:15 AM d2be0a00 Duration: 7.75 ms	Memory Usage: 142 MB
10:06:15 AM 065c2d72 INFO   [GET] /_next/data/2ApuxsqUdUIwtNZvk6Vpj/jp-apply/case-manager.json (ISR)
10:06:15 AM 065c2d72 Duration: 6.21 ms	Memory Usage: 142 MB
10:06:15 AM 5bcd5e0d INFO   [GET] /_next/data/2ApuxsqUdUIwtNZvk6Vpj/justicepoint-careers/case-manager.json (ISR)
10:06:15 AM 5bcd5e0d Duration: 6.85 ms	Memory Usage: 142 MB
10:06:15 AM 53346dd7 INFO   [GET] /_next/data/2ApuxsqUdUIwtNZvk6Vpj/careers/diversion-case-manager-2.json (ISR)
10:06:15 AM 53346dd7 Duration: 7.70 ms	Memory Usage: 142 MB
10:06:16 AM 14f4f2d1 INFO   [GET] /_next/data/2ApuxsqUdUIwtNZvk6Vpj/jp-apply/diversion-case-manager-2.json (ISR)
10:06:16 AM 66e53d71 INFO   [GET] /_next/data/2ApuxsqUdUIwtNZvk6Vpj/justicepoint-careers/diversion-case-manager-2.json (ISR)
10:06:16 AM 14f4f2d1 Duration: 14.61 ms	Memory Usage: 142 MB
10:06:16 AM 66e53d71 Duration: 8.61 ms	Memory Usage: 110 MB
10:06:16 AM 406bbcc3 INFO   [GET] /_next/data/2ApuxsqUdUIwtNZvk6Vpj/careers/jp-installer.json (ISR)
10:06:16 AM 406bbcc3 Duration: 6.12 ms	Memory Usage: 110 MB
10:07:41 AM 406bbcc3 ERROR  FetchError: request to https://sironarecovery.wpengine.com/graphql failed, reason: socket hang up
    at ClientRequest.<anonymous> (/var/task/node_modules/next/dist/compiled/node-fetch/index.js:1:64142)
    at ClientRequest.emit (events.js:400:28)
    at TLSSocket.socketOnEnd (_http_client.js:499:9)
    at TLSSocket.emit (events.js:412:35)
    at endReadableNT (internal/streams/readable.js:1334:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  type: 'system',
  errno: 'ECONNRESET',
  code: 'ECONNRESET'
}
10:07:41 AM 406bbcc3 ERROR  FetchError: request to https://sironarecovery.wpengine.com/graphql failed, reason: socket hang up
    at ClientRequest.<anonymous> (/var/task/node_modules/next/dist/compiled/node-fetch/index.js:1:64142)
    at ClientRequest.emit (events.js:400:28)
    at TLSSocket.socketOnEnd (_http_client.js:499:9)
    at TLSSocket.emit (events.js:412:35)
    at endReadableNT (internal/streams/readable.js:1334:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  type: 'system',
  errno: 'ECONNRESET',
  code: 'ECONNRESET'
}
10:07:41 AM 406bbcc3 ERROR  FetchError: request to https://sironarecovery.wpengine.com/graphql failed, reason: socket hang up
    at ClientRequest.<anonymous> (/var/task/node_modules/next/dist/compiled/node-fetch/index.js:1:64142)
    at ClientRequest.emit (events.js:400:28)
    at TLSSocket.socketOnEnd (_http_client.js:499:9)
    at TLSSocket.emit (events.js:412:35)
    at endReadableNT (internal/streams/readable.js:1334:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  type: 'system',
  errno: 'ECONNRESET',
  code: 'ECONNRESET'
}
10:07:41 AM 406bbcc3 ERROR  FetchError: request to https://sironarecovery.wpengine.com/graphql failed, reason: Client network socket disconnected before secure TLS connection was established
    at ClientRequest.<anonymous> (/var/task/node_modules/next/dist/compiled/node-fetch/index.js:1:64142)
    at ClientRequest.emit (events.js:400:28)
    at TLSSocket.socketErrorListener (_http_client.js:475:9)
    at TLSSocket.emit (events.js:400:28)
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  type: 'system',
  errno: 'ECONNRESET',
  code: 'ECONNRESET'
}
10:07:41 AM 62bc1e12 INFO   [GET] /justicepoint-careers/case-manager-2 (ISR)
10:07:41 AM 62bc1e12 Duration: 28.09 ms	Memory Usage: 110 MB
10:07:42 AM f732c71b INFO   [GET] /_next/data/2ApuxsqUdUIwtNZvk6Vpj/jp-apply/case-manager-2.json (ISR)
10:07:42 AM f732c71b Duration: 4.78 ms	Memory Usage: 110 MB
10:08:13 AM f732c71b ERROR  FetchError: request to https://sironarecovery.wpengine.com/graphql failed, reason: socket hang up
    at ClientRequest.<anonymous> (/var/task/node_modules/next/dist/compiled/node-fetch/index.js:1:64142)
    at ClientRequest.emit (events.js:400:28)
    at TLSSocket.socketOnEnd (_http_client.js:499:9)
    at TLSSocket.emit (events.js:412:35)
    at endReadableNT (internal/streams/readable.js:1334:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  type: 'system',
  errno: 'ECONNRESET',
  code: 'ECONNRESET'
}
10:08:13 AM f732c71b ERROR  FetchError: request to https://sironarecovery.wpengine.com/graphql failed, reason: socket hang up
    at ClientRequest.<anonymous> (/var/task/node_modules/next/dist/compiled/node-fetch/index.js:1:64142)
    at ClientRequest.emit (events.js:400:28)
    at TLSSocket.socketOnEnd (_http_client.js:499:9)
    at TLSSocket.emit (events.js:412:35)
    at endReadableNT (internal/streams/readable.js:1334:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  type: 'system',
  errno: 'ECONNRESET',
  code: 'ECONNRESET'
}
10:08:13 AM f732c71b ERROR  FetchError: request to https://sironarecovery.wpengine.com/graphql failed, reason: socket hang up
    at ClientRequest.<anonymous> (/var/task/node_modules/next/dist/compiled/node-fetch/index.js:1:64142)
    at ClientRequest.emit (events.js:400:28)
    at TLSSocket.socketOnEnd (_http_client.js:499:9)
    at TLSSocket.emit (events.js:412:35)
    at endReadableNT (internal/streams/readable.js:1334:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  type: 'system',
  errno: 'ECONNRESET',
  code: 'ECONNRESET'
}
10:08:13 AM f732c71b ERROR  FetchError: request to https://sironarecovery.wpengine.com/graphql failed, reason: socket hang up
    at ClientRequest.<anonymous> (/var/task/node_modules/next/dist/compiled/node-fetch/index.js:1:64142)
    at ClientRequest.emit (events.js:400:28)
    at TLSSocket.socketOnEnd (_http_client.js:499:9)
    at TLSSocket.emit (events.js:412:35)
    at endReadableNT (internal/streams/readable.js:1334:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  type: 'system',
  errno: 'ECONNRESET',
  code: 'ECONNRESET'
}
10:08:13 AM f732c71b ERROR  FetchError: request to https://sironarecovery.wpengine.com/graphql failed, reason: socket hang up
    at ClientRequest.<anonymous> (/var/task/node_modules/next/dist/compiled/node-fetch/index.js:1:64142)
    at ClientRequest.emit (events.js:400:28)
    at TLSSocket.socketOnEnd (_http_client.js:499:9)
    at TLSSocket.emit (events.js:412:35)
    at endReadableNT (internal/streams/readable.js:1334:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  type: 'system',
  errno: 'ECONNRESET',
  code: 'ECONNRESET'
}
10:08:13 AM 1b1158cd INFO   [GET] /news/recovery-reimagined/ (ODB)
10:08:13 AM 1b1158cd Duration: 11.88 ms	Memory Usage: 110 MB
10:08:14 AM 2cf72bf8 INFO   [GET] /news/recovery-reimagined (ISR)
10:08:14 AM 2cf72bf8 Duration: 18.55 ms	Memory Usage: 110 MB
10:08:18 AM 1156a02f INFO   [GET] /_next/data/2ApuxsqUdUIwtNZvk6Vpj/index.json (ISR)
10:08:18 AM 1156a02f Duration: 890.40 ms	Memory Usage: 115 MB
10:08:18 AM 964bb510 INFO   [GET] /_next/data/2ApuxsqUdUIwtNZvk6Vpj/programs/hph.json (ISR)
10:08:18 AM 964bb510 Duration: 11.11 ms	Memory Usage: 115 MB
10:08:18 AM a687de56 INFO   [GET] /_next/data/2ApuxsqUdUIwtNZvk6Vpj/programs.json (ISR)
10:08:18 AM a687de56 Duration: 8.96 ms	Memory Usage: 115 MB
10:08:19 AM 16529289 INFO   [GET] /_next/data/2ApuxsqUdUIwtNZvk6Vpj/programs/rsc.json (ISR)
10:08:19 AM 16529289 Duration: 8.44 ms	Memory Usage: 115 MB
10:08:19 AM f2d8dd10 INFO   [GET] /_next/data/2ApuxsqUdUIwtNZvk6Vpj/programs/teen.json (ISR)
10:08:19 AM f2d8dd10 Duration: 6.55 ms	Memory Usage: 115 MB
10:08:19 AM 8c31438e INFO   [GET] /_next/data/2ApuxsqUdUIwtNZvk6Vpj/programs/otc.json (ISR)
10:08:19 AM 8c31438e Duration: 282.49 ms	Memory Usage: 117 MB
10:08:19 AM 542bba67 INFO   [GET] /_next/data/2ApuxsqUdUIwtNZvk6Vpj/programs/sa.json (ISR)
10:08:19 AM 542bba67 Duration: 6.94 ms	Memory Usage: 117 MB
10:08:45 AM 542bba67 ERROR  FetchError: request to https://sironarecovery.wpengine.com/graphql failed, reason: socket hang up
    at ClientRequest.<anonymous> (/var/task/node_modules/next/dist/compiled/node-fetch/index.js:1:64142)
    at ClientRequest.emit (events.js:400:28)
    at TLSSocket.socketOnEnd (_http_client.js:499:9)
    at TLSSocket.emit (events.js:412:35)
    at endReadableNT (internal/streams/readable.js:1334:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  type: 'system',
  errno: 'ECONNRESET',
  code: 'ECONNRESET'
}
10:08:45 AM 542bba67 ERROR  FetchError: request to https://sironarecovery.wpengine.com/graphql failed, reason: Client network socket disconnected before secure TLS connection was established
    at ClientRequest.<anonymous> (/var/task/node_modules/next/dist/compiled/node-fetch/index.js:1:64142)
    at ClientRequest.emit (events.js:400:28)
    at TLSSocket.socketErrorListener (_http_client.js:475:9)
    at TLSSocket.emit (events.js:400:28)
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  type: 'system',
  errno: 'ECONNRESET',
  code: 'ECONNRESET'
}
10:08:45 AM 880d718d INFO   [GET] / (ISR)
10:08:45 AM 880d718d Duration: 32.38 ms	Memory Usage: 117 MB

.next JSON files

generated .next JSON files
# Paste file contents here. Please check there isn't any private info in them
# You can either build locally, or download the deploy from Netlify by clicking the arrow next to the deploy time.
@jadamconnor jadamconnor added the type: bug code to address defects in shipped code label Feb 2, 2022
@ascorbic
Copy link
Contributor

ascorbic commented Feb 2, 2022

I'm interested in those FetchErrors in the logs. Do those requests work on SSR pages?

@jadamconnor
Copy link
Author

jadamconnor commented Feb 2, 2022

I'm interested in those FetchErrors in the logs. Do those requests work on SSR pages?

Those are all getting called in getStaticProps. I don't use SSR anywhere in the site.

@jadamconnor
Copy link
Author

jadamconnor commented Feb 2, 2022

Take this example:

10:06:16 AM 406bbcc3 INFO   [GET] /_next/data/2ApuxsqUdUIwtNZvk6Vpj/careers/jp-installer.json (ISR)
10:06:16 AM 406bbcc3 Duration: 6.12 ms	Memory Usage: 110 MB
10:07:41 AM 406bbcc3 ERROR  FetchError: request to https://sironarecovery.wpengine.com/graphql failed, reason: socket hang up
    at ClientRequest.<anonymous> (/var/task/node_modules/next/dist/compiled/node-fetch/index.js:1:64142)
    at ClientRequest.emit (events.js:400:28)
    at TLSSocket.socketOnEnd (_http_client.js:499:9)
    at TLSSocket.emit (events.js:412:35)
    at endReadableNT (internal/streams/readable.js:1334:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  type: 'system',
  errno: 'ECONNRESET',
  code: 'ECONNRESET'
}

This is a page that is statically generated dynamically at build time using getStaticPaths. I used it as an example in the original post here. It generates on demand just fine, but it isn't revalidating/updating. Nor are any of the other pages on the site. New pages generate, but none of them update.

That error indicates in my experience that the application is hitting the API endpoint rapidly--something you'd usually see if revalidate was set too low, but I'm not sure in this case.

@jadamconnor
Copy link
Author

I'm interested in those FetchErrors in the logs. Do those requests work on SSR pages?

Those are all getting called in getStaticProps. I don't use SSR anywhere in the site.

I might have misunderstood the question, sorry. I haven't tried fetching data for this page with SSR, but it seems like you're suggesting SSG isn't fetching the data. It is fetching the data--it's just not updating the data via ISR for some reason. And it also looks like those fetches are successful anyway, but that they are attempting to fetch again before the first connection is closed, which causes that error.

@jadamconnor
Copy link
Author

So I've spent the whole day trying to isolate this issue. At one point I created a new site on Netlify to see if the issue followed me to the new site. It did--with the same FetchError. I've converted the whole site to SSR, and as you'd expect the error was gone, but obviously that doesn't fix ISR. I tried using SSG with ISR on just one page--the error returned and ISR did not work. Finally, I had the idea to deploy the same site to Vercel. The issue disappeared. ISR works fine on Vercel with no changes to the source code.

@ascorbic
Copy link
Contributor

ascorbic commented Feb 3, 2022

OK, thanks for the details. I'm going to look into this today.

@ascorbic
Copy link
Contributor

ascorbic commented Feb 3, 2022

Hi. Could you see if version 4.2.4 of @netlify/plugin-nextjs fixes this for you?

@jota
Copy link

jota commented Feb 3, 2022

Had the same or similar issue, upgrading to 4.2.4 fixed it for me.

@ascorbic
Copy link
Contributor

ascorbic commented Feb 3, 2022

Thanks @jota

@jadamconnor
Copy link
Author

jadamconnor commented Feb 3, 2022

Yep. It looks like 4.2.4 resolved the issue. Thank you.

@ascorbic
Copy link
Contributor

ascorbic commented Feb 3, 2022

Great! Thanks again for your help in tracking this down. Sorry it too so much of your time.

@ascorbic ascorbic closed this as completed Feb 3, 2022
@jota
Copy link

jota commented Feb 3, 2022

thought it was solved, but now started getting different errors, not sure if this is related still posting here in case somebody else has the same:

  • page has ISR with revalidate set to 15 seconds

  • during the build getStaticProps runs fine.

  • but when opening it in the browser after 15 seconds, there is an error:
    {"errorMessage":"2022-02-03T17:40:41.062Z 4a5b4ae1-4415-455c-96f6-318675fc0fdf Task timed out after 10.01 seconds"}

I would think that the way nextjs works, even if ISR has an error, it would show the previously rendered version. strange...

Netlify functions logs (nothing more in there, first statement in getStaticProps is a console.log that does not even show up here):
08:04:00 PM: d9cbadcf Duration: 10009.08 ms Memory Usage: 229 MB
08:04:00 PM: d9cbadcf ERROR Task timed out after 10.01 seconds

any ideas how to debug this?
i'm kinda stuck because not even the first console.log in my getStaticProps is executed.

@jadamconnor
Copy link
Author

jadamconnor commented Feb 3, 2022

thought it was solved, but now started getting different errors, not sure if this is related still posting here in case somebody else has the same:

  • page has ISR with revalidate set to 15 seconds

  • during the build getStaticProps runs fine.

  • but when opening it in the browser after 15 seconds, there is an error:

{"errorMessage":"2022-02-03T17:40:41.062Z 4a5b4ae1-4415-455c-96f6-318675fc0fdf Task timed out after 10.01 seconds"}

I would think that the way nextjs works, even if ISR has an error, it would show the previously rendered version. strange...

Netlify functions logs (nothing more in there, first statement in getStaticProps is a console.log that does not even show up here):

08:04:00 PM: d9cbadcf Duration: 10009.08 ms Memory Usage: 229 MB

08:04:00 PM: d9cbadcf ERROR Task timed out after 10.01 seconds

any ideas how to debug this?

i'm kinda stuck because not even the first console.log in my getStaticProps is executed.

Sounds like the function is timing out. I imagine Netlify has some kind of limit on function execution. If the the odb function is timing out it would be a 500 type error I think. Also, the minimum revalidate interval is 60s on Netlify. Have you tried setting revalidate to 60s as a way to isolate the error? It should have set the revalidate to 60 during build and notified you that it did. Maybe that broke in this patch.

@ascorbic
Copy link
Contributor

ascorbic commented Feb 3, 2022

If it's set to less than 60s then we just increase it to 60, so that won't be the issue. @jota this looks like a separate issue, so if you're not able to find the problem please open a new issue with all of the requested details

@jota
Copy link

jota commented Feb 4, 2022

Thanks for the input! Someone else already opened an issue with that same problem (here)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

3 participants