当前位置: 首页 > news >正文

CORE Mobility Errorr的调试

在运行CORE tutorial 3中的mobility示例时,出现如下错误:
在这里插入图片描述
当看到这个问题的时候,并没有仔细去分析日志和现象,在core-daemon的进程打印界面只看了一下最后的出错堆栈:

2024-06-27 10:43:48,614 - ERROR - _server:_call_behavior - Exception calling application: int() argument must be a string, a bytes-like object or a real number, not ‘NoneType’
Traceback (most recent call last):
File “/opt/core/venv/lib/python3.10/site-packages/grpc/_server.py”, line 494, in _call_behavior
response_or_iterator = behavior(argument, context)
File “/opt/core/venv/lib/python3.10/site-packages/core/api/grpc/server.py”, line 916, in MobilityAction
node.mobility.stop(move_initial=True)
File “/opt/core/venv/lib/python3.10/site-packages/core/location/mobility.py”, line 1095, in stop
super().stop(move_initial=move_initial)
File “/opt/core/venv/lib/python3.10/site-packages/core/location/mobility.py”, line 839, in stop
self.session.mobility.sendevent(self)
File “/opt/core/venv/lib/python3.10/site-packages/core/location/mobility.py”, line 209, in sendevent
end_time = int(model.endtime)
TypeError: int() argument must be a string, a bytes-like object or a real number, not ‘NoneType’

然而,从这里很难看出什么问题。在网上各种搜索关键字也是毫无收获。还怀疑是python3.10的版本问题,准备退回python3.9再试试。最后都是无劳而返。
偶然又留意了一下core-daemon最开始出错的打印,才发现如下日志:

2024-06-27 10:42:13,978 - INFO - mobility:update_config - ns-2 scripted mobility configured for WLAN 3 using file: /usr/share/core/examples/tutorials/tutorial3/movements1.txt
2024-06-27 10:42:13,979 - ERROR - mobility:startup - mobility startup error
Traceback (most recent call last):
File “/opt/core/venv/lib/python3.10/site-packages/core/location/mobility.py”, line 136, in startup
self.set_model(node, model, config)
File “/opt/core/venv/lib/python3.10/site-packages/core/config.py”, line 360, in set_model
node.setmodel(model_class, config)
File “/opt/core/venv/lib/python3.10/site-packages/core/nodes/network.py”, line 754, in setmodel
self.mobility.update_config(config)
File “/opt/core/venv/lib/python3.10/site-packages/core/location/mobility.py”, line 904, in update_config
self.readscriptfile()
File “/opt/core/venv/lib/python3.10/site-packages/core/location/mobility.py”, line 916, in readscriptfile
file_path = self.findfile(self.file)
File “/opt/core/venv/lib/python3.10/site-packages/core/location/mobility.py”, line 998, in findfile
raise CoreError(f"invalid file: {file_path}")
core.errors.CoreError: invalid file: /usr/share/core/examples/tutorials/tutorial3/movements1.txt

原来这一段才是出错的根本原因。而且在日志中的原因也说明非常明白:movements1.txt有问题。我检查了一下,原因是我的系统对应路径不存在这个文件。于是重新修改了一下此文件对应的路径,可以顺利运行此示例程序了。
现在在回头看这个问题出现时的现象,在wlan3 mobility player这个窗口上也显示了movements1.txt的路径信息,只是自己没有留意或者在意,导致问题的根本原因未被及时发现。
总结此次教训,产生的原因是未仔细查看所有的日志,未仔细观察所有的现象和界面信息,太过于浮躁。

http://www.lryc.cn/news/385521.html

相关文章:

  • 基于weixin小程序乡村旅游系统的设计
  • 详解三种常用标准化 Batch Norm Layer Norm RMSNorm
  • 云计算运维工程师面试
  • 聚观早报 | iPhone 16核心硬件曝光;三星Galaxy全球新品发布会
  • web前端之文档流、浮动、定位详解
  • [JS]节点操作
  • 基于SpringBoot+Vue的论坛网站系统(带1w+文档)
  • 03逻辑门电路
  • 2毛钱的SOT23-5封装28V、1.5A、1.2MHz DCDC转换器用于LCD偏置电源和白光LED驱动等MT3540升压芯片
  • Zookeeper部署
  • 2.x86游戏实战-跨进程读取血量
  • element-plus 日期选择添加确定按钮
  • Redis优化之持久化
  • ubuntu22.04 编译安装libcurl C++ library
  • js函数闭包解析
  • 查看Oracle、MySQL、PostGreSQL中的依赖关系
  • 多线程(基础)
  • BUG cn.bing.com 重定向的次数过多,无法搜索内容
  • 【数据科学】学习资源汇总(不定时更新)
  • 完美解决ValueError: column index (256) not an int in range(256)的正确解决方法,亲测有效!!!
  • # 音频处理4_傅里叶变换
  • 提升网络速度的几种有效方法
  • @PathVariable注解的使用及源码解析
  • 服务器配置重点看哪些参数
  • WSL Ubuntu 如何设置中文语言?
  • 「51媒体」政企活动媒体宣发如何做?
  • K近邻回归原理详解及Python代码示例
  • idea 开发工具properties文件中的中文不显示
  • 让DroidVNC-NG支持中文输入
  • android dialog 显示时 activity 是否会执行 onPause onStop