Juniper / contrail-installer

Install scripts for OpenContrail
29 stars 64 forks source link

api-server did not start #130

Closed derekhuang closed 8 years ago

derekhuang commented 8 years ago

When I run "./contrail.sh start", it reports the api-server did not start as below:

2016-07-15 15:45:36 Waiting for api-server to start... 2016-07-15 15:45:36 ++ NL=$'\r' 2016-07-15 15:45:36 ++ screen -S contrail -p apiSrv -X stuff '/usr/local/bin/contrail-api --conf_file /etc/contrail/contrail-api.conf --rabbit_user rabbitcontrail --rabbit_password contrail123 --rabbit_serv'r 127.0.0.1 & echo $! >/home/ubuntu/contrail-installer/status/contrail/apiSrv.pid; fg || echo "apiSrv failed to start" | tee "/home/ubuntu/contrail-installer/status/contrail/apiSrv.failure" 2016-07-15 15:45:36 ++ [[ apiSrv == \a\g\e\n\t ]] 2016-07-15 15:45:36 ++ echo 'Waiting for api-server to start...' 2016-07-15 15:45:36 ++ timeout 180 sh -c 'while ! http_proxy= wget -q -O- http://localhost:8082; do sleep 1; done' ubuntu@contrail:~/contrail-installer$ 2016-07-15 15:48:36 ++ echo 'api-server did not start' 2016-07-15 15:48:36 ++ exit 1 2016-07-15 15:48:36 api-server did not start 2016-07-15 15:48:36 ++ clean 2016-07-15 15:48:36 exited with status :1 2016-07-15 15:48:36 ++ local r=1 2016-07-15 15:48:36 ++ echo 'exited with status :1' 2016-07-15 15:48:36 ++ exit 1

I check the contrail-status from contrail-installer/utilities, and get the following output:

apiSrv : ERROR cass : ACTIVE ifmap : ACTIVE redis : ACTIVE

zk : ACTIVE

apiSrv : ERROR

ERROR : dict = {} doc = 'Attribute not found.' format = getattribute = <method-wrapper 'getattribute' of exceptions.AttributeError object> getitem = <method-wrapper 'getitem' of exceptions.AttributeError object> getslice = <method-wrapper 'getslice' of exceptions.AttributeError object> hash = <method-wrapper 'hash' of exceptions.AttributeError object> init = <method-wrapper 'init' of exceptions.AttributeError object> new = reduce = reduce_ex = repr = <method-wrapper 'repr' of exceptions.AttributeError object> setattr = <method-wrapper 'setattr' of exceptions.AttributeError object> setstate = sizeof = str = <method-wrapper 'str' of exceptions.AttributeError object> subclasshook = unicode = args = ("'NoneType' object has no attribute 'find'",) message = "'NoneType' object has no attribute 'find'"

The above is a description of an error in a Python program. Here is the original traceback:

Traceback (most recent call last): File "/usr/local/bin/contrail-api", line 9, in load_entry_point('vnc-cfg-api-server==0.1.dev0', 'console_scripts', 'contrail-api')() File "/usr/local/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_api_server.py", line 3256, in server_main main() File "/usr/local/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_api_server.py", line 3215, in main vnc_api_server = VncApiServer(args_str) File "/usr/local/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_api_server.py", line 1450, in init self._db_connect(self._args.reset_config) File "/usr/local/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_api_server.py", line 2426, in _db_connect self._args.kombu_ssl_ca_certs) File "/usr/local/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_ifmap.py", line 1307, in init self, ifmap_srv_ip, ifmap_srv_port, uname, passwd, ssl_options) File "/usr/local/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_ifmap.py", line 125, in init self._init_conn() File "/usr/local/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_ifmap.py", line 367, in _init_conn mapclient.set_session_id(newSessionResult(result).get_session_id()) File "/usr/local/lib/python2.7/dist-packages/cfgm_common/ifmap/response.py", line 45, in init self.newSession = Response(result).element() File "/usr/local/lib/python2.7/dist-packages/cfgm_common/ifmap/response.py", line 21, in __init response = body.find('{http://www.trustedcomputinggroup.org/2010/IFMAP/2}response') AttributeError: 'NoneType' object has no attribute 'find'

The error is raised in /usr/local/lib/python2.7/dist-packages/cfgm_common/ifmap/response.py:

def init(self, result): """ Take a result string and process it """ if result: env = ElementTree.fromstring(result) body = env.find('{http://www.w3.org/2003/05/soap-envelope}Body') response = body.find('{http://www.trustedcomputinggroup.org/2010/IFMAP/2}response')

xml.etree.ElementTree find is broken in python 2.6

        children = response.findall('*')

It seems the IFMAP response does not contain "{http://www.w3.org/2003/05/soap-envelope}Body" so that the body is None.

Does somebody meet the same issue and share the insight with me? Thank you very much!

derekhuang commented 8 years ago

I check the screen window, it seems the IFMAP server returns "401 Unauthorized" as response. That causes the body is None.

raviprasad239 commented 8 years ago

In my case api-server starts, but control, ui-jobs and ui-webs fails to start.


control : ERROR

failure"start" | tee "/home/contrail/contrail-installer/status/contrail/control. contrai [1] 23149 sudo /opt/stack/contrail/build/production/control-node/contrail-control --conf_file /etc/contrail/contrail-control.conf contrail-control: controller/src/base/connectioninfo.h:89: static process::ConnectionStateManager* process::ConnectionStateManager::GetInstance(): Assertion `ConnectionState::instance == __null' failed. control failed to start contrail@ubuntu1:~/contrail-installer$


ui-jobs : ERROR

l/contrail-installer/status/contrail/ui-jobs.failure"start" | tee "/home/contrai b-core; [1] 24311 sudo node jobServerStart.js

module.js:340 throw err; ^ Error: Cannot find module 'redis' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:362:17) at require (module.js:378:17) at Object. (/opt/stack/contrail/contrail-web-core/src/serverroot/utils/redis.utils.js:5:13) at Module._compile (module.js:449:26) at Object.Module._extensions..js (module.js:467:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:362:17) ui-jobs failed to start contrail@ubuntu1:/opt/stack/contrail/contrail-web-core$

derekhuang commented 8 years ago

After further checking the 401 error response from IFMAP, it is found that the IFMAP username and password for API-SERVER are not populated in contrail-api.conf for unknown reason, which should be done by ./contrail.sh configure. Anyway, after run ./contrail.sh configure once again, the API-SERVER service can be up now.

AbdulMMalik commented 7 years ago

Same problem here but when I run ./contrail.sh configure and then contrail.sh start it is giving me again the same error. api-server did not start