Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RDO tickets are now tracked in Jira https://issues.redhat.com/projects/RDO/issues/

Bug 1049519

Summary: Nova 500 error: Connection to neutron failed: Maximum attempts reached
Product: [Community] RDO Reporter: Steven Hardy <shardy>
Component: openstack-neutronAssignee: Ihar Hrachyshka <ihrachys>
Status: CLOSED DUPLICATE QA Contact: Ofer Blaut <oblaut>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: chrisw, ihrachys, lars, mrunge, ndipanov, rbryant, shardy, thomasch, yeylon
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-17 12:59:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
last 500 lines of nova API log showing backtrace
none
Example heat template
none
neutron server log error none

Description Steven Hardy 2014-01-07 16:49:16 UTC
Created attachment 846777 [details]
last 500 lines of nova API log showing backtrace

Description of problem:
After attempting to launch an instance on a neutron-enabled RDO Havana install, nova breaks and returns 500 errors:

# nova list
ERROR: The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-e9d36fab-ef8b-4fb5-a9e0-b1a7aa0359b4)

Version-Release number of selected component (if applicable):
# rpm -qa | grep -e nova -e packstack -e neutron
openstack-nova-cert-2013.2.1-2.fc20.noarch
openstack-nova-common-2013.2.1-2.fc20.noarch
python-neutronclient-2.3.1-2.fc20.noarch
openstack-nova-api-2013.2.1-2.fc20.noarch
python-neutron-2013.2.1-1.fc20.noarch
openstack-nova-conductor-2013.2.1-2.fc20.noarch
openstack-nova-scheduler-2013.2.1-2.fc20.noarch
openstack-neutron-openvswitch-2013.2.1-1.fc20.noarch
openstack-nova-console-2013.2.1-2.fc20.noarch
openstack-nova-compute-2013.2.1-2.fc20.noarch
openstack-nova-novncproxy-2013.2.1-2.fc20.noarch
python-nova-2013.2.1-2.fc20.noarch
openstack-neutron-2013.2.1-1.fc20.noarch
python-novaclient-2.15.0-1.fc20.noarch
openstack-packstack-2013.2.1-0.25.dev936.fc20.noarch


How reproducible:
Always.

Steps to Reproduce:
1. Install F20 (bare metal box w/16G ram, selected development tools)
2. sudo su -
3. yum -y update
4. shutdown -r now (reboot to ensure all updates are active)
5. yum -y install openstack-packstack
6. packstack --allinone --os-heat-install=y --os-swift-install=n --os-ceilometer-install=y --os-heat-cloudwatch-install=y --os-heat-cfn-install=y
6. . ~/keystonerc_admin
7. nova list (works)
8. glance image-create --name F20-x86_64-cfntools --disk-format qcow2 --container-format bare --is-public true --copy-from http://cloud.fedoraproject.org/fedora-20.x86_64.qcow2
9. glance image-show F20-x86_64-cfntools (Wait until status active)
10. nova keypair-add --pub-key ~/.ssh/id_rsa.pub
11. heat stack-create wp1 -f F20/WordPress_Native.yaml --parameters="key_name=root_key"


Actual results:
After launching the stack, the nova service seems to get broken, with errors from neutronclient in /var/log/nova/api.log:


2014-01-07 16:43:00.646 2780 TRACE nova.api.openstack ConnectionFailed: Connection to neutron failed: Maximum attempts reached

Full logs and heat template attached.


Expected results:
Nova and neutron should work.

Additional info:
Possibly this is the same issue as upstream bug https://bugs.launchpad.net/nova/+bug/1251784? Perhaps we're missing a stable backport of that bug?

Comment 1 Steven Hardy 2014-01-07 16:50:38 UTC
Created attachment 846778 [details]
Example heat template

Comment 2 Steven Hardy 2014-01-07 18:58:05 UTC
Some further investigation - it seems that the neutron-server service had crashed:

2014-01-07 17:20:04.219 2159 CRITICAL neutron [-] (OperationalError) (2003, "Can't connect to MySQL server on '192.168.0.11' (101)") None None


Full trace attached (from /var/log/neutron/server.log).  I'm not sure what caused that, but re-starting neutron-server allows neutron and nova to work.

Comment 3 Steven Hardy 2014-01-07 18:58:38 UTC
Created attachment 846815 [details]
neutron server log error

Comment 4 Steven Hardy 2014-01-07 22:13:17 UTC
Reassigning to openstack-neutron since this seems to be an issue with neutron-server not nova.  I'm not sure why neutron couldn't connect to the mysql DB when other services were working OK.  

Also I'm unsure why everything worked OK after re-starting neutron-server (with no changes to the configuration).

Strangely this problem recurred a couple of times after reboot, then I upgraded python-wsme to the latest version from updates-testing (to work around a ceilometer-api issue), and now neutron seems to start OK after reboot (other than the qpid issue reported under bug #1049488)

Comment 5 Lars Kellogg-Stedman 2014-02-10 19:48:56 UTC
Steve,

Was this on a --allinone install?  Or was neutron-server on a separate system?  When neutron-server was reporting errors connecting to the database, were you table to connect using the credentials from /etc/neutron/plugin.ini and the mysql command line client?

Comment 6 Ihar Hrachyshka 2014-06-26 15:51:15 UTC
It's hard to tell what went wrong there. We probably need a detailed description of the setup. How many nodes? Where are Neutron and MySQL located? iptables from both nodes? Does ping work? Do MySQL credentials from the config file work with mysql client?

Steven, can you describe that one? Without all that information, the only thing we can do is asking you to retest on latest Havana packages.

Comment 7 Thomas Chacko 2014-09-30 11:27:00 UTC
Reproduced this bug again with Openstack Juno RDO install on CentOS7/minimal Server/ All-in-one install. ( this install is documented on : https://ask.openstack.org/en/question/48329/openstack-juno-using-rdo-fails-installation-amqp-server-closed-the-connection/ )

When the machine is rebooted.. the Neutron Server starts however it cannot connect to the MariaDB MYSQL Server as indicated in the log :

[root@xCentStack neutron(keystone_admin)]# tail -f server.log
2014-09-30 16:31:18.869 1428 TRACE neutron   File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/strategies.py", line 90, in connect
2014-09-30 16:31:18.869 1428 TRACE neutron     return dialect.connect(*cargs, **cparams)
2014-09-30 16:31:18.869 1428 TRACE neutron   File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py", line 377, in connect
2014-09-30 16:31:18.869 1428 TRACE neutron     return self.dbapi.connect(*cargs, **cparams)
2014-09-30 16:31:18.869 1428 TRACE neutron   File "/usr/lib64/python2.7/site-packages/MySQLdb/__init__.py", line 81, in Connect
2014-09-30 16:31:18.869 1428 TRACE neutron     return Connection(*args, **kwargs)
2014-09-30 16:31:18.869 1428 TRACE neutron   File "/usr/lib64/python2.7/site-packages/MySQLdb/connections.py", line 187, in __init__
2014-09-30 16:31:18.869 1428 TRACE neutron     super(Connection, self).__init__(*args, **kwargs2)
2014-09-30 16:31:18.869 1428 TRACE neutron OperationalError: (OperationalError) (2003, "Can't connect to MySQL server on '192.168.0.20' (101)") None None
2014-09-30 16:31:18.869 1428 TRACE neutron 
^C


// Restart the Neutron Server manually
[root@xCentStack neutron(keystone_admin)]# sudo service neutron-server restart
Redirecting to /bin/systemctl restart  neutron-server.service


// Now it again connects, as indicated in the log
[root@xCentStack neutron(keystone_admin)]# tail -f server.log
2014-09-30 16:43:11.157 7437 INFO neutron.api.extensions [-] Extension 'Allowed Address Pairs' provides no backward compatibility map for extended attributes
2014-09-30 16:43:11.158 7437 INFO neutron.api.extensions [-] Extension 'Distributed Virtual Router' provides no backward compatibility map for extended attributes
2014-09-30 16:43:11.158 7437 INFO neutron.api.extensions [-] Extension 'Neutron Extra Route' provides no backward compatibility map for extended attributes
2014-09-30 16:43:11.180 7437 INFO keystonemiddleware.auth_token [-] Starting keystone auth_token middleware
2014-09-30 16:43:11.180 7437 WARNING keystonemiddleware.auth_token [-] Configuring admin URI using auth fragments. This is deprecated, use 'identity_uri' instead.
2014-09-30 16:43:11.182 7437 INFO keystonemiddleware.auth_token [-] Using /tmp/keystone-signing-NHA9nW as cache directory for signing certificate
2014-09-30 16:43:11.235 7437 INFO neutron.service [-] Neutron service started, listening on 0.0.0.0:9696
2014-09-30 16:43:11.236 7437 INFO oslo.messaging._drivers.impl_rabbit [-] Connecting to AMQP server on 192.168.0.20:5672
2014-09-30 16:43:11.246 7437 INFO neutron.wsgi [-] (7437) wsgi starting up on http://0.0.0.0:9696/
2014-09-30 16:43:11.250 7437 INFO oslo.messaging._drivers.impl_rabbit [-] Connected to AMQP server on 192.168.0.20:5672

Comment 8 Ihar Hrachyshka 2014-09-30 12:09:20 UTC
This may be relevant to bug 1144181.

Comment 9 Ihar Hrachyshka 2014-09-30 12:40:22 UTC
Thomas, could you please provide details in bug 1144181?

*** This bug has been marked as a duplicate of bug 1144181 ***