从Content中查询图像时,EPROTO出现Gatsby 4错误 [英] Gatsby 4 error with EPROTO when querying the image from contentful

查看:15
本文介绍了从Content中查询图像时,EPROTO出现Gatsby 4错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我运行构建时,我都会收到关于此图像查询的错误。它与《盖茨比2》完美配合。

我检查了图像,发现它一点都不大。清除缓存无济于事。

错误#85901图形QL

您的GraphQL查询出错:

写入EPOTO 4614737408:错误:1408F10B:ssl例程:SSL3_GET_RECORD:错误的版本number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332:

16 |         url
  17 |       }
  18 |     }
  19 |     backgroundPosition
  20 |   }
  21 |   description {
  22 |     description
  23 |   }
  24 |   heroImage {
  25 |     description
> 26 |     gatsbyImageData(width: 1500, layout: CONSTRAINED, placeholder: BLURRED)
     |     ^
  27 |   }
文件路径:/Users/ht/Desktop/a/website/src/templates/blog-post.tsx URL路径:/BLOG/Inducting-for-PostgreSQL 插件:无

我的Gastby信息

System:
    OS: macOS 11.3.1
    CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.0.0 - ~/.nvm/versions/node/v16.0.0/bin/node
    npm: 7.10.0 - ~/.nvm/versions/node/v16.0.0/bin/npm
  Languages:
    Python: 2.7.16 - /usr/bin/python
  Browsers:
    Chrome: 97.0.4692.99
    Firefox: 96.0.2
    Safari: 14.1
  npmPackages:
    gatsby: ^4.6.0 => 4.6.0
    gatsby-background-image: 1.5.3 => 1.5.3
    gatsby-cli: ^4.6.0 => 4.6.0
    gatsby-image: ^3.11.0 => 3.11.0
    gatsby-plugin-emotion: ^7.6.0 => 7.6.0
    gatsby-plugin-feed: ^4.6.0 => 4.6.0
    gatsby-plugin-google-tagmanager: ^4.6.0 => 4.6.0
    gatsby-plugin-image: ^2.5.2 => 2.6.0
    gatsby-plugin-lodash: ^5.6.0 => 5.6.0
    gatsby-plugin-manifest: ^4.6.0 => 4.6.0
    gatsby-plugin-react-helmet: ^5.6.0 => 5.6.0
    gatsby-plugin-remove-trailing-slashes: ^4.6.0 => 4.6.0
    gatsby-plugin-robots-txt: ^1.5.5 => 1.7.0
    gatsby-plugin-sentry: ^1.0.1 => 1.0.1
    gatsby-plugin-sharp: ^4.6.0 => 4.6.0
    gatsby-plugin-sitemap: ^5.6.0 => 5.6.0
    gatsby-plugin-typegen: ^2.2.4 => 2.2.4
    gatsby-plugin-typescript: ^4.6.0 => 4.6.0
    gatsby-remark-external-links: 0.0.4 => 0.0.4
    gatsby-source-contentful: ^7.4.0 => 7.4.0
    gatsby-source-filesystem: ^4.6.0 => 4.6.0
    gatsby-source-workable: ^1.1.1 => 1.1.1
    gatsby-transformer-remark: ^5.6.0 => 5.6.0
    gatsby-transformer-sharp: ^4.6.0 => 4.6.0

我使用Gatsby-SOURCE-CONTENTful获取图像。在Gatsby-config.js中定义URL

{
      resolve: 'gatsby-source-contentful',
      options: {
        spaceId: 'abc', // Main
        accessToken:
          process.env.CONTENTFUL_API_TYPE === 'preview'
            ? process.env.CONTENTFUL_PREVIEW_TOKEN
            : process.env.CONTENTFUL_DELIVERY_TOKEN,
        host: process.env.CONTENTFUL_API_TYPE === 'preview' ? 'preview.contentful.com' : 'cdn.contentful.com',
      },
    },
    {
      resolve: 'gatsby-source-contentful',
      options: {
        spaceId: 'xyz', // Blog
        environment: 'master',
        accessToken:
          process.env.CONTENTFUL_API_TYPE === 'preview'
            ? process.env.CONTENTFUL_BLOG_PREVIEW_TOKEN
            : process.env.CONTENTFUL_BLOG_DELIVERY_TOKEN,
        host: process.env.CONTENTFUL_API_TYPE === 'preview' ? 'preview.contentful.com' : 'cdn.contentful.com',
      },
    }

你们能帮我解释一下这个错误意味着什么吗?非常感谢

推荐答案

该问题似乎已在修改GATSBY_EXPERIMENTAL_QUERY_CONCURRENCY环境变量值时得到解决,该值在默认情况下设置为4

此环境变量是Gatsby执行的并行GraphQL查询的数量。在本例中,from4to8起了作用。

潜在问题(EPROTO)可能是(超时)服务器响应,原因是提取和处理的数据量太大。多亏了并发性的增加,这个问题被绕过了。

您还可以尝试使用pageLimit插件配置来检查负载是否更改了请求的行为。

这篇关于从Content中查询图像时,EPROTO出现Gatsby 4错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆