Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

异常弹窗报告 #2 #668

Closed
finalwhy opened this issue May 26, 2020 · 4 comments · Fixed by #674
Closed

异常弹窗报告 #2 #668

finalwhy opened this issue May 26, 2020 · 4 comments · Fixed by #674

Comments

@finalwhy
Copy link

finalwhy commented May 26, 2020

错误描述
新的异常弹窗,警告内容为 "cb is not a function" (关闭的时候忘了截图了),看了日志报告应该是调用SAX接口解析xml的时候出错了。

环境:

  • window: [e.g. macOS, Windows, Linux]
  • Version: Windows10 2004
  • Motrix Version: v1.5.13
  • Installation package type: exe

应用日志

[2020-05-26 12:21:27.414] [error] TypeError: cb is not a function
at C:\Program Files\Motrix\resources\app.asar\node_modules\nat-api\index.js:336:7
at C:\Program Files\Motrix\resources\app.asar\node_modules\nat-api\lib\upnp\device.js:61:11
at Parser. (C:\Program Files\Motrix\resources\app.asar\node_modules\xml2js\lib\xml2js.js:199:18)
at Parser.emit (events.js:210:5)
at SAXParser.saxParser.onclosetag (C:\Program Files\Motrix\resources\app.asar\node_modules\xml2js\lib\xml2js.js:183:24)
at emit (C:\Program Files\Motrix\resources\app.asar\node_modules\sax\lib\sax.js:624:35)
at emitNode (C:\Program Files\Motrix\resources\app.asar\node_modules\sax\lib\sax.js:629:5)
at closeTag (C:\Program Files\Motrix\resources\app.asar\node_modules\sax\lib\sax.js:889:7)
at SAXParser.write (C:\Program Files\Motrix\resources\app.asar\node_modules\sax\lib\sax.js:1436:13)
at Parser.exports.Parser.Parser.parseString (C:\Program Files\Motrix\resources\app.asar\node_modules\xml2js\lib\xml2js.js:211:31)
[2020-05-26 13:13:58.922] [error] [Motrix] Uncaught exception: cb is not a function
[2020-05-26 13:13:58.923] [error] TypeError: cb is not a function
at C:\Program Files\Motrix\resources\app.asar\node_modules\nat-api\index.js:336:7
at C:\Program Files\Motrix\resources\app.asar\node_modules\nat-api\lib\upnp\device.js:61:11
at Parser. (C:\Program Files\Motrix\resources\app.asar\node_modules\xml2js\lib\xml2js.js:199:18)
at Parser.emit (events.js:210:5)
at SAXParser.saxParser.onclosetag (C:\Program Files\Motrix\resources\app.asar\node_modules\xml2js\lib\xml2js.js:183:24)
at emit (C:\Program Files\Motrix\resources\app.asar\node_modules\sax\lib\sax.js:624:35)
at emitNode (C:\Program Files\Motrix\resources\app.asar\node_modules\sax\lib\sax.js:629:5)
at closeTag (C:\Program Files\Motrix\resources\app.asar\node_modules\sax\lib\sax.js:889:7)
at SAXParser.write (C:\Program Files\Motrix\resources\app.asar\node_modules\sax\lib\sax.js:1436:13)
at Parser.exports.Parser.Parser.parseString (C:\Program Files\Motrix\resources\app.asar\node_modules\xml2js\lib\xml2js.js:211:31)
[2020-05-26 13:13:59.542] [error] [Motrix] Uncaught exception: cb is not a function
[2020-05-26 13:13:59.543] [error] TypeError: cb is not a function
at C:\Program Files\Motrix\resources\app.asar\node_modules\nat-api\index.js:336:7
at C:\Program Files\Motrix\resources\app.asar\node_modules\nat-api\lib\upnp\device.js:61:11
at Parser. (C:\Program Files\Motrix\resources\app.asar\node_modules\xml2js\lib\xml2js.js:199:18)
at Parser.emit (events.js:210:5)
at SAXParser.saxParser.onclosetag (C:\Program Files\Motrix\resources\app.asar\node_modules\xml2js\lib\xml2js.js:183:24)
at emit (C:\Program Files\Motrix\resources\app.asar\node_modules\sax\lib\sax.js:624:35)
at emitNode (C:\Program Files\Motrix\resources\app.asar\node_modules\sax\lib\sax.js:629:5)
at closeTag (C:\Program Files\Motrix\resources\app.asar\node_modules\sax\lib\sax.js:889:7)
at SAXParser.write (C:\Program Files\Motrix\resources\app.asar\node_modules\sax\lib\sax.js:1436:13)
at Parser.exports.Parser.Parser.parseString (C:\Program Files\Motrix\resources\app.asar\node_modules\xml2js\lib\xml2js.js:211:31)
[2020-05-26 13:13:59.991] [error] [Motrix] Uncaught exception: cb is not a function
[2020-05-26 13:13:59.994] [error] TypeError: cb is not a function
at C:\Program Files\Motrix\resources\app.asar\node_modules\nat-api\index.js:336:7
at C:\Program Files\Motrix\resources\app.asar\node_modules\nat-api\lib\upnp\device.js:61:11
at Parser. (C:\Program Files\Motrix\resources\app.asar\node_modules\xml2js\lib\xml2js.js:199:18)
at Parser.emit (events.js:210:5)
at SAXParser.saxParser.onclosetag (C:\Program Files\Motrix\resources\app.asar\node_modules\xml2js\lib\xml2js.js:183:24)
at emit (C:\Program Files\Motrix\resources\app.asar\node_modules\sax\lib\sax.js:624:35)
at emitNode (C:\Program Files\Motrix\resources\app.asar\node_modules\sax\lib\sax.js:629:5)
at closeTag (C:\Program Files\Motrix\resources\app.asar\node_modules\sax\lib\sax.js:889:7)
at SAXParser.write (C:\Program Files\Motrix\resources\app.asar\node_modules\sax\lib\sax.js:1436:13)
at Parser.exports.Parser.Parser.parseString (C:\Program Files\Motrix\resources\app.asar\node_modules\xml2js\lib\xml2js.js:211:31)

@agalwood
Copy link
Owner

agalwood commented May 26, 2020

你的路由器我不清楚为什么用这个 nat-api 库启用不了 UPnP,你还是把这个功能功能关了,手动路由器映射吧

我测试了两个路由器,Apple Time Capsule「不支持UPnP」 + ASUS GT-AC5300「支持UPnP」,都没出现你这报错 : |

@finalwhy finalwhy changed the title 异常弹窗报告 # 异常弹窗报告 #2 May 26, 2020
@finalwhy
Copy link
Author

哦,好的,看来我该换路由了,是有点老了 : |

@agalwood
Copy link
Owner

agalwood commented May 28, 2020

你的问题我复现了,端口 mapping 时没报错且需要等1小时50分钟才会出现 : (
上次的修复 nat-api 抛异常时看到它支持 autoUpdate,就启用了它,结果这个功能有 bug

fork 了一份 nat-api,先修复了

// TTL is 2 hours (min 20 min)
this.ttl = (opts.ttl) ? Math.max(opts.ttl, 1200) : 7200

https://github.com/alxhotel/nat-api/blob/8f78f25d7d5dc2d375efb918661936afeb73c1a4/index.js#L17

if (self.autoUpdate) {
  self._upnpIntervals[opts.publicPort + ':' + opts.privatePort + '-' + opts.protocol] = setInterval(
    self._upnpMap.bind(self, opts),
    self._timeout
  )
}

https://github.com/alxhotel/nat-api/blob/8f78f25d7d5dc2d375efb918661936afeb73c1a4/index.js#L327

@finalwhy
Copy link
Author

看到回复了,作者辛苦!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants