VPS部署失败,显示 RequestError
描述bug
腾讯云vps部署失败,执行yarn build命令显示 Collecting page data .[API<<--异常]: RequestError,错误代码 code: 'ETIMEDOUT', 重试三次后显示 can`t get Notion Data ,每次请求返回的速度很快,不到1秒钟。
# yarn build
yarn run v1.22.22
$ next build
▲ Next.js 14.2.4
- Environments: .env.local
- Experiments (use with caution):
· scrollRestoration
Skipping linting
✓ Checking validity of types
Creating an optimized production build ...
[默认主题] /root/tst/NotionNext/themes/simple
Browserslist: caniuse-lite is outdated. Please run:
npx update-browserslist-db@latest
Why you should do it regularly: https://github.com/browserslist/update-db#readme
✓ Compiled successfully
Collecting page data .[Fetching Data] 127e8e213ac1801481d9dc6571746ef8 category-paths
[API-->>请求] from:category-paths id:127e8e213ac1801481d9dc6571746ef8
Collecting page data ...[API<<--异常]: RequestError
at ClientRequest.<anonymous> (/root/tst/NotionNext/node_modules/got/dist/source/core/index.js:970:111)
at Object.onceWrapper (node:events:634:26)
at ClientRequest.emit (node:events:531:35)
at origin.emit (/root/tst/NotionNext/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20)
at emitErrorEvent (node:_http_client:108:11)
at TLSSocket.socketErrorListener (node:_http_client:511:5)
at TLSSocket.emit (node:events:519:28)
at emitErrorNT (node:internal/streams/destroy:169:8)
at emitErrorCloseNT (node:internal/streams/destroy:128:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)AggregateError [ETIMEDOUT]:
at internalConnectMultiple (node:net:1118:18)
at internalConnectMultiple (node:net:1186:5)
at Timeout.internalConnectMultipleTimeout (node:net:1712:5)
at listOnTimeout (node:internal/timers:583:11)
at process.processTimers (node:internal/timers:519:7) {
code: 'ETIMEDOUT',
timings: {
start: 1729612428839,
socket: 1729612428842,
lookup: 1729612429219,
connect: undefined,
secureConnect: undefined,
upload: undefined,
response: undefined,
end: undefined,
error: 1729612429722,
abort: undefined,
phases: {
wait: 3,
dns: 377,
tcp: undefined,
tls: undefined,
request: undefined,
firstByte: undefined,
download: undefined,
total: 883
}
}
}
Collecting page data ..[API-->>请求] from:category-paths id:127e8e213ac1801481d9dc6571746ef8 剩余重试次数:2
Collecting page data .[API<<--异常]: RequestError
at ClientRequest.<anonymous> (/root/tst/NotionNext/node_modules/got/dist/source/core/index.js:970:111)
at Object.onceWrapper (node:events:634:26)
at ClientRequest.emit (node:events:531:35)
at origin.emit (/root/tst/NotionNext/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20)
at emitErrorEvent (node:_http_client:108:11)
at TLSSocket.socketErrorListener (node:_http_client:511:5)
at TLSSocket.emit (node:events:519:28)
at emitErrorNT (node:internal/streams/destroy:169:8)
at emitErrorCloseNT (node:internal/streams/destroy:128:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)AggregateError [ETIMEDOUT]:
at internalConnectMultiple (node:net:1118:18)
at internalConnectMultiple (node:net:1186:5)
at Timeout.internalConnectMultipleTimeout (node:net:1712:5)
at listOnTimeout (node:internal/timers:583:11)
at process.processTimers (node:internal/timers:519:7) {
code: 'ETIMEDOUT',
timings: {
start: 1729612430729,
socket: 1729612430729,
lookup: 1729612430730,
connect: undefined,
secureConnect: undefined,
upload: undefined,
response: undefined,
end: undefined,
error: 1729612431232,
abort: undefined,
phases: {
wait: 0,
dns: 1,
tcp: undefined,
tls: undefined,
request: undefined,
firstByte: undefined,
download: undefined,
total: 503
}
}
}
Collecting page data ...[API-->>请求] from:category-paths id:127e8e213ac1801481d9dc6571746ef8 剩余重试次数:1
Collecting page data ...[API<<--异常]: RequestError
at ClientRequest.<anonymous> (/root/tst/NotionNext/node_modules/got/dist/source/core/index.js:970:111)
at Object.onceWrapper (node:events:634:26)
at ClientRequest.emit (node:events:531:35)
at origin.emit (/root/tst/NotionNext/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20)
at emitErrorEvent (node:_http_client:108:11)
at TLSSocket.socketErrorListener (node:_http_client:511:5)
at TLSSocket.emit (node:events:519:28)
at emitErrorNT (node:internal/streams/destroy:169:8)
at emitErrorCloseNT (node:internal/streams/destroy:128:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)AggregateError [ETIMEDOUT]:
at internalConnectMultiple (node:net:1118:18)
at internalConnectMultiple (node:net:1186:5)
at Timeout.internalConnectMultipleTimeout (node:net:1712:5)
at listOnTimeout (node:internal/timers:583:11)
at process.processTimers (node:internal/timers:519:7) {
code: 'ETIMEDOUT',
timings: {
start: 1729612432235,
socket: 1729612432235,
lookup: 1729612432236,
connect: undefined,
secureConnect: undefined,
upload: undefined,
response: undefined,
end: undefined,
error: 1729612432738,
abort: undefined,
phases: {
wait: 0,
dns: 1,
tcp: undefined,
tls: undefined,
request: undefined,
firstByte: undefined,
download: undefined,
total: 503
}
}
}
Collecting page data ..[请求失败]: from:category-paths id:127e8e213ac1801481d9dc6571746ef8
can`t get Notion Data ; Which id is: 127e8e213ac1801481d9dc6571746ef8
Invalid input: allPages and tagOptions should be arrays.
Invalid input: allPages and tagOptions should be arrays.
Invalid input: allPages and tagOptions should be arrays.
TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at g (/root/tst/NotionNext/.next/server/pages/category/[category].js:1:2123)
at async buildStaticPaths (/root/tst/NotionNext/node_modules/next/dist/build/utils.js:788:33)
at async /root/tst/NotionNext/node_modules/next/dist/build/utils.js:1220:110
at async Span.traceAsyncFn (/root/tst/NotionNext/node_modules/next/dist/trace/trace.js:154:20)
> Build error occurred
Error: Failed to collect page data for /category/[category]
at /root/tst/NotionNext/node_modules/next/dist/build/utils.js:1268:15 {
type: 'Error'
}
error Command failed with exit code 1.
期望的正常结果 在这台服务器上第一次部署成功了,后来修改了一些配置后还部署成功两次,然后某一次开始就部署失败,日志显示的都是跟上面类似。
复现步骤 我的模板id:127e8e213ac1801481d9dc6571746ef8 (原版从官方文档复制,未做任何修改)
环境
- 【必填】NotionNext版本:4.7.5
- 【必填】主题:默认的 simple
- 【必填】部署方案:腾讯云VPS
我将目前用的 node 20.17 版本换成 18.20.4 ,这个错误就消失了。🤣
服务器部署的是教程很久没更新了也是,前段时间我就我们 20.18.0 好像是没有成功,放弃了。 你的博客地址是什么?我感受一下服务器部署的效果
大佬出个宝塔部署的视频吧求求啦
如果你的VPS地址不是在国外,可能要设置代理
https://www.xxww.space/article/VPS-NotionNext 可以看看我的部署教程
如果你的VPS地址不是在国外,可能要设置代理
补充jenkins的自动化部署 https://cf-blog.zabanya.space/article/b3be3366-025a-422e-89b9-0b0ad804b6d6