解决相关问题 Error occurred while writing image: ‘NoneType‘ object is not iterable: zun.common.exception

解决相关问题Error occurred while writing image: ‘NoneType’ object is not iterable: zun.common.exception.ZunException: Error occurred while writing image: ‘NoneType’ object is not iterable.


zun计算节点,错误日志类似如下:

2023-04-19 11:08:46.029 80205 ERROR zun.compute.manager [req-a87ba0f4-876a-4c88-b03b-133a4be8f815 171304d80cd049cc8d7ff813a6ba0793 6a91d7ed43284cc281c718451f269609 default - -] Unexpected exception: Error occurred while writing image: ‘NoneType’ object is not iterable: zun.common.exception.ZunException: Error occurred while writing image: ‘NoneType’ object is not iterable
2023-04-19 11:08:46.029 80205 ERROR zun.compute.manager Traceback (most recent call last):
2023-04-19 11:08:46.029 80205 ERROR zun.compute.manager File “/usr/local/lib/python3.6/site-packages/zun/image/glance/driver.py”, line 105, in pull_image
2023-04-19 11:08:46.029 80205 ERROR zun.compute.manager for chunk in image_chunks:
2023-04-19 11:08:46.029 80205 ERROR zun.compute.manager TypeError: ‘NoneType’ object is not iterable
2023-04-19 11:08:46.029 80205 ERROR zun.compute.manager
2023-04-19 11:08:46.029 80205 ERROR zun.compute.manager During handling of the above exception, another exception occurred:
2023-04-19 11:08:46.029 80205 ERROR zun.compute.manager
2023-04-19 11:08:46.029 80205 ERROR zun.compute.manager Traceback (most recent call last):
2023-04-19 11:08:46.029 80205 ERROR zun.compute.manager File “/usr/local/lib/python3.6/site-packages/zun/compute/manager.py”, line 302, in _do_container_create_base
2023-04-19 11:08:46.029 80205 ERROR zun.compute.manager registry=container.registry)
2023-04-19 11:08:46.029 80205 ERROR zun.compute.manager File “/usr/local/lib/python3.6/site-packages/zun/container/docker/driver.py”, line 191, in pull_image
2023-04-19 11:08:46.029 80205 ERROR zun.compute.manager context, repo, tag, image_pull_policy, registry)
2023-04-19 11:08:46.029 80205 ERROR zun.compute.manager File “/usr/local/lib/python3.6/site-packages/zun/image/glance/driver.py”, line 109, in pull_image
2023-04-19 11:08:46.029 80205 ERROR zun.compute.manager raise exception.ZunException(msg.format(e))
2023-04-19 11:08:46.029 80205 ERROR zun.compute.manager zun.common.exception.ZunException: Error occurred while writing image: ‘NoneType’ object is not iterable
2023-04-19 11:08:46.029 80205 ERROR zun.compute.manager


解决方法:

这种情况主要是由于 glance 保存的实际文件被删除了,但是glance 数据库中还保存有image信息,导致拉取的时候报错。

控制节点,查看镜像:

glance image-list

如果glance服务有问题,可以重启相关服务:

systemctl restart $(systemctl list-unit-files |grep -i glance | grep enabled | awk '{print $1}')

删除数据库中的image 信息:

 glance image-delete 329c4ee8-99d2-49c4-b015-b446ac64cf85

重新上传image到glance:

glance image-create --name portal11 --visibility public --disk-format raw --container-format docker --file portal.docker --progress

计算节点,查看docker服务是否正常:

systemctl status docker 

docker info

控制节点,如果相关的服务连接不上,可以到控制节点开放相关的端口策略:

iptables -I INPUT -p tcp --dport 9517 -j ACCEPT
iptables -I INPUT -p tcp --dport 8778 -j ACCEPT
iptables -I INPUT -p tcp --dport 2379 -j ACCEPT
iptables -I INPUT -p tcp --dport 2380 -j ACCEPT
iptables -I INPUT -p tcp --dport 5672 -j ACCEPT
iptables -I INPUT -p tcp --dport 6784 -j ACCEPT
iptables -I INPUT -p tcp --dport 11211 -j ACCEPT
iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
service iptables save
service iptables restart

关联新的image_id 到部署,重新进行测试,服务正常启动。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

代码讲故事

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值