遇到问题,首先通过现有的线索进行排查和尝试,如果简单的方法没法解决的时候,我们就需要通过一些特殊手段进行定位了。


背景

在某一次对mac系统升级并做了一些优化,删除了很多无用的软件,随后无法使用easyconnect 连接公司内网,操作时总是提示The times to init ECAgent


当时自己也没在意,以为是系统版本问题,之后也找公司IT协助排查,也没有查到具体原因。最后IT给的回复是,可能是系统版本问题,等官方出补丁,但是等了好久都没见官方补丁。由于最近可能要在家办公,所以不得不解决掉这个问题接入公司内网。

排查

在排查过程中我也是经历了由浅入深的一个过程,在此做个记录。

第一次排查-通过提示

根据easyconnect弹出的提示信息"初始化失败,请尝试重新安装!",我首先将软件卸载并清除所有本地数据后重新安装,发现还是提示相同的信息。

再将错误信息复制到百度中,发现最先出现的是Easyconnect “初始化失败,请尝试重新安装!”

当中的答案主要为安装官方的补丁,但是当我安装相应补丁后,还是一样的问题。后来又看到通过升级浏览器插件解决初始化失败请重新安装,按照提示操作后问题依旧,最终不得不放弃。

第二次排查-通过日志

尽管第一次排查无疾而终,但是在第一次排查中,有人贴出了easyconnect的运行日志,顿时想到能否通过日志来查看软件运行时的错误信息,最终在easyconnect 软件包路径/Applications/EasyConnect.app/Contents/Resources/logs下找到了日志如下

[2020-11-24 19:00:30] [INFO] [https_com]-The times to init ECAgent: 5
[2020-11-24 19:00:34] [INFO] [https_com]-testing port:54530
[2020-11-24 19:00:34] [INFO] [https_com]-GetRequest /ECAgent?op=InitECAgent
[2020-11-24 19:00:34] [WARNING] [https_com]-port:54530 cannot be accessed
[2020-11-24 19:00:34] [INFO] [https_com]-testing port:54541
[2020-11-24 19:00:34] [INFO] [https_com]-GetRequest /ECAgent?op=InitECAgent
[2020-11-24 19:00:34] [WARNING] [https_com]-port:54541 cannot be accessed
[2020-11-24 19:00:34] [INFO] [https_com]-testing port:54552
[2020-11-24 19:00:34] [INFO] [https_com]-GetRequest /ECAgent?op=InitECAgent
[2020-11-24 19:00:34] [WARNING] [https_com]-port:54552 cannot be accessed
[2020-11-24 19:00:34] [INFO] [https_com]-testing port:54563
[2020-11-24 19:00:34] [INFO] [https_com]-GetRequest /ECAgent?op=InitECAgent
[2020-11-24 19:00:34] [WARNING] [https_com]-port:54563 cannot be accessed
[2020-11-24 19:00:34] [INFO] [https_com]-testing port:54574
[2020-11-24 19:00:34] [INFO] [https_com]-GetRequest /ECAgent?op=InitECAgent
[2020-11-24 19:00:34] [WARNING] [https_com]-port:54574 cannot be accessed
[2020-11-24 19:00:34] [INFO] [https_com]-testing port:54585
[2020-11-24 19:00:34] [INFO] [https_com]-GetRequest /ECAgent?op=InitECAgent
[2020-11-24 19:00:34] [WARNING] [https_com]-port:54585 cannot be accessed
[2020-11-24 19:00:34] [INFO] [https_com]-testing port:54596
[2020-11-24 19:00:34] [INFO] [https_com]-GetRequest /ECAgent?op=InitECAgent
[2020-11-24 19:00:34] [WARNING] [https_com]-port:54596 cannot be accessed
[2020-11-24 19:00:34] [INFO] [https_com]-testing port:54607
[2020-11-24 19:00:34] [INFO] [https_com]-GetRequest /ECAgent?op=InitECAgent
[2020-11-24 19:00:34] [WARNING] [https_com]-port:54607 cannot be accessed
[2020-11-24 19:00:34] [INFO] [https_com]-testing port:54530
[2020-11-24 19:00:34] [INFO] [https_com]-GetRequest /ECAgent?op=InitECAgent
[2020-11-24 19:00:34] [WARNING] [https_com]-port:54530 cannot be accessed
[2020-11-24 19:00:34] [ERROR] [https_com]-no port accessed
[2020-11-24 19:00:34] [INFO] [https_com_controller]-Received ec_event: https_init_error

通过关键信息[ERROR] [https_com]-no port accessed通过谷歌查到一篇帖子mac 10.15.6 一直报 初始化失败请重新下载,并在评论中看到有用户提到是腾讯柠檬清理禁用开机自启动的问题,

最后根据这个提示开启了与深信服相关的两个自启动项com.sangfor.EasyMonitor.plistcom.sangfor.ECAgentProxy.plist,重新打开easyconnect 后问题解决!

总结

下面做个简单的总结

  • 尽量用google,将相同的信息复制到百度和google中,所查询出信息的可用性总是google>百度
  • 在定位问题的时候,学会用日志去检索或者排查,可能会达到事倍功半的效果
03-05 21:05