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

Socket hang up #208

Closed
microcipcip opened this issue Mar 31, 2021 · 6 comments · Fixed by #217
Closed

Socket hang up #208

microcipcip opened this issue Mar 31, 2021 · 6 comments · Fixed by #217

Comments

@microcipcip
Copy link

microcipcip commented Mar 31, 2021

When it starts generating the images after running npm run generate, I get an error similar to the one below many times, is it because I am generating too many images? Maybe I need an interval?

ERROR request to http://localhost:56688/_image/local/_/w_1920_cover/villas/house.jpg failed, reason: socket hang up

I have 6 pages and each page has ~30 images:

      <div
        v-for="(image, index) of gallery"
        :key="image"
      >
        <NuxtImage
          :key="image"
          :src="image"
          sets="300, 600, 1280, 1920"
          :legacy="true"
        />
      </div>

Edit: maybe is because I am using composition API?

@messismore
Copy link

Same issue here, deploying to Netlify:
[error] [@nuxt/image] request to http://localhost:37413/_ipx/cycles/brandenburgs-forests.png?w=768&f=png failed, reason: socket hang up

13 images, no composition API. This is my config:

  image: {
    screens: {
      xs: 320,
      sm: 640,
      md: 768,
      lg: 1024,
      xl: 1280,
      xxl: 1536,
      '2xl': 1536
    },
  },

Pull Request → messismore/do-what-you-want#1

@microcipcip
Copy link
Author

I have the feeling that the images are being generated all at once asynchronously. So if you have a large quantity of pictures it will fail.

@ambroisemaupate
Copy link

Kind of same issue but with 404 errors:

Images do well exist and they don't fail when using server target. I believe we should be able to configure HTTP client in https://github.com/nuxt/image/blob/main/src/generate.ts#L46 to see if this is a timeout or too many requests issue.

Then errors during download should fail job too. We have a CI/CD pipeline for generating our website, but if it don't fail we get broken images online.

$ nuxt-ts generate --fail-on-error
[error] [@nuxt/image] Unexpected response Not Found
[error] [@nuxt/image] Unexpected response Not Found
[error] [@nuxt/image] Unexpected response Not Found
[error] [@nuxt/image] Unexpected response Not Found
[error] [@nuxt/image] Unexpected response Not Found

@microcipcip
Copy link
Author

Yeah, it seems that is doing too many calls at once, I've replaced this module completely with a custom node script using sharp and a batcher function, to avoid the socket hang up issue altogether.

@messismore
Copy link

messismore commented Apr 7, 2021

The suggested workaround for #198 seems to work for me as well.

@pi0 pi0 linked a pull request Apr 19, 2021 that will close this issue
@pi0 pi0 closed this as completed in #217 Apr 19, 2021
@khako
Copy link

khako commented Jan 24, 2022

I still get this error when running yarn generate from my CI but I don't have it when running locally ... (I'm on 0.6.0). Any ideas ?

[error] [@nuxt/image] Unexpected response IPX: Too Many Requests
[error] [@nuxt/image] Unexpected response IPX: Too Many Requests
[error] [@nuxt/image] Unexpected response IPX: Too Many Requests
[error] [@nuxt/image] Unexpected response IPX: Too Many Requests
[error] [@nuxt/image] Unexpected response IPX: Too Many Requests
[error] [@nuxt/image] Unexpected response IPX: Too Many Requests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants