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的路径信息,只是自己没有留意或者在意,导致问题的根本原因未被及时发现。

总结此次教训,产生的原因是未仔细查看所有的日志,未仔细观察所有的现象和界面信息,太过于浮躁。

相关推荐
mzhan0172 分钟前
Linux: network: 拔插网线 interface down/up测试的痛点
linux·服务器·测试·破坏性测试
黑马金牌编程4 分钟前
如何判断一台服务器是否负载过高?
linux·运维·性能调优·性能分析·故障排查
小锋学长生活大爆炸5 分钟前
【知识】Linux将多条指令合并为一条执行
linux·运维·ubuntu
心灵宝贝3 小时前
CentOS 7 安装 bzip2-libs-1.0.6-13.el7.x86_64.rpm 的详细步骤
linux·运维·centos
mjx65304 小时前
windows查看端口使用情况,以及结束任务释放端口
linux
九皇叔叔5 小时前
Linux Shell 函数:从定义到实战,让脚本更高效
linux·运维·chrome·shell
璞致电子8 小时前
fpga开发板ZYNQ 璞致 PZ7010/7020 邮票孔核心板简介-ZYNQ7000系列小系统学习板
linux·嵌入式硬件·学习·fpga开发·fpga·fpga开发板·xilinx开发板
第四维度48 小时前
【全志V821_FoxPi】9-2 Linux IIC驱动MPU6050
linux·传感器·tina·mpu6050·v821
mjx65309 小时前
PyTorch快速入门
linux
DeeplyMind10 小时前
AMD KFD的BO设计分析系列6-1: VRAM BO的显存分配分析
linux·驱动开发·amdgpu·rocm·kfd