Bug 607560 - Can't add new power_type through beaker web site.
Summary: Can't add new power_type through beaker web site.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: scheduler
Version: 0.4
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Bill Peck
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-06-24 11:33 UTC by Seiji Aguchi
Modified: 2012-08-14 00:07 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-14 00:07:41 UTC
Embargoed:


Attachments (Terms of Use)

Description Seiji Aguchi 2010-06-24 11:33:02 UTC
Description of problem:

  Can't add new power_type through beaker web site.


Version-Release number of selected component (if applicable):

  beaker-0.5.42-2.
  beaker-server-0.5.42-2.
  beaker-client-0.5.42-2.
  beaker-labcontroller-0.5.42-2.

Steps to Reproduce:

1.
  Admin -> power type -> Add(+) -> Click "submit data" without specifying "name".

    Then, I got the following:
    500 Internal error

2.
  After that, I retried to submit new power type as follows.
   Admin -> power type 

  However, I got "500 Internal error" again.

Actual results:

  See "Steps to Reproduce".


Expected results:

  Beaker should accept new power_type in step2.


Additional info:

  Contents of power_type tables just after step1 were the following.

  mysql> select * from power_type;
  +----+-------------+
  | id | name        |
  +----+-------------+
  |  1 | apc_snmp    |
  |  2 | bladecenter |
  |  3 | bladepap    |
  |  4 | drac        |
  |  5 | ether_wake  |
  |  6 | ilo         |
  |  7 | integrity   |
  |  8 | ipmilan     |
  |  9 | ipmitool    |
  | 10 | lpar        |
  | 11 | rsa         |
  | 12 | virsh       |
  | 13 | wti         |
  | 14 |             |
  +----+-------------+
  14 rows in set (0.00 sec)

  I guess id=14 ,the tuple which "name" entry is NULL, causes internal error.

  Users need to modify mysql table directly to recover from internal error.
  It seems user-unfriendly.

  So I think beaker shouldn't add the tuple which "name" entry is NULL 
  to the power_type table, 

  /var/log/beaker/server.log is following.
  I hope this helps.

<snip>
21/Jun/2010:20:51:55 HTTP INFO Page handler: <bound method PowerTypes.index of <bkr.server.power.PowerTypes object at 0x2aaac0496490>>
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/cherrypy/_cphttptools.py", line 121, in _run
    self.main()
  File "/usr/lib/python2.4/site-packages/cherrypy/_cphttptools.py", line 264, in main
    body = page_handler(*virtual_path, **self.params)
  File "<string>", line 3, in index
  File "/usr/lib/python2.4/site-packages/turbogears/controllers.py", line 358, in expose
    output = database.run_with_transaction(
  File "<string>", line 5, in run_with_transaction
  File "/usr/lib/python2.4/site-packages/turbogears/database.py", line 407, in sa_rwt
    retval = func(*args, **kw)
  File "<string>", line 5, in _expose
  File "/usr/lib/python2.4/site-packages/turbogears/controllers.py", line 373, in <lambda>
    mapping, fragment, args, kw)))
  File "/usr/lib/python2.4/site-packages/turbogears/controllers.py", line 410, in _execute_func
    output = errorhandling.try_call(func, *args, **kw)
  File "/usr/lib/python2.4/site-packages/turbogears/errorhandling.py", line 77, in try_call
    return func(self, *args, **kw)
  File "<string>", line 3, in index
  File "/usr/lib/python2.4/site-packages/turbogears/paginate.py", line 168, in decorated
    output = func(*args, **kw)
  File "/usr/lib/python2.4/site-packages/bkr/server/power.py", line 134, in index
    list_by_letters = set([elem.name[0].capitalize() for elem in powertypes])
IndexError: string index out of range
<snip>

Comment 1 Seiji Aguchi 2010-06-24 11:41:11 UTC
Hi Bill,

I found new bug in beaker-*-0.5.42-2.

Please fix it.

Regards,

Comment 3 Dan Callaghan 2012-08-14 00:07:41 UTC
This was fixed in beaker-server-0.5.46-1.


Note You need to log in before you can comment on or make changes to this bug.