RHEL8补丁后Node.js Puppeteer.launch()超时挂起问题求助
RHEL8补丁更新后Puppeteer.launch()挂起超时问题
完成RHEL8补丁更新后,生产服务器出现Node.js中puppeteer.launch()挂起并超时的问题,其他同补丁版本的环境可正常运行。
环境详情
- RHEL系统版本:
4.18.0-553.40.1.el8_10.x86_64 - Node版本:
v20.18.2 - npm版本:
10.8.2 - Puppeteer版本:
24.4.0 - Chrome版本:
linux-134.0.6998.165
该问题在RHEL版本升级前完全不存在,所有环境均执行了相同的升级操作,但仅生产环境出现故障。
报错信息
TimeoutError: Timed out after 30000 ms while waiting for the WS endpoint URL to appear in stdout!
at ChromeLauncher.launch
测试代码片段(test.js)
const puppeteer = require('puppeteer'); async function run() { console.log("Output -- > "); const browser = await puppeteer.launch({ headless: true }) console.log("The brower is:", browser); try{ console.log("Output -- > "); let page = await browser.newPage() // let response=await page.goto('https://URL'); console.log("Output -- > "); let response=await page.goto('https://URL'); console.log("Output -- > "+JSON.stringify(response)); } catch (err) { console.log(err); } finally { let pages = await browser.pages(); await Promise.all(pages.map(page => page.close())); await browser.close(); process.exit(); } }
环境差异表现
正常环境会打印如下浏览器日志:
The brower is: CdpBrowser { protocol: 'cdp' }
故障环境在launch方法处挂起,无法输出上述日志。
恳请相关专家帮忙排查并提供解决方案。
内容的提问来源于stack exchange,提问作者Rakesh Pinnoju
相关产品推荐
相关产品推荐

