记录下kolla-build镜像时,遇到的一些问题,既为了方便自己以后问题的查找,也为了帮助别人避免踩这些坑。遇到的问题会持续更新在博客里面。

问题1:使用的kolla 版本是ocata版本,本地已经搭建好yum源,并且在以前制作镜像的时候,一直是好的,今天再次编译镜像,一直报如下的错误

INFO:kolla.image.build.base:---> Package pciutils-libs.x86_64 0:3.5.1-3.el7 will be installed
INFO:kolla.image.build.base:---> Package perl-HTTP-Tiny.noarch 0:0.033-3.el7 will be installed
INFO:kolla.image.build.base:---> Package perl-parent.noarch 1:0.225-244.el7 will be installed
INFO:kolla.image.build.base:---> Package sysvinit-tools.x86_64 0:2.88-14.dsf.el7 will be installed
INFO:kolla.image.build.base:--> Finished Dependency Resolution
INFO:kolla.image.build.base:Error: Package: 7:device-mapper-event-1.02.146-4.el7.x86_64 (base)
INFO:kolla.image.build.base: Requires: device-mapper = 7:1.02.146-4.el7
INFO:kolla.image.build.base: Installed: 7:device-mapper-1.02.149-10.el7_6.2.x86_64 (@Updates)
INFO:kolla.image.build.base: device-mapper = 7:1.02.149-10.el7_6.2
INFO:kolla.image.build.base: Available: 7:device-mapper-1.02.146-4.el7.x86_64 (base)
INFO:kolla.image.build.base: device-mapper = 7:1.02.146-4.el7
INFO:kolla.image.build.base:
INFO:kolla.image.build.base: You could try using --skip-broken to work around the problem
INFO:kolla.image.build.base: You could try running: rpm -Va --nofiles --nodigest

原因分析:遇到这个问题的时候,一开始以为自己的yun源出现了问题,所以去本地yum源里面去查找是否有device-mapper-event-1.02.146-4.el7.x86_64这个rpm包,在base/update里面,检查了一遍都存在这个包。后来怀疑是centos基础镜像有问题,就使用docker run -it centos启动了一个容器,在容器里面使用rpm -qa |grep device命令查看的时候,发现系统里面安装了device-mapper-1.02.149-10.el7_6.2.x86_64。kolla build编译进行需要的是device-mapper-event-1.02.146-4.el7.x86_64这个rpm包,但是系统已经安装了149的版本,造成了这种问题。处理方式时,幸亏以前搭建的kolla build服务器还在,把对应的centos基础镜像拷贝过来,导入到该环境里,启动一个容器以后,再次检查他的devcie相关包,发现确实是146的版本,所以以前的编译没有问题。

[root@localhost base]# docker run -it 75835a67d134 /bin/bash
[root@730fd71696a2 /]# rpm -qa |grep device
device-mapper-1.02.146-4.el7.x86_64
device-mapper-libs-1.02.146-4.el7.x86_64
[root@730fd71696a2 /]#

导入基础centos镜像以后,在编译镜像时,使用特定的私有仓库中的基础镜像

kolla-build -b centos --base-tag 7 --base-image 172.19.146.34:5001/centos/centos --tag ocata --type source keystone

问题的根因是kolla-build -b centos --base-tag 7 --tag ocata --type source keystone命令行执行的时候,每次都去官网拉去一遍centos基础镜像,再进行下一步的操作。而官网的centos基础镜像几乎每天都有新的rpm更新,导致与本地的yum源不匹配,造成异常

教训:在kolla-build镜像的时候,搭建自己的yum源,并且成功编译出镜像时,一定要把基础镜像保存一份,以后一直用这个基础镜像,否则一直拉取官网的最新镜像,在编译openstack镜像时,会造成各种异常的情况,并且一直更新yum源也很费事

问题2:kolla-ansible -i ./all-in-one pull 编译的镜像时,一直提示如下的错误

TASK [common : include] *******************************************************************************************************************************
included: /usr/share/kolla-ansible/ansible/roles/common/tasks/bootstrap.yml for localhost TASK [common : Creating log volume] *****************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": true, "msg": "'Traceback (most recent call last):\\n
File \"/tmp/ansible_7mwoMR/ansible_module_kolla_docker.py\", line 802, in main\\n dw = DockerWorker(module)\\n
File \"/tmp/ansible_7mwoMR/ansible_module_kolla_docker.py\", line 221, in __init__\\n self.dc = get_docker_client()(**options)\\n
File \"/usr/lib/python2.7/site-packages/docker/client.py\", line 99, in __init__\\n self._version = self._retrieve_server_version()\\n
File \"/usr/lib/python2.7/site-packages/docker/client.py\", line 124, in _retrieve_server_version\\n
\\'Error while fetching server API version: {0}\\'.format(e)\\n
DockerException: Error while fetching server API version: Timeout value connect was Timeout(connect=60, read=60, total=None),
but it must be an int, float or None.\\n'"}
to retry, use: --limit @/usr/share/kolla-ansible/ansible/site.retry PLAY RECAP *******************************************************************************************************************************************
localhost : ok=19 changed=8 unreachable=0 failed=1

 原因分析:第一次拉取不管是官方镜像还是自己源码编译的镜像,都能成功的部署起来,但是执行命令kolla-ansible destroy --include-images --yes-i-really-really-mean-it把

部署的容器和缓存的镜像去掉,重新部署的时候,一直报以前的错误。后来谷歌了一下,是requests版本太高的问题。方法是把requests的版本降到requests==2.17.3就可以了

过程如下:

[root@controller ~]# pip list |grep requests
requests 2.19.1
requestsexceptions 1.4.0
[root@controller ~]#
[root@controller ~]# pip uninstall requests
Uninstalling requests-2.19.1:
Would remove:
/usr/lib/python2.7/site-packages/requests-2.19.1.dist-info/*
/usr/lib/python2.7/site-packages/requests/*
Would not remove (might be manually added):
/usr/lib/python2.7/site-packages/requests/packages/__init__.py
/usr/lib/python2.7/site-packages/requests/packages/__init__.pyo
Proceed (y/n)? y
Successfully uninstalled requests-2.19.1
[root@controller ~]#
[root@controller ~]# pip install requests==2.17.3

 备注:requests 2.18.xx 系列也有这个问题,为了保险起见,最好直接使用requests==2.17.3或者使用2.20.1

[root@localhost ~]# pip list |grep requests
requests 2.20.1
requestsexceptions 1.4.0
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# python
Python 2.7.5 (default, Jul 13 2018, 13:06:57)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import docker
>>> c = docker.Client(base_url='unix://var/run/docker.sock', version='1.15', timeout=2.0)
>>> l = c.containers(all=True)
>>> quit()
[root@localhost ~]#

问题3:kolla-ansible部署完以后,执行openstack 命令报如下错误

[root@controller ~]# source /etc/kolla/admin-openrc.sh
[root@controller ~]# openstack service list
Traceback (most recent call last):
File "/usr/bin/openstack", line 7, in <module>
from openstackclient.shell import main
File "/usr/lib/python2.7/site-packages/openstackclient/shell.py", line 23, in <module>
from osc_lib import shell
File "/usr/lib/python2.7/site-packages/osc_lib/shell.py", line 33, in <module>
from osc_lib.cli import client_config as cloud_config
File "/usr/lib/python2.7/site-packages/osc_lib/cli/client_config.py", line 18, in <module>
from openstack.config import exceptions as sdk_exceptions
File "/usr/lib/python2.7/site-packages/openstack/__init__.py", line 17, in <module>
import openstack.connection
File "/usr/lib/python2.7/site-packages/openstack/connection.py", line 166, in <module>
from openstack import cloud as _cloud
File "/usr/lib/python2.7/site-packages/openstack/cloud/__init__.py", line 20, in <module>
from openstack.cloud.openstackcloud import OpenStackCloud
File "/usr/lib/python2.7/site-packages/openstack/cloud/openstackcloud.py", line 49, in <module>
from openstack.cloud import _utils
File "/usr/lib/python2.7/site-packages/openstack/cloud/_utils.py", line 28, in <module>
from decorator import decorator
ImportError: No module named decorator

  原因是 decorator包为3.4.0版本太低,导致,升级完以后,就没有问题了

[root@controller ~]# pip list |grep decorator
decorator 3.4.0
[root@controller ~]# pip install -U decorator
Looking in indexes: http://172.19.146.225:8081/
Collecting decorator
Downloading http://172.19.146.225:8081/packages/decorator-4.3.0-py2.py3-none-any.whl
Installing collected packages: decorator
Found existing installation: decorator 3.4.0
Uninstalling decorator-3.4.0:
Successfully uninstalled decorator-3.4.0
Successfully installed decorator-4.3.0

  问题4:kolla-ansible部署完以后,执行openstack 命令报如下错误

Traceback (most recent call last):
File "/usr/bin/openstack", line 7, in <module>
from openstackclient.shell import main
File "/usr/lib/python2.7/site-packages/openstackclient/shell.py", line 22, in <module>
from osc_lib.api import auth
File "/usr/lib/python2.7/site-packages/osc_lib/api/auth.py", line 22, in <module>
from osc_lib.i18n import _
File "/usr/lib/python2.7/site-packages/osc_lib/i18n.py", line 16, in <module>
import oslo_i18n
File "/usr/lib/python2.7/site-packages/oslo_i18n/__init__.py", line 14, in <module>
from ._gettextutils import *
File "/usr/lib/python2.7/site-packages/oslo_i18n/_gettextutils.py", line 24, in <module>
from babel import localedata
ImportError: No module named babel

  原因是babel包 为2.3.4版本太低导致,升级完包以后,就可以了

[root@controller ~]# pip unintall Babel
[root@controller ~]# pip install Babel
Looking in indexes: http://172.19.146.50:8081/
Requirement already satisfied: Babel in /usr/lib/python2.7/site-packages (2.3.4)
Requirement already satisfied: pytz in /usr/lib/python2.7/site-packages (from Babel) (2016.10)
[root@controller ~]# pip install Babel==2.6.0
Looking in indexes: http://172.19.146.50:8081/
Collecting Babel==2.6.0

 问题5:有时升级包时出现如下错误

[root@controller ~]# pip install -U wrapt
Looking in indexes: http://172.19.146.225:8081/simple/
Collecting wrapt
Downloading http://172.19.146.225:8081/packages/simple/wrapt/wrapt-1.10.11.tar.gz
Installing collected packages: wrapt
Found existing installation: wrapt 1.10.8
Cannot uninstall 'wrapt'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to
only a partial uninstall.

 解决方法:

[root@controller ~]# pip install --ignore-installed -U wrapt
Looking in indexes: http://172.19.146.225:8081/simple/
Collecting wrapt
Downloading http://172.19.146.225:8081/packages/simple/wrapt/wrapt-1.10.11.tar.gz
Installing collected packages: wrapt
Running setup.py install for wrapt ... done
Successfully installed wrapt-1.10.11
[root@controller ~]#

  

kolla-build镜像时,问题汇总的更多相关文章

  1. 树莓派及其他硬件平台国内外Linux镜像站全汇总

    转载至segmentfault. 本文收集整理国内对于Raspberry Pi.CubieBoard.pcDuino等各种Linux开源硬件平台,所使用的Raspbian.Arch Linux ARM ...

  2. 快速解决docker生成镜像时提示Could not resolve ‘archive.ubuntu.com’问题

    今天在其中一台Linux 中使用Docker命令创建镜像时失败,报错提示: Temporary failure resolving ‘archive.ubuntu.com’ 典型的DNS解析问题,尝试 ...

  3. howto:在构建基于debian的docker基础镜像时,更换国内包源

    debian经常被用作构建应用镜像的基础镜像,如微软在构建linux下的dotnetcore基础镜像时,提供了基于debian 8(jessie)和debian 9(stretch)的镜像. 由于这些 ...

  4. Linux上通过MySQL命令访问MySQL数据库时常见问题汇总

    Linux上通过mysql命令访问MySQL数据库时常见问题汇总 1)创建登录账号 #创建用户并授权 #允许本地访问 create user 'test'@'localhost' identified ...

  5. docker 执行 docker system prune 导致Azure Devops build镜像失败

    运行docker的centos上, 只分配了16G的空间, 装了个mysql, 还有个rancher, 就只剩下2G的空间了, Azure Devops build镜像就出错了, 显示存储空间不足, ...

  6. 使用dockerfile文件创建镜像时docker build没有反应

    问题: 先 docker pull centos:7 拉取了一个官方的基础镜像,为后续创建jdk8镜像做准备,在创建如下的dockerfile文件 执行docker build -t jdk_8u19 ...

  7. Gradle Build速度加快方法汇总

    Android Studio用起来越来越顺手,但是却发现Build的速度实在不敢恭维,在google和度娘了几把(....)之后,大体就是分配更高的内存,步骤:Setting-->搜索gradl ...

  8. kolla出现问题时的定位方式

    前提,对官网问题的一个翻译 Troubleshooting Guide排障手册 1.Failures(失败) If Kolla fails, often it is caused by a CTRL- ...

  9. # 构建以及运行Springboot Docker镜像时的变量传递

    Docker可以把我们的运行环境打包,然后我们只要run就可以了.大部分hello world都是这么写的.但都缺少了实际应用环节.以springboot为例,hello world的Dockerfi ...

随机推荐

  1. java编程思想第五章初始化与清理

    5.1使用构造器确保初始化: 构造器与一般方法一样,但是没有返回值,且其方法名与类名完全相同. 不接受任何参数的构造器成为默认构造器,也叫无参构造器. 5.2 方法重载: 为什么会有方法重载? 构造器 ...

  2. [置顶] C语言itoa()函数和atoi()函数详解(整数转字符C实现)

    头文件:#include <stdlib.h> atoi() 函数用来将字符串转换成整数(int),其原型为: int atoi (const char * str); [函数说明]ato ...

  3. 构建工具:webpack与grunt/gulp

    1.    webpack 官网:http://webpack.github.io/docs/ 中文文档:http://www.css88.com/doc/webpack2/ Webpack 是一个模 ...

  4. 发RTX通知

    安装sdk 在RTXServer目录下找到WebRoot目录,找到里面的SendNotify.cgi(就是一个php页面,默认是pc - ascii编码).打开页面,在头部加上编码信息 header( ...

  5. RabbitMQ 消息队列 安装及使用

    RabbitMQ 消息队列安装: linux版本:CentOS 7 安装第一步:先关闭防火墙 1.Centos7.x关闭防火墙 [root@rabbitmq /]# systemctl stop fi ...

  6. DDD学习笔录——简介DDD的战略模式如何塑造应用程序的架构

    前一篇,简单介绍了DDD战略模式的提炼问题域,这篇简单介绍它如何塑造应用程序的架构. 1.创建一个模型以解决领域问题 为每一个子域构建一个软件模型以处理领域问题并让软件与业务保持一致. 这个模型并非现 ...

  7. Python之条件语句以及循环

    Python代码的缩进规则.具有相同缩进的代码被视为代码块 缩进请严格按照Python的习惯写法:4个空格,不要使用Tab,更不要混合Tab和空格,否则很容易造成因为缩进引起的语法错误. 注意: if ...

  8. linux动态内核模块编程-3

    将一组与模块相关的命令加载进内核 完成功能类似2,打印proc下的相关信息.但是不用重新编译内核,节省时间,更为灵活 内核模块介绍 模块是在内核空间运行的程序,实际上是一种目标文件,不能单独运行但其代 ...

  9. cookie禁用后的session

    在浏览器地址后加:jsessionid="对应的32位字符串",照样可以访问. 在用户角度来说,浏览器开启,关闭就是一次会话. 在服务器角度来说,session失效才代表一次会话的 ...

  10. 项目一:第八天 1、前台系统导入 实现客户注册 发验证码,邮件 springdata-redis存储数据 3、实现客户登陆

    1 前台系统客户注册功能 页面:signup.html 1.1 验证手机号是否注册(邮箱同样) 1. 使用Jquery-validate插件进行相关校验,使用校验规则 <input type=& ...