jkoelker / quark

This is my fork, Quark is now at https://github.com/rackerlabs/quark
Apache License 2.0
0 stars 2 forks source link

Unknown column 'quark_subnets.next_auto_assign_ip' #42

Closed tr3buchet closed 11 years ago

tr3buchet commented 11 years ago
2013-04-08 21:11:44    DEBUG [routes.middleware] Matched GET /networks                                                                   
2013-04-08 21:11:44    DEBUG [routes.middleware] Route path: '/networks{.format}', defaults: {'action': u'index', 'controller': <wsgify a
t 44836496 wrapping <function resource at 0x2a48140>>}                                                                                   
2013-04-08 21:11:44    DEBUG [routes.middleware] Match dict: {'action': u'index', 'controller': <wsgify at 44836496 wrapping <function re
source at 0x2a48140>>, 'format': None}                                                                                                   
2013-04-08 21:11:44     INFO [quantum.quark] get_networks for tenant 546428 with filters {}, fields []                                   
2013-04-08 21:11:44    ERROR [quantum.api.v2.resource] index failed                                                                      
Traceback (most recent call last):                                                                                                       
  File "/home/trey.morris/quantum/.venv/lib/python2.6/site-packages/quantum-2013.2.a369.gd23f0e7-py2.6.egg/quantum/api/v2/resource.py", l
ine 82, in resource                                                                                                                      
    result = method(request=request, **args)                                                                                             
  File "/home/trey.morris/quantum/.venv/lib/python2.6/site-packages/quantum-2013.2.a369.gd23f0e7-py2.6.egg/quantum/api/v2/base.py", line 
251, in index                                                                                                                            
    return self._items(request, True, parent_id)                                                                                         
  File "/home/trey.morris/quantum/.venv/lib/python2.6/site-packages/quantum-2013.2.a369.gd23f0e7-py2.6.egg/quantum/api/v2/base.py", line 
204, in _items                                                                                                                           
    obj_list = obj_getter(request.context, **kwargs)                                                                                     
  File "/home/trey.morris/quark/quark/plugin.py", line 409, in get_networks                                                              
    return [self._make_network_dict(net) for net in nets]                                                                                
  File "/home/trey.morris/quark/quark/plugin.py", line 116, in _make_network_dict                                                        
    'subnets': [s["id"] for s in network.get("subnets", [])]}                                                                            
  File "/home/trey.morris/quantum/.venv/lib/python2.6/site-packages/quantum-2013.2.a369.gd23f0e7-py2.6.egg/quantum/db/model_base.py", lin
e 31, in get                                                                                                                             
    return getattr(self, key, default)                                                                                                   
  File "/home/trey.morris/quantum/.venv/lib/python2.6/site-packages/sqlalchemy/orm/attributes.py", line 168, in __get__                  
    return self.impl.get(instance_state(instance),dict_)                                                                                 
  File "/home/trey.morris/quantum/.venv/lib/python2.6/site-packages/sqlalchemy/orm/attributes.py", line 453, in get                      
    value = self.callable_(state, passive)                                                                                               
  File "/home/trey.morris/quantum/.venv/lib/python2.6/site-packages/sqlalchemy/orm/strategies.py", line 508, in _load_for_state          
    return self._emit_lazyload(session, state, ident_key)                                                                                
  File "/home/trey.morris/quantum/.venv/lib/python2.6/site-packages/sqlalchemy/orm/strategies.py", line 574, in _emit_lazyload           
    result = q.all()                                                                                                                     
  File "/home/trey.morris/quantum/.venv/lib/python2.6/site-packages/sqlalchemy/orm/query.py", line 2115, in all                          
    return list(self)                                                                                                                    
  File "/home/trey.morris/quantum/.venv/lib/python2.6/site-packages/sqlalchemy/orm/query.py", line 2227, in __iter__                     
    return self._execute_and_instances(context)                                                                                          
  File "/home/trey.morris/quantum/.venv/lib/python2.6/site-packages/sqlalchemy/orm/query.py", line 2242, in _execute_and_instances       
    result = conn.execute(querycontext.statement, self._params)                                                                          
  File "/home/trey.morris/quantum/.venv/lib/python2.6/site-packages/sqlalchemy/engine/base.py", line 1449, in execute                    
    params)                                                                                                                              
  File "/home/trey.morris/quantum/.venv/lib/python2.6/site-packages/sqlalchemy/engine/base.py", line 1584, in _execute_clauseelement     
    compiled_sql, distilled_params                                                                                                       
  File "/home/trey.morris/quantum/.venv/lib/python2.6/site-packages/sqlalchemy/engine/base.py", line 1698, in _execute_context           
    context)                                                                                                                             
  File "/home/trey.morris/quantum/.venv/lib/python2.6/site-packages/sqlalchemy/engine/base.py", line 1691, in _execute_context           
    context)                                                                                                                             
  File "/home/trey.morris/quantum/.venv/lib/python2.6/site-packages/sqlalchemy/engine/default.py", line 331, in do_execute               
    cursor.execute(statement, parameters)                                                                                                
  File "/home/trey.morris/quantum/.venv/lib/python2.6/site-packages/MySQLdb/cursors.py", line 201, in execute                            
    self.errorhandler(self, exc, value)                                                                                                  
  File "/home/trey.morris/quantum/.venv/lib/python2.6/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler             
    raise errorclass, errorvalue                                                                                                         
OperationalError: (OperationalError) (1054, "Unknown column 'quark_subnets.next_auto_assign_ip' in 'field list'") 'SELECT quark_subnets.t
enant_id AS quark_subnets_tenant_id, quark_subnets.id AS quark_subnets_id, quark_subnets.created_at AS quark_subnets_created_at, quark_su
bnets.network_id AS quark_subnets_network_id, quark_subnets._cidr AS quark_subnets__cidr, quark_subnets.first_ip AS quark_subnets_first_i
p, quark_subnets.last_ip AS quark_subnets_last_ip, quark_subnets.ip_version AS quark_subnets_ip_version, quark_subnets.next_auto_assign_i
p AS quark_subnets_next_auto_assign_ip, quark_subnets.tag_association_uuid AS quark_subnets_tag_association_uuid \nFROM quark_subnets \nW
HERE %s = quark_subnets.network_id' ('98b12187-cbf1-4962-ac6e-7976fa42b668',)                                                            
asadoughi commented 11 years ago

Do we have a Django equivalent of syncdb? What happens when we add new columns to the models? We have to drop and recreate the database?

tr3buchet commented 11 years ago

I went ahead and dropped the database and bounced quantum. Solved for now. At some point in the future we need to figure out plan for migrations.