Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scenario:
- juju bootstrap
- echo -e "\nAguardando ambiente ser inicializado..."
- sleep 60;
- juju deploy --repository ~/charms local:hadoop-master
- juju deploy --repository ~/charms local:hadoop-slave
- echo -e "\nAguardando instanciamento do Master e Slave do Hadoop..."
- sleep 200;
- juju add-relation hadoop-slave hadoop-master
- juju expose hadoop-master
- sleep 10;
- for i in {1..10} ; do
- juju add-unit hadoop-slave; sleep 10;
- done
- There are 13 instances. The database is clean, starting from id 1.
- At this point, many instances doesnt work!!
- Considering the code where the error is happening we have:
- /usr/lib/python2.7/dist-packages/nova/api/ec2/cloud.py", line 827
- @require_context
- def security_group_in_use(context, group_id):
- session = get_session()
- with session.begin():
- # Are there any instances that haven't been deleted
- # that include this group?
- inst_assoc = session.query(models.SecurityGroupInstanceAssociation).\
- filter_by(security_group_id=group_id).\
- filter_by(deleted=False).\
- all()
- for ia in inst_assoc:
- num_instances = session.query(models.Instance).\
- filter_by(deleted=False).\
- filter_by(id=ia.instance_id).\
- count()
- if num_instances:
- return True
- return False
- The database state at this moment is:
- mysql> select * from security_groups;
- +---------------------+------------+------------+---------+----+----------------+---------
- | created_at | deleted | id | name | description |
- +---------------------+------------+------------+---------+----+----------------+---------
- | 2012-05-10 18:17:30 | 0 | 1 | default | default |
- | 2012-05-10 18:17:30 | 0 | 2 | juju-sample | juju group for sample |
- | 2012-05-10 18:17:31 | 0 | 3 | juju-sample-0 | juju group for sample machine 0 |
- | 2012-05-10 18:18:39 | 0 | 4 | juju-sample-1 | juju group for sample machine 1 |
- | 2012-05-10 18:18:42 | 0 | 5 | juju-sample-2 | juju group for sample machine 2 |
- | 2012-05-10 18:22:15 | 0 | 6 | juju-sample-3 | juju group for sample machine 3 |
- | 2012-05-10 18:22:26 | 0 | 7 | juju-sample-4 | juju group for sample machine 4 |
- | 2012-05-10 18:22:37 | 0 | 8 | juju-sample-5 | juju group for sample machine 5 |
- | 2012-05-10 18:22:49 | 0 | 9 | juju-sample-6 | juju group for sample machine 6 |
- | 2012-05-10 18:23:00 | 0 | 10 | juju-sample-7 | juju group for sample machine 7 |
- | 2012-05-10 18:23:12 | 0 | 11 | juju-sample-8 | juju group for sample machine 8 |
- | 2012-05-10 18:23:23 | 0 | 12 | juju-sample-9 | juju group for sample machine 9 |
- | 2012-05-10 18:23:34 | 0 | 13 | juju-sample-10 | juju group for sample machine 10 |
- | 2012-05-10 18:23:46 | 0 | 14 | juju-sample-11 | juju group for sample machine 11 |
- | 2012-05-10 18:23:58 | 0 | 15 | juju-sample-12 | juju group for sample machine 12 |
- +---------------------+------------+------------+---------+----+----------------+---------
- mysql> select * from security_group_instance_association where deleted = 0;
- +---------------------+------------+------------+---------+----+--------
- | created_at | deleted | id | security_group_id | instance_id |
- +---------------------+------------+------------+---------+----+--------
- | 2012-05-10 18:17:32 | 0 | 1 | 2 | 1 |
- | 2012-05-10 18:17:32 | 0 | 2 | 3 | 1 |
- | 2012-05-10 18:18:40 | 0 | 3 | 2 | 2 |
- | 2012-05-10 18:18:40 | 0 | 4 | 4 | 2 |
- | 2012-05-10 18:18:43 | 0 | 5 | 2 | 3 |
- | 2012-05-10 18:18:43 | 0 | 6 | 5 | 3 |
- | 2012-05-10 18:22:16 | 0 | 7 | 2 | 4 |
- | 2012-05-10 18:22:16 | 0 | 8 | 6 | 4 |
- | 2012-05-10 18:22:27 | 0 | 9 | 2 | 5 |
- | 2012-05-10 18:22:27 | 0 | 10 | 7 | 5 |
- | 2012-05-10 18:22:38 | 0 | 11 | 2 | 6 |
- | 2012-05-10 18:22:38 | 0 | 12 | 8 | 6 |
- | 2012-05-10 18:22:50 | 0 | 13 | 2 | 7 |
- | 2012-05-10 18:22:50 | 0 | 14 | 9 | 7 |
- | 2012-05-10 18:23:01 | 0 | 15 | 2 | 8 |
- | 2012-05-10 18:23:01 | 0 | 16 | 10 | 8 |
- | 2012-05-10 18:23:13 | 0 | 17 | 2 | 9 |
- | 2012-05-10 18:23:13 | 0 | 18 | 11 | 9 |
- | 2012-05-10 18:23:24 | 0 | 19 | 2 | 10 |
- | 2012-05-10 18:23:24 | 0 | 20 | 12 | 10 |
- | 2012-05-10 18:23:35 | 0 | 21 | 2 | 11 |
- | 2012-05-10 18:23:36 | 0 | 22 | 13 | 11 |
- | 2012-05-10 18:23:47 | 0 | 23 | 2 | 12 |
- | 2012-05-10 18:23:47 | 0 | 24 | 14 | 12 |
- | 2012-05-10 18:23:59 | 0 | 25 | 2 | 13 |
- | 2012-05-10 18:23:59 | 0 | 26 | 15 | 13 |
- +---------------------+------------+------------+---------+----+--------
- 26 rows in set (0.00 sec)
- mysql> select id from instances where deleted = 0;
- +----+
- | id |
- +----+
- | 1 |
- | 2 |
- | 3 |
- | 4 |
- | 5 |
- | 6 |
- | 7 |
- | 8 |
- | 9 |
- | 10 |
- | 11 |
- | 12 |
- | 13 |
- +----+
- 13 rows in set (0.00 sec)
- Trying to create a new unit generate the same error. How juju works with 0 for the first instance, it will then create the juju-sample-13 (the 14th instance).
- 2012-05-10 15:47:42 DEBUG nova.api.ec2 [req-c12d2887-b42d-42fc-8636-5c1ff55e35f6 de0bba964c7b4948bef8bb04d7111cae fed67a76052340e6b225879aed674846] action: DeleteSecurityGroup from (pid=23347) __call__ /usr/lib/python2.7/dist-packages/nova/api/ec2/__init__.py:435
- 2012-05-10 15:47:42 DEBUG nova.api.ec2 [req-c12d2887-b42d-42fc-8636-5c1ff55e35f6 de0bba964c7b4948bef8bb04d7111cae fed67a76052340e6b225879aed674846] arg: GroupName val: juju-sample-13 from (pid=23347) __call__ /usr/lib/python2.7/dist-packages/nova/api/ec2/__init__.py:437
- 2012-05-10 15:47:42 ERROR nova.api.ec2 [req-c12d2887-b42d-42fc-8636-5c1ff55e35f6 de0bba964c7b4948bef8bb04d7111cae fed67a76052340e6b225879aed674846] Unexpected error raised: Group not valid. Reason: In Use
- 2012-05-10 15:47:42 TRACE nova.api.ec2 Traceback (most recent call last):
- 2012-05-10 15:47:42 TRACE nova.api.ec2 File "/usr/lib/python2.7/dist-packages/nova/api/ec2/__init__.py", line 582, in __call__
- 2012-05-10 15:47:42 TRACE nova.api.ec2 result = api_request.invoke(context)
- 2012-05-10 15:47:42 TRACE nova.api.ec2 File "/usr/lib/python2.7/dist-packages/nova/api/ec2/apirequest.py", line 81, in invoke
- 2012-05-10 15:47:42 TRACE nova.api.ec2 result = method(context, **args)
- 2012-05-10 15:47:42 TRACE nova.api.ec2 File "/usr/lib/python2.7/dist-packages/nova/api/ec2/cloud.py", line 827, in delete_security_group
- 2012-05-10 15:47:42 TRACE nova.api.ec2 raise exception.InvalidGroup(reason="In Use")
- 2012-05-10 15:47:42 TRACE nova.api.ec2 InvalidGroup: Group not valid. Reason: In Use
- 2012-05-10 15:47:42 TRACE nova.api.ec2
- 2012-05-10 15:47:42 ERROR nova.api.ec2 [req-c12d2887-b42d-42fc-8636-5c1ff55e35f6 de0bba964c7b4948bef8bb04d7111cae fed67a76052340e6b225879aed674846] Environment: {"CONTENT_TYPE": "text/plain", "SCRIPT_NAME": "/services/Cloud", "REQUEST_METHOD": "GET", "HTTP_HOST": "10.129.10.44:8773", "PATH_INFO": "", "SERVER_PROTOCOL": "HTTP/1.0", "QUERY_STRING": "AWSAccessKeyId=08d1790ca04646f3b116331a6565d2a7&Action=DeleteSecurityGroup&GroupName=juju-sample-13&Signature=mx6NgS2EAdiu%2BiIz4T%2B0LyPHV%2B9M2T7W8NCsEOSqvY8%3D&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-05-10T18%3A47%3A29Z&Version=2008-12-01", "HTTP_USER_AGENT": "Twisted PageGetter", "SERVER_NAME": "10.129.10.44", "REMOTE_ADDR": "172.16.0.2", "wsgi.url_scheme": "http", "SERVER_PORT": "8773", "GATEWAY_INTERFACE": "CGI/1.1"}
- 2012-05-10 15:47:42 ERROR nova.api.ec2 [req-c12d2887-b42d-42fc-8636-5c1ff55e35f6 de0bba964c7b4948bef8bb04d7111cae fed67a76052340e6b225879aed674846] UnknownError: An unknown error has occurred. Please try your request again.
- --
- The database:
- New line:
- mysql> select * from security_groups;
- +---------------------+------------+------------+---------+----+----------------+---------
- | created_at | deleted | id | name | description |
- +---------------------+------------+------------+---------+----+----------------+---------
- | 2012-05-10 18:17:30 | 0 | 1 | default | default |
- | 2012-05-10 18:17:30 | 0 | 2 | juju-sample | juju group for sample |
- | 2012-05-10 18:17:31 | 0 | 3 | juju-sample-0 | juju group for sample machine 0 |
- | 2012-05-10 18:18:39 | 0 | 4 | juju-sample-1 | juju group for sample machine 1 |
- | 2012-05-10 18:18:42 | 0 | 5 | juju-sample-2 | juju group for sample machine 2 |
- | 2012-05-10 18:22:15 | 0 | 6 | juju-sample-3 | juju group for sample machine 3 |
- | 2012-05-10 18:22:26 | 0 | 7 | juju-sample-4 | juju group for sample machine 4 |
- | 2012-05-10 18:22:37 | 0 | 8 | juju-sample-5 | juju group for sample machine 5 |
- | 2012-05-10 18:22:49 | 0 | 9 | juju-sample-6 | juju group for sample machine 6 |
- | 2012-05-10 18:23:00 | 0 | 10 | juju-sample-7 | juju group for sample machine 7 |
- | 2012-05-10 18:23:12 | 0 | 11 | juju-sample-8 | juju group for sample machine 8 |
- | 2012-05-10 18:23:23 | 0 | 12 | juju-sample-9 | juju group for sample machine 9 |
- | 2012-05-10 18:23:34 | 0 | 13 | juju-sample-10 | juju group for sample machine 10 |
- | 2012-05-10 18:23:46 | 0 | 14 | juju-sample-11 | juju group for sample machine 11 |
- | 2012-05-10 18:23:58 | 0 | 15 | juju-sample-12 | juju group for sample machine 12 |
- | 2012-05-10 18:42:56 | 0 | 16 | juju-sample-13 | juju group for sample machine 13 |
- +---------------------+------------+------------+---------+----+----------------+---------
- mysql> select * from security_group_instance_association where deleted = 0;
- +---------------------+------------+------------+---------+----+--------
- | created_at | deleted | id | security_group_id | instance_id |
- +---------------------+------------+------------+---------+----+--------
- | 2012-05-10 18:17:32 | 0 | 1 | 2 | 1 |
- | 2012-05-10 18:17:32 | 0 | 2 | 3 | 1 |
- | 2012-05-10 18:18:40 | 0 | 3 | 2 | 2 |
- | 2012-05-10 18:18:40 | 0 | 4 | 4 | 2 |
- | 2012-05-10 18:18:43 | 0 | 5 | 2 | 3 |
- | 2012-05-10 18:18:43 | 0 | 6 | 5 | 3 |
- | 2012-05-10 18:22:16 | 0 | 7 | 2 | 4 |
- | 2012-05-10 18:22:16 | 0 | 8 | 6 | 4 |
- | 2012-05-10 18:22:27 | 0 | 9 | 2 | 5 |
- | 2012-05-10 18:22:27 | 0 | 10 | 7 | 5 |
- | 2012-05-10 18:22:38 | 0 | 11 | 2 | 6 |
- | 2012-05-10 18:22:38 | 0 | 12 | 8 | 6 |
- | 2012-05-10 18:22:50 | 0 | 13 | 2 | 7 |
- | 2012-05-10 18:22:50 | 0 | 14 | 9 | 7 |
- | 2012-05-10 18:23:01 | 0 | 15 | 2 | 8 |
- | 2012-05-10 18:23:01 | 0 | 16 | 10 | 8 |
- | 2012-05-10 18:23:13 | 0 | 17 | 2 | 9 |
- | 2012-05-10 18:23:13 | 0 | 18 | 11 | 9 |
- | 2012-05-10 18:23:24 | 0 | 19 | 2 | 10 |
- | 2012-05-10 18:23:24 | 0 | 20 | 12 | 10 |
- | 2012-05-10 18:23:35 | 0 | 21 | 2 | 11 |
- | 2012-05-10 18:23:36 | 0 | 22 | 13 | 11 |
- | 2012-05-10 18:23:47 | 0 | 23 | 2 | 12 |
- | 2012-05-10 18:23:47 | 0 | 24 | 14 | 12 |
- | 2012-05-10 18:23:59 | 0 | 25 | 2 | 13 |
- | 2012-05-10 18:23:59 | 0 | 26 | 15 | 13 |
- | 2012-05-10 18:42:57 | 0 | 27 | 2 | 14 |
- | 2012-05-10 18:42:57 | 0 | 28 | 16 | 14 |
- +---------------------+------------+------------+---------+----+--------
- mysql> select id from instances where deleted = 0;
- +----+
- | id |
- +----+
- | 1 |
- | 2 |
- | 3 |
- | 4 |
- | 5 |
- | 6 |
- | 7 |
- | 8 |
- | 9 |
- | 10 |
- | 11 |
- | 12 |
- | 13 |
- | 14 | <--
- +----+
- inst_assoc = session.query(models.SecurityGroupInstanceAssociation).\
- filter_by(security_group_id=group_id).\
- filter_by(deleted=False).\
- all()
- +---------------------+------------+------------+---------+----+--------------
- | created_at | deleted | id | security_group_id | instance_id |
- | 2012-05-10 18:42:57 | 0 | 28 | 16 | 14 |
- for ia in inst_assoc:
- num_instances = session.query(models.Instance).\
- filter_by(deleted=False).\
- filter_by(id=ia.instance_id).\
- count()
- Count will return 1, so, True.
- Once the dabase was empty, all those security rules was created by juju and nova. I'm not good with python, but seems that these tests will always be true, returning true in the function and generating the error.
- Maybe the order of insertion on the database can be important. I don't know when the '14' instance was inserted in 'instances' table. If the tests occurs before this, ok. But, if 14 is inserted before the test, the error will happen.
- I don't know if the problem is exactly that. Maybe. I don't know the nova and juju codes. I'm justing testing something.
- Cheers.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement