docmirror/dev-sidecar · warning
远程 pac.txt 文件下载失败或还在下载中,现使用内置 pac.txt 文件:
Error message
远程 pac.txt 文件下载失败或还在下载中,现使用内置 pac.txt 文件:
What it means
When the overwall (over-the-wall) plugin's pac option is enabled, the library prefers an already-downloaded remote pac.txt. If no downloaded file exists yet (autoUpdate download is async, in progress, or failed), it falls back to the pac.txt bundled in the installation rootDir and logs this warning. Proxying still works, but rules come from the potentially outdated built-in file rather than the freshly downloaded one.
Source
Thrown at packages/mitmproxy/src/options.js:104
// 自动更新 pac.txt
if (!pacConfig.pacFileAbsolutePath && pacConfig.autoUpdate) {
// 异步下载远程 pac.txt 文件,并保存到本地;下载成功后,需要重启代理服务才会生效
downloadPacAsync(pacConfig)
}
// 优先使用本地已下载的 pac.txt 文件
if (!pacConfig.pacFileAbsolutePath && fs.existsSync(getTmpPacFilePath())) {
pacConfig.pacFileAbsolutePath = getTmpPacFilePath()
log.info('读取已下载的 pac.txt 文件:', pacConfig.pacFileAbsolutePath)
}
if (!pacConfig.pacFileAbsolutePath) {
log.info('setting.rootDir:', setting.rootDir)
pacConfig.pacFileAbsolutePath = path.join(setting.rootDir, pacConfig.pacFilePath)
log.info('读取内置的 pac.txt 文件:', pacConfig.pacFileAbsolutePath)
if (pacConfig.autoUpdate) {
log.warn('远程 pac.txt 文件下载失败或还在下载中,现使用内置 pac.txt 文件:', pacConfig.pacFileAbsolutePath)
}
}
}
// 插件列表
const middlewares = []
// 梯子插件:如果启用了,则添加到插件列表中
const overwallMiddleware = createOverwallMiddleware(overWallConfig)
if (overwallMiddleware) {
middlewares.push(overwallMiddleware)
}
const preSetIpList = matchUtil.domainMapRegexply(serverConfig.preSetIpList)
const options = {
host: serverConfig.host,
port: serverConfig.port,View on GitHub (pinned to 7710cd56cc)
Solutions
- Wait for the async download to finish and restart the proxy service — the downloaded file is only picked up at startup.
- Check network reachability of the remote pac URL (configure a working proxy or DNS for it if it is blocked).
- Manually place a valid pac.txt at the expected temp path (getTmpPacFilePath) so it is picked up on next startup.
- Keep using the built-in pac.txt (it is a valid fallback) and verify update behavior in logs; disable autoUpdate if the remote source is permanently unavailable.
- Update to a newer dev-sidecar version if the remote pac URL in your version is stale.
Example fix
// before (config expects remote pac but none downloaded yet)
{
"plugin": { "overwall": { "pac": { "enabled": true, "autoUpdate": true } } }
}
// after (first run: download completes, then restart; or supply the file explicitly)
{
"plugin": { "overwall": { "pac": { "enabled": true, "autoUpdate": true, "pacFileAbsolutePath": "/home/user/dev-sidecar/pac.txt" } } }
} Defensive patterns
Strategy: fallback
Validate before calling
const fs = require('node:fs')
function isPacReady (pacConfig) {
return Boolean(pacConfig.pacFileAbsolutePath) || fs.existsSync(pacTmpPath)
}
if (!isPacReady(pacConfig)) {
console.warn('remote pac.txt not downloaded yet; built-in pac.txt will be used')
} Type guard
function hasDownloadedPac (pacConfig, tmpPath, fs) {
return typeof pacConfig.pacFileAbsolutePath === 'string' || (typeof tmpPath === 'string' && fs.existsSync(tmpPath))
} Try / catch
try {
await downloadPacAsync(pacConfig) // or wait for the completion event before starting the server
} catch (e) {
log.warn(`remote pac.txt download failed (${e.message}); proceeding with built-in pac.txt`)
} Prevention
- After enabling pac autoUpdate, restart the proxy once after the download completes rather than immediately.
- Ensure the remote pac URL is reachable from your network (firewall/DNS/proxy settings) and monitor the download log.
- Optionally set pacFileAbsolutePath explicitly to a maintained local copy to remove dependence on the remote source.
- Periodically verify the pac file in use is current; the built-in fallback may be outdated.
When it happens
Trigger: Enabling `plugin.overwall.pac.enabled: true` with `autoUpdate: true` while no previously downloaded pac exists (first run, or the temp pac file was cleared) and downloadPacAsync has not completed — e.g. slow or blocked network to the remote pac URL — so getTmpPacFilePath() does not exist when options are built.
Common situations: First launch after enabling the overwall plugin; machine behind a firewall/proxy that cannot reach the remote pac URL; pac auto-update endpoint changed or deprecated; restarting the service immediately after enabling autoUpdate before the async download finishes.
Related errors
- 下载远程 pac.txt 文件成功,但内容为空或内容太短,判断为无效的 pax.txt 文件:
- [speed] test error: ${this.hostname} ➜ ${item.host}:${this
- [speed] test by TCP error:
- 下载远程配置成功,但内容为空:
- 下载远程 domestic-domain-allowlist.txt 文件成功,但内容为空或内容太短,判断为无效的 do
AI-assisted analysis of docmirror/dev-sidecar@7710cd56cc (2026-08-31).
Data as JSON: /api/errors/a2f853c9afb61344.
Report an issue: GitHub.