NotionNext icon indicating copy to clipboard operation
NotionNext copied to clipboard

【20251008站点无数据、部署异常】日志显示 notion queryCollection 请求返回 530

Open tianyn1990 opened this issue 2 months ago • 10 comments

描述bug

  • 网站无法显示文章
  • 后台日志显示 notion queryCollection 请求返回 530

期望的正常结果 网站正常显示文章。

复现步骤 之前一直是好的,今天突然出现问题。

环境

  • 【必填】NotionNext版本 main 分支 (2025/10/06)
  • 【必填】主题 gitbook
  • 【必填】部署方案 阿里云ecs + docker
  • 【可选】操作系统: ubuntu
  • 【可选】浏览器 chrome

补充说明 后台日志

notionnext  | NotionAPI collectionQuery error xxx Request failed with status code 530: POST https://www.notion.so/api/v3/queryCollection
notionnext  | HTTPError: Request failed with status code 530: POST https://www.notion.so/api/v3/queryCollection
notionnext  |     at function_ (file:///app/node_modules/ky/distribution/core/Ky.js:31:29)
notionnext  |     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
notionnext  |     at async result.<computed> [as json] (file:///app/node_modules/ky/distribution/core/Ky.js:72:34)
notionnext  |     at async pMap.concurrency.concurrency (file:///app/node_modules/notion-client/build/index.js:86:36)
notionnext  |     at async file:///app/node_modules/p-map/index.js:121:20 {
notionnext  |   response: Response {
notionnext  |     status: 530,
notionnext  |     statusText: '',
notionnext  |     headers: Headers {
notionnext  |       date: 'Wed, 08 Oct 2025 04:20:12 GMT',
notionnext  |       'content-type': 'text/html; charset=UTF-8',
notionnext  |       'transfer-encoding': 'chunked',
notionnext  |       connection: 'keep-alive',
notionnext  |       'cf-ray': '98b2d829896fcf2e-SJC',
notionnext  |       'cache-control': 'private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0',
notionnext  |       expires: 'Thu, 01 Jan 1970 00:00:01 GMT',
notionnext  |       'strict-transport-security': 'max-age=31536000; includeSubDomains; preload',
notionnext  |       'referrer-policy': 'same-origin',
notionnext  |       'x-content-type-options': 'nosniff',
notionnext  |       'x-frame-options': 'SAMEORIGIN',
notionnext  |       'set-cookie': '__cf_bm=i1tQa23Neuj15Y1QQNPckiGS_L6bZ50z0QTPhSmkvVY-1759897212-1.0.1.1-WSF2Uw0WO5yAj9iuZlnPhx.BQjlbrCH1HKx1r8fvASf3ICrhgLVZS_zbcqzEhApiwUgtW3x4lm5x7YkDRc2FMSJ5ASlt.o_yfVQBkQhJPZU; path=/; expires=Wed, 08-Oct-25 04:50:12 GMT; domain=.notion.so; HttpOnly; Secure; SameSite=None, _cfuvid=ioF66EmAPyWMn0BO7EqOzLYurA0..F1xc4sjTNC0a7Y-1759897212514-0.0.1.1-604800000; path=/; domain=.notion.so; HttpOnly; Secure; SameSite=None',
notionnext  |       vary: 'Accept-Encoding',
notionnext  |       server: 'cloudflare',
notionnext  |       'alt-svc': 'h3=":443"; ma=86400'
notionnext  |     },
notionnext  |     body: ReadableStream { locked: false, state: 'readable', supportsBYOB: true },
notionnext  |     bodyUsed: false,
notionnext  |     ok: false,
notionnext  |     redirected: false,
notionnext  |     type: 'basic',
notionnext  |     url: 'https://www.notion.so/api/v3/queryCollection'
notionnext  |   },
notionnext  |   request: Request {
notionnext  |     method: 'POST',
notionnext  |     url: 'https://www.notion.so/api/v3/queryCollection',
notionnext  |     headers: Headers { 'content-type': 'application/json', accept: 'application/json' },
notionnext  |     destination: '',
notionnext  |     referrer: 'about:client',
notionnext  |     referrerPolicy: '',
notionnext  |     mode: 'cors',
notionnext  |     credentials: 'same-origin',
notionnext  |     cache: 'default',
notionnext  |     redirect: 'follow',
notionnext  |     integrity: '',
notionnext  |     keepalive: false,
notionnext  |     isReloadNavigation: false,
notionnext  |     isHistoryNavigation: false,
notionnext  |     signal: AbortSignal { aborted: false }
notionnext  |   },
notionnext  |   options: {
notionnext  |     mode: 'cors',
notionnext  |     hooks: {
notionnext  |       beforeRequest: [Array],
notionnext  |       beforeRetry: [],
notionnext  |       afterResponse: [],
notionnext  |       beforeError: []
notionnext  |     },
notionnext  |     json: {
notionnext  |       collection: [Object],
notionnext  |       collectionView: [Object],
notionnext  |       loader: [Object]
notionnext  |     },
notionnext  |     headers: Headers { 'content-type': 'application/json' },
notionnext  |     method: 'POST',
notionnext  |     prefixUrl: '',
notionnext  |     retry: {
notionnext  |       limit: 2,
notionnext  |       methods: [Array],
notionnext  |       statusCodes: [Array],
notionnext  |       afterStatusCodes: [Array],
notionnext  |       maxRetryAfter: Infinity,
notionnext  |       backoffLimit: Infinity,
notionnext  |       delay: [Function: delay]
notionnext  |     },
notionnext  |     throwHttpErrors: true,
notionnext  |     timeout: 10000,
notionnext  |     fetch: [Function: bound fetch],
notionnext  |     signal: AbortSignal { aborted: false },
notionnext  |     duplex: 'half',
notionnext  |     body: '{"collection":{"id":"2831ba6e-6fe2-81ab-a335-000bac4f7b7a"},"collectionView":{"id":"2831ba6e-6fe2-81da-8d6f-000cbe6f8a2a"},"loader":{"type":"reducer","reducers":{"board_columns":{"type":"groups","groupBy":{"sort":{"type":"manual"},"type":"select","property":"f211bdc0-ee00-4186-9a7d-f68c055ec2ee"},"groupSortPreference":[{"type":"select","value":"Draft"},{"type":"select","value":"Invisible"},{"type":"select","value":"Published"},{"type":"select"}],"limit":9999},"board:select:Draft":{"type":"aggregation","aggregation":{"aggregator":"count"},"filter":{"operator":"and","filters":[{"property":"f211bdc0-ee00-4186-9a7d-f68c055ec2ee","filter":{"operator":"enum_is","value":{"type":"exact","value":"Draft"}}}]}},"results:select:Draft":{"type":"results","limit":9999,"filter":{"operator":"and","filters":[{"property":"f211bdc0-ee00-4186-9a7d-f68c055ec2ee","filter":{"operator":"enum_is","value":{"type":"exact","value":"Draft"}}}]}},"board:select:Invisible":{"type":"aggregation","aggregation":{"aggregator":"count"},"filter":{"operator":"and","filters":[{"property":"f211bdc0-ee00-4186-9a7d-f68c055ec2ee","filter":{"operator":"enum_is","value":{"type":"exact","value":"Invisible"}}}]}},"results:select:Invisible":{"type":"results","limit":9999,"filter":{"operator":"and","filters":[{"property":"f211bdc0-ee00-4186-9a7d-f68c055ec2ee","filter":{"operator":"enum_is","value":{"type":"exact","value":"Invisible"}}}]}},"board:select:Published":{"type":"aggregation","aggregation":{"aggregator":"count"},"filter":{"operator":"and","filters":[{"property":"f211bdc0-ee00-4186-9a7d-f68c055ec2ee","filter":{"operator":"enum_is","value":{"type":"exact","value":"Published"}}}]}},"results:select:Published":{"type":"results","limit":9999,"filter":{"operator":"and","filters":[{"property":"f211bdc0-ee00-4186-9a7d-f68c055ec2ee","filter":{"operator":"enum_is","value":{"type":"exact","value":"Published"}}}]}},"board:select:uncategorized":{"type":"aggregation","aggregation":{"aggregator":"count"},"filter":{"operator":"and","filters":[{"property":"f211bdc0-ee00-4186-9a7d-f68c055ec2ee","filter":{"operator":"is_empty"}}]}},"results:select:uncategorized":{"type":"results","limit":9999,"filter":{"operator":"and","filters":[{"property":"f211bdc0-ee00-4186-9a7d-f68c055ec2ee","filter":{"operator":"is_empty"}}]}}},"searchQuery":"","userTimeZone":"UTC","filter":{"filters":[],"operator":"and"}}}'
notionnext  |   }
notionnext  | }

tianyn1990 avatar Oct 08 '25 04:10 tianyn1990

+1 我的nn博客是静态的 我通过github在vercel和阿里云都做了静态部署,今早上(当时我正在改样式)开始报错无法部署了,我以为是自己的问题调试了十几个版本,均报530,我又恢复了几次git,确认不是我代码的问题。

到了中午不见好,作为测试,我新申请了vercel+notion+github,首次部署就报530

——————

12:33:27.396 at async exportPages (/vercel/path0/node_modules/next/dist/export/routes/pages.js:84:28) 12:33:27.396 at async exportPageImpl (/vercel/path0/node_modules/next/dist/export/worker.js:206:16) 12:33:27.396 ✓ Generating static pages (33/33) 12:33:27.416 12:33:27.417

Export encountered errors on following paths: 12:33:27.417 /404: /zh-CN/404 12:33:27.417 /: /zh-CN 12:33:27.417 /[prefix]: /zh-CN/oops 12:33:27.417 /archive: /zh-CN/archive 12:33:27.417 /dashboard/[[...index]]: /zh-CN/dashboard 12:33:27.417 /dashboard/[[...index]]: /zh-CN/dashboard/affiliate 12:33:27.417 /dashboard/[[...index]]: /zh-CN/dashboard/balance 12:33:27.418 /dashboard/[[...index]]: /zh-CN/dashboard/membership 12:33:27.418 /dashboard/[[...index]]: /zh-CN/dashboard/order 12:33:27.420 /dashboard/[[...index]]: /zh-CN/dashboard/user-profile 12:33:27.425 /dashboard/[[...index]]: /zh-CN/dashboard/user-profile/security 12:33:27.425 /search/[keyword]: /zh-CN/search/NotionNext 12:33:27.425 /search: /zh-CN/search 12:33:27.504 error Command failed with exit code 1. 12:33:27.505 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 12:33:27.527 Error: Command "yarn run build" exited with 1

nwgale avatar Oct 08 '25 05:10 nwgale

同问 突然无法显示任何信息

huluwa2046 avatar Oct 08 '25 06:10 huluwa2046

+1

` HTTPError: Request failed with status code 530: POST https://www.notion.so/api/v3/queryCollection?src=initial_load

13:29:44.610 | at function_ (file:///opt/buildhome/repo/node_modules/ky/distribution/core/Ky.js:31:29) 13:29:44.610 | at process.processTicksAndRejections (node:internal/process/task_queues:105:5) 13:29:44.611 | at async NotionAPI.fetch (file:///opt/buildhome/repo/node_modules/notion-client/build/index.js:505:17) 13:29:44.611 | at async pMap.concurrency.concurrency (file:///opt/buildhome/repo/node_modules/notion-client/build/index.js:89:36) 13:29:44.611 | at async file:///opt/buildhome/repo/node_modules/p-map/index.js:121:20 { 13:29:44.611 | response: Response { 13:29:44.611 | status: 530, 13:29:44.611 | statusText: '', 13:29:44.611 | headers: Headers { 13:29:44.612 | date: 'Wed, 08 Oct 2025 05:29:44 GMT', 13:29:44.612 | 'content-type': 'text/html; charset=UTF-8', 13:29:44.612 | 'transfer-encoding': 'chunked', 13:29:44.613 | connection: 'keep-alive', 13:29:44.613 | 'cf-ray': '98b33e057e1da59a-SEA', 13:29:44.613 | 'cache-control': 'private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0', 13:29:44.613 | expires: 'Thu, 01 Jan 1970 00:00:01 GMT', 13:29:44.613 | 'strict-transport-security': 'max-age=31536000; includeSubDomains; preload', 13:29:44.613 | 'referrer-policy': 'same-origin', 13:29:44.614 | 'x-content-type-options': 'nosniff', 13:29:44.614 | 'x-frame-options': 'SAMEORIGIN',

`

joytofu avatar Oct 08 '25 07:10 joytofu

我也是啊 什么时候可以解决啊

LoveEcho1145 avatar Oct 08 '25 08:10 LoveEcho1145

追踪

limkkk1 avatar Oct 08 '25 10:10 limkkk1

follow

x0fun1 avatar Oct 08 '25 11:10 x0fun1

由于官方的 https://notion.so/api/v3 DNS解析异常,暂时等不了官方修复。

临时加了一个配置支持使用个性化api地址,相关提交与说明请访问:https://github.com/tangly1024/NotionNext/pull/3632 ; 大致改动是新增API_BASE_URL环境变量,并在/lib/notion/getNotionAPI.js中使用环境变量指定NotionClient的默认请求地址。

解决原理:

由于Notion官方域名API(https://www.notion.so/api/v3/queryCollection) 无法使用,请求均返回530错误,如下图: Image

解决方法:临时可以使用备用域名进行访问,待notion的dns网络恢复后可以无需再启用此配置。

修复逻辑:

新增API_BASE_URL环境变量,并在/lib/notion/getNotionAPI.js中使用环境变量指定NotionClient的默认请求地址。

使用方法:

在blog.config.js 中可以看到多了一行配置,需更新至最新版本代码后即可使用此配置。

若您的代码做了大量定制化,不便于更新代码,可以参考此次PR的文件改动记录进行自定义修改。

  API_BASE_URL: process.env.API_BASE_URL || 'https://www.notion.so/api/v3', // API默认请求地址 ,可配置成自己的 https://<xxxx>.notion.site/api/v3

如何获取自定义的url地址:

每个用户自己的notion共享到公网时,notion会分配一个独立域名,格式为:https://[your-company].notion.site/ 只需将您的notion页面链接复制到浏览器中打开,即可看到地址栏已自动跳转到个性链接地址。

image

理论上可以共用同一个新api地址,但为了避免接口网络拥堵,大家千万不要都用相同的个性域名。请各自获取自己的个性域名,作为api地址的前缀

将个性域名地址拼接成完成的api地址例如:http://xxxx.notion.site/api/v3,然后添加到NotionNext的环境变量API_BASE_URL中即可。(前提是升级到最新版本的NotionNext)


其它帮助请访问文档教程《配置自定义API_URL

另外可以关注react-notion-x 中的相关问题反馈:https://github.com/NotionX/react-notion-x/issues/669

tangly1024 avatar Oct 08 '25 11:10 tangly1024

由于官方的 https://notion.so/api/v3 DNS解析异常,暂时等不了官方修复。

临时加了一个配置API_BASE_URL,支持配置成其它api地址,相关提交与说明请访问:#3632 ; 或访问文档教程《配置自定义API_URL

另外可以关注react-notion-x 中的相关问题反馈:NotionX/react-notion-x#669

when I switch to the dedicated API URL I'm now running into a new problem: Notion API error: 403 Forbidden for https://xxx.notion.site/api/v3/syncRecordValues

ebinabo avatar Oct 08 '25 15:10 ebinabo

when I switch to the dedicated API URL I'm now running into a new problem: Notion API error: 403 Forbidden for https://xxx.notion.site/api/v3/syncRecordValues

It looks like you're encountering a 403 Forbiddenerror when using your custom API URL. This usually happens when the Notion collection you're trying to access isn’t set to ​​public​​.

tangly1024 avatar Oct 09 '25 04:10 tangly1024

由于官方的 https://notion.so/api/v3 DNS解析异常,暂时等不了官方修复。

临时加了一个配置支持使用个性化api地址,相关提交与说明请访问:#3632 ; 大致改动是新增API_BASE_URL环境变量,并在/lib/notion/getNotionAPI.js中使用环境变量指定NotionClient的默认请求地址。

解决原理:

由于Notion官方域名API(https://www.notion.so/api/v3/queryCollection) 无法使用,请求均返回530错误,如下图: Image

解决方法:临时可以使用备用域名进行访问,待notion的dns网络恢复后可以无需再启用此配置。

修复逻辑:

新增API_BASE_URL环境变量,并在/lib/notion/getNotionAPI.js中使用环境变量指定NotionClient的默认请求地址。

使用方法:

在blog.config.js 中可以看到多了一行配置,需更新至最新版本代码后即可使用此配置。

若您的代码做了大量定制化,不便于更新代码,可以参考此次PR的文件改动记录进行自定义修改。

  API_BASE_URL: process.env.API_BASE_URL || 'https://www.notion.so/api/v3', // API默认请求地址 ,可配置成自己的 https://<xxxx>.notion.site/api/v3

如何获取自定义的url地址:

每个用户自己的notion共享到公网时,notion会分配一个独立域名,格式为:https://[your-company].notion.site/ 只需将您的notion页面链接复制到浏览器中打开,即可看到地址栏已自动跳转到个性链接地址。

image 理论上可以共用同一个新api地址,但为了避免接口网络拥堵,大家千万**不要**都用相同的个性域名。请各自获取自己的个性域名,作为api地址的前缀

将个性域名地址拼接成完成的api地址例如:http://xxxx.notion.site/api/v3,然后添加到NotionNext的环境变量API_BASE_URL中即可。(前提是升级到最新版本的NotionNext)

其它帮助请访问文档教程《配置自定义API_URL

另外可以关注react-notion-x 中的相关问题反馈:NotionX/react-notion-x#669

按照这个步骤做完后显示 [API<<--异常]: HTTPError: Request failed with status code 404 Not Found: POST http://therapeutic-ner-b8a.notion.site/api/v3/loadPageChunk 依然无法部署成功,哪里有什么新的问题吗

CeeLav avatar Oct 11 '25 08:10 CeeLav