alibaba / anyproxy

A fully configurable http/https proxy in NodeJS
http://anyproxy.io
Apache License 2.0
7.86k stars 1.23k forks source link

Cannot read property 'displayName' of undefined #107

Closed yangg closed 7 years ago

yangg commented 7 years ago

Plese fill the template when you reporting a new issue, thanks!

Which platform are you running AnyProxy

Windows

The version of the AnyProxy

3.10.3

Your expected behavior of AnyProxy

不异常退出

The actual behavior of AnyProxy

异常退出了

The log of the error

==>will forward to real server by proxy
E:\web\...\node_modules\anyproxy\proxy.js:225
                    logUtil.printLog('Caught exception: ' + (err.stack || err), logUtil.T_ERR);
                                                                ^

TypeError: Cannot read property 'displayName' of undefined
yangg commented 7 years ago

好像是因为请求的url太长了

codingfishman commented 7 years ago

Hi @yangg 是访问公网上的一个资源吗? 如果是的话可否告知我们URL。 另外,log中的225行,是不是出错的异常提示出来的? 因为这一行应该还是在刚启动的阶段,可否提异常的上下文。

谢谢!

yangg commented 7 years ago

是uncaughtException那里,启动了好久了,某个请求会挂

224                 process.on("uncaughtException",function(err){
225                     console.log(err)
226                     process.exit();
227                 });

225 改成console后,报错变成 下面的了, 下面有url,但是支持复制了到浏览器里并不能重现。

received request to : s7-im-notify.csdn.net/socket.io/1/xhr-polling/MlZ8Tz4EwFeWGByxlIOI?t=1480671190029
==>will forward to real server by proxy
err when connect to + clients1.google.com , Error: connect ETIMEDOUT 74.125.23.101:443
err when connect to + clients1.google.com , Error: connect ETIMEDOUT 74.125.23.101:443
err when connect to + clients1.google.com , Error: connect ETIMEDOUT 74.125.23.101:443

received request to : appstore.vivo.com.cn/appinfo/
==>will forward to real server by proxy
util.js:630
  return value.stack || '[' + Error.prototype.toString.call(value) + ']';
              ^

TypeError: Cannot read property 'displayName' of undefined

另一个


received request to : appstore.vivo.com.cn/appinfo/downloadApkFile?id=47892&vlow=442&vup=451&v_d_s_f=yes&app_version=1011&imei=862979030661211&model=vivo+X7&elapsedtime=392890328&cs=0&av=22&an=5.1.1&u=150100434a4e423452076b5c4b6d8300&nt=WIFI&patch=451_442&target=local&cfrom=164&related=-1&update=-1&source=1&s=2%7C2184471193
==>will forward to real server by proxy
util.js:630
  return value.stack || '[' + Error.prototype.toString.call(value) + ']';
              ^

TypeError: Cannot read property 'displayName' of undefined
yangg commented 7 years ago

求解决,用Android的oppo 和 vivo 经常会出现

yangg commented 7 years ago

4.0.0-beta5 这个问题还是存在

util.js:630
  return value.stack || '[' + Error.prototype.toString.call(value) + ']';
              ^

TypeError: Cannot read property 'displayName' of undefined
ottomao commented 7 years ago

我再确认下:这个报错是报在命令行里,然后AnyProxy挂掉了?还是浏览器的console里?

On Sat, Mar 25, 2017 at 12:43 PM, Brook notifications@github.com wrote:

4.0.0-beta5 这个问题还是存在

util.js:630 return value.stack || '[' + Error.prototype.toString.call(value) + ']'; ^

TypeError: Cannot read property 'displayName' of undefined

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/alibaba/anyproxy/issues/107#issuecomment-289188646, or mute the thread https://github.com/notifications/unsubscribe-auth/ABjCqTd5YxjzA8sYNrKlJ2FJnSCTxiNWks5rpJtggaJpZM4K_4Ui .

-- Mao Xiaofeng(茅晓锋) Tel:(86) 15801916167 Email:ottomao@gmail.com

ottomao commented 7 years ago

有更详细的错误栈么?再多截一些出来?

ottomao commented 7 years ago

很奇怪,这像是react的报错,但AnyProxy服务端又没跑react的代码,不应该会有这种场景才对...

yangg commented 7 years ago

一直都没有位置,我也看起来像是react,以为是Webinterface导致的呢 前两天发现错误了,是因为自定义rule,require了weinre的,但是没run都会报错。 去掉之后,这两天没有报错了。 感谢回复

yangg commented 7 years ago

@ottomao 另外前两天用4.x时,我用 requestOptions.hostname = proxyHost 把内网的几个域名指到本地开发,可是有个登录页面登录成功后刷新又到登录页了,感觉像是cookie丢了的问题,不知道你们有遇到过没 只好回退到了正式版了

codingfishman commented 7 years ago

@yangg 是不是两次请求的session cookie不一样导致session丢失?第一次登录时的session cookie和第二次登录时是同一个吗?

更新: 初步重现

ottomao commented 7 years ago

update: cookie的问题修了,在 4.0.0@beta8 版本。

再次感谢反馈!