[nailgun] Nailgun returns Internal Server Error 500 while trying to update tag with already existing 'tag' value
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Fuel for OpenStack |
Invalid
|
High
|
Alexander Kislitsky | ||
Mitaka |
Invalid
|
High
|
Fuel Sustaining | ||
Newton |
Invalid
|
High
|
Fuel Sustaining |
Bug Description
Detailed bug description:
If we try to update some newly created user defined tags with already existing 'tag' value Nailgun returns '500 Server Error: Internal Server Error':
[root@fuel ~]# fuel2 tag update --file_path test_tag.json -t 47
500 Server Error: Internal Server Error for url: http://
Here is a log for Nailgun:
Traceback (most recent call last):
File "/usr/lib/
return func(cls, *args, **kwargs)
File "<string>", line 2, in PUT
File "/usr/lib/
return func(cls, *args, **kwargs)
File "<string>", line 2, in PUT
File "/usr/lib/
resp = func(cls, *args, **kwargs)
File "/usr/lib/
self.
File "/usr/lib/
db().flush()
File "/usr/lib64/
self.
File "/usr/lib64/
transaction
File "/usr/lib64/
compat.
File "/usr/lib64/
flush_
File "/usr/lib64/
rec.
File "/usr/lib64/
uow
File "/usr/lib64/
mapper, table, update)
File "/usr/lib64/
execute(
File "/usr/lib64/
return meth(self, multiparams, params)
File "/usr/lib64/
return connection.
File "/usr/lib64/
compiled_sql, distilled_params
File "/usr/lib64/
context)
File "/usr/lib64/
exc_info
File "/usr/lib64/
reraise(
File "/usr/lib64/
context)
File "/usr/lib64/
cursor.
IntegrityError: (psycopg2.
DETAIL: Key (owner_type, owner_id, tag)=(cluster, 1, test_tag_2) already exists.
[SQL: 'UPDATE tags SET tag=%(tag)s WHERE tags.id = %(tags_id)s'] [parameters: {'tags_id': 47, 'tag': u'test_tag_2'}]
Steps to reproduce:
1. Deploy Fuel (e.g. 1 master + 5 nodes).
2. Create new env.
3. Create several tags for this environment.
[root@fuel ~]# cat test_tag_1.json
{
"tag": "test_tag_1",
"has_primary": false
}
[root@fuel ~]# cat test_tag_2.json
{
"tag": "test_tag_2",
"has_primary": false
}
[root@fuel ~]# fuel2 tag list -e 1
+----+-
| id | tag | has_primary |
+----+-
| 47 | test_tag_1 | False |
| 48 | test_tag_2 | False |
+----+-
4. Try to update some user-defined tag, i.e. with id=47 with a new data, where 'tag' value is already defined for some other tags:
[root@fuel ~]# cat test_tag_2.json
{
"tag": "test_tag_2",
"has_primary": false
}
[root@fuel ~]# fuel2 tag update --file_path test_tag_2.json -t 47
500 Server Error: Internal Server Error for url: http://
[root@fuel ~]#
Expected results:
Some message that... (Tag 'test_tag_2' is already present.)
Actual result:
500 Server Error: Internal Server Error for url: http://
Reproducibility:
Always
Description of the environment:
[root@fuel ~]# shotgun2 short-report
cat /etc/fuel_build_id:
859
cat /etc/fuel_
859
cat /etc/fuel_release:
10.0
cat /etc/fuel_
newton-10.0
Changed in fuel: | |
milestone: | none → 9.2 |
assignee: | nobody → Fuel Sustaining (fuel-sustaining-team) |
milestone: | 9.2 → 11.0 |
importance: | Undecided → Medium |
status: | New → Confirmed |
Changed in fuel: | |
importance: | Medium → High |
Changed in fuel: | |
assignee: | Fuel Sustaining (fuel-sustaining-team) → Alexander Kislitsky (akislitsky) |
Changed in fuel: | |
status: | Incomplete → Invalid |
Folks, I've checked on the master, stable/newton, stable/mitaka, stable/8.0, but we have no table 'tags' for these releases. Could you please provide more details or env with reproduced bug. Marking as incomplete.