The problem may be due to the fact that GAE does not create tables until you perform one insert into them. Therefore any select before there is data will fail.
On Oct 10, 12:20 am, Sujith <[email protected]> wrote: > Hi Massimo, > > I dont know why but when running under web2py the db seems to be > populated. But when i run under GAE this happens. > Any idea where i should look into? > > Thanks > Sujith > > On Oct 9, 8:54 pm, mdipierro <[email protected]> wrote: > > > The error seems to be in viewcompany, it expects to find at least one > > record but the db is empty. This is an application error. > > > On Oct 8, 11:27 pm, Sujith <[email protected]> wrote: > > > > Hi > > > I have customized the Jobsite appliance. In the _ah/admin the > > > following tables are created: > > > web2py_session_init > > > web2py_tickets_init > > > > The other tables defined in the model are not getting created. > > > > On most of the pages, an Internal error is being generated. This is > > > one of the entries from web2py_tickets_init: > > > ****************************************** > > > (dp0 > > > S'output' > > > p1 > > > S'' > > > p2 > > > sS'layer' > > > p3 > > > S'/home/sujith/Desktop/wcj/applications/init/controllers/default.py' > > > p4 > > > sS'code' > > > p5 > > > S'<code object <module> at 0xa8ddf50, file "/home/sujith/Desktop/wcj/ > > > applications/init/controllers/default.py:viewcompany", line 8>' > > > p6 > > > sS'snapshot' > > > p7 > > > (dp8 > > > S'exception' > > > p9 > > > (dp10 > > > S'__hash__' > > > p11 > > > S"<method-wrapper '__hash__' of exceptions.IndexError object at > > > 0xa988cac>" > > > p12 > > > sS'__setattr__' > > > p13 > > > S"<method-wrapper '__setattr__' of exceptions.IndexError object at > > > 0xa988cac>" > > > p14 > > > sS'__reduce_ex__' > > > p15 > > > S'<built-in method __reduce_ex__ of exceptions.IndexError object at > > > 0xa988cac>' > > > p16 > > > sS'__getslice__' > > > p17 > > > S"<method-wrapper '__getslice__' of exceptions.IndexError object at > > > 0xa988cac>" > > > p18 > > > sS'__getitem__' > > > p19 > > > S"<method-wrapper '__getitem__' of exceptions.IndexError object at > > > 0xa988cac>" > > > p20 > > > sS'__setstate__' > > > p21 > > > S'<built-in method __setstate__ of exceptions.IndexError object at > > > 0xa988cac>' > > > p22 > > > sS'__reduce__' > > > p23 > > > S'<built-in method __reduce__ of exceptions.IndexError object at > > > 0xa988cac>' > > > p24 > > > sS'__str__' > > > p25 > > > S"<method-wrapper '__str__' of exceptions.IndexError object at > > > 0xa988cac>" > > > p26 > > > sS'args' > > > p27 > > > S"('list index out of range',)" > > > p28 > > > sS'__getattribute__' > > > p29 > > > S"<method-wrapper '__getattribute__' of exceptions.IndexError object > > > at 0xa988cac>" > > > p30 > > > sS'__class__' > > > p31 > > > S"<type 'exceptions.IndexError'>" > > > p32 > > > sS'__delattr__' > > > p33 > > > S"<method-wrapper '__delattr__' of exceptions.IndexError object at > > > 0xa988cac>" > > > p34 > > > sS'__repr__' > > > p35 > > > S"<method-wrapper '__repr__' of exceptions.IndexError object at > > > 0xa988cac>" > > > p36 > > > sS'__dict__' > > > p37 > > > S'{}' > > > p38 > > > sS'__doc__' > > > p39 > > > S"'Sequence index out of range.'" > > > p40 > > > sS'__init__' > > > p41 > > > S"<method-wrapper '__init__' of exceptions.IndexError object at > > > 0xa988cac>" > > > p42 > > > sS'__new__' > > > p43 > > > S'<built-in method __new__ of type object at 0x8142e60>' > > > p44 > > > ssS'evalue' > > > p45 > > > S'list index out of range' > > > p46 > > > sS'request' > > > p47 > > > (dp48 > > > S'function' > > > p49 > > > S"'viewcompany'" > > > p50 > > > sS'body' > > > p51 > > > S'<cStringIO.StringO object at 0xa3cd8c0>' > > > p52 > > > sS'wsgi' > > > p53 > > > S"<Storage {'start_response': <function <lambda> a...UTC', > > > 'PATH_INFO': '/init/default/viewcompany'}}>" > > > p54 > > > sS'extension' > > > p55 > > > S"'html'" > > > p56 > > > sS'vars' > > > p57 > > > S'<Storage {}>' > > > p58 > > > sS'cid' > > > p59 > > > S'None' > > > p60 > > > sS'url' > > > p61 > > > S'<gluon.html.XML object at 0xa40362c>' > > > p62 > > > sg27 > > > S'[]' > > > p63 > > > sS'controller' > > > p64 > > > S"'default'" > > > p65 > > > sS'cookies' > > > p66 > > > S"<SimpleCookie: csrftoken='9ffde5a05fb91ec51c4699...82' > > > sessionid='6ec993cc1ed48ab0c32215570c0854e7'>" > > > p67 > > > sS'tickets_db' > > > p68 > > > S"<SQLDB {'_lastsql': 'SELECT WHERE id = 1', '_db_...eobj': <class > > > 'gluon.contrib.gql.applicants'>}>}>" > > > p69 > > > sS'application' > > > p70 > > > S"'init'" > > > p71 > > > sS'ajax' > > > p72 > > > S'False' > > > p73 > > > sS'client' > > > p74 > > > S"'127.0.0.1'" > > > p75 > > > sS'env' > > > p76 > > > S"<Storage {'content_length': '', 'http_user_agent...': '', > > > 'path_info': '/init/default/viewcompany'}>" > > > p77 > > > sS'raw_args' > > > p78 > > > S'None' > > > p79 > > > sS'get_vars' > > > p80 > > > S'<Storage {}>' > > > p81 > > > sS'folder' > > > p82 > > > S"'/home/sujith/Desktop/wcj/applications/init/'" > > > p83 > > > sS'now' > > > p84 > > > S'datetime.datetime(2010, 10, 9, 4, 21, 27, 744517)' > > > p85 > > > sS'post_vars' > > > p86 > > > S'<Storage {}>' > > > p87 > > > ssS'frames' > > > p88 > > > (lp89 > > > (dp90 > > > S'file' > > > p91 > > > S'/home/sujith/Desktop/wcj/gluon/restricted.py' > > > p92 > > > sS'dump' > > > p93 > > > (dp94 > > > S'environment' > > > p95 > > > S"{'A': <class 'gluon.html.A'>, 'B': <class 'gluon.html.B'>, > > > 'BEAUTIFY': <class 'gluon.html.BEAUTIFY'>, 'BODY': <class > > > 'gluon.html.BODY'>, 'BR': <class 'gluon.html.BR'>, 'CENTER': <class > > > 'gluon.html.CENTER'>, 'CLEANUP': <class 'gluon.validators.CLEANUP'>, > > > 'CODE': <class 'gluon.html.CODE'>, 'CRYPT': <class > > > 'gluon.validators.CRYPT'>, 'DAL': <function DAL at 0xa719304>, ...}" > > > p96 > > > sS'ccode' > > > p97 > > > S'<code object <module> at 0xa8ddf50, file "/home/...init/controllers/ > > > default.py:viewcompany", line 8>' > > > p98 > > > ssS'lnum' > > > p99 > > > I188 > > > sS'lines' > > > p100 > > > (dp101 > > > I192 > > > S' # XXX Show exception in Wing IDE if running in debugger' > > > p102 > > > sI183 > > > S' if type(code) == types.CodeType:' > > > p103 > > > sI184 > > > S' ccode = code' > > > p104 > > > sI185 > > > S' else:' > > > p105 > > > sI186 > > > S' ccode = compile2(code,layer)' > > > p106 > > > sI187 > > > g2 > > > sI188 > > > S' exec ccode in environment' > > > p107 > > > sI189 > > > S' except HTTP:' > > > p108 > > > sI190 > > > S' raise' > > > p109 > > > sI191 > > > S' except Exception:' > > > p110 > > > ssS'call' > > > p111 > > > S'(code=<code object <module> at 0xa8ddf50, file "/home/...init/ > > > controllers/default.py:viewcompany", line 8>, environment={\'A\': > > > <class \'gluon.html.A\'>, \'B\': <class \'gluon.html.B\'>, \'BEAUTIFY > > > \': <class \'gluon.html.BEAUTIFY\'>, \'BODY\': <class \'gluon.html.BODY > > > \'>, \'BR\': <class \'gluon.html.BR\'>, \'CENTER\': <class > > > \'gluon.html.CENTER\'>, \'CLEANUP\': <class \'gluon.validators.CLEANUP > > > \'>, \'CODE\': <class \'gluon.html.CODE\'>, \'CRYPT\': <class > > > \'gluon.validators.CRYPT\'>, \'DAL\': <function DAL at > > > 0xa719304>, ...}, layer=\'/home/sujith/Desktop/wcj/applications/init/ > > > controllers/default.py\')' > > > p112 > > > sS'func' > > > p113 > > > S'restricted' > > > p114 > > > sa(dp115 > > > g91 > > > S'/home/sujith/Desktop/wcj/applications/init/controllers/ > > > default.py:viewcompany' > > > p116 > > > sg93 > > > (dp117 > > > sg99 > > > I222 > > > sg100 > > > (dp118 > > > sg111 > > > S'()' > > > p119 > > > sg113 > > > S'<module>' > > > p120 > > > sa(dp121 > > > g91 > > > S'/home/sujith/Desktop/wcj/gluon/globals.py' > > > p122 > > > sg93 > > > (dp123 > > > S'self' > > > p124 > > > S'undefined' > > > p125 > > > sS'f' > > > p126 > > > S'<function viewcompany at 0xa8c879c>' > > > p127 > > > ssg99 > > > I96 > > > sg100 > > > (dp128 > > > I96 > > > S' self._caller = lambda f: f()' > > > p129 > > > sI97 > > > S' self._view_environment = None' > > > p130 > > > sI98 > > > S' self._custom_commit = None' > > > p131 > > > sI99 > > > S' self._custom_rollback = None' > > > p132 > > > sI100 > > > g2 > > > sI91 > > > S" self.flash = '' # used by the default view layout" > > > p133 > > > sI92 > > > S' self.meta = Storage() # used by web2py_ajax.html' > > > p134 > > > sI93 > > > S' self.menu = [] # used by the default view layout' > > > p135 > > > sI94 > > > S' self.files = [] # used by web2py_ajax.html' > > > p136 > > > sI95 > > > S' self._vars = None' > > > p137 > > > ssg111 > > > S'(f=<function viewcompany at 0xa8c879c>)' > > > p138 > > > sg113 > > > S'<lambda>' > > > p139 > > > sa(dp140 > > > g91 > > > S'/home/sujith/Desktop/wcj/applications/init/controllers/ > > > default.py:viewcompany' > > > p141 > > > sg93 > > > (dp142 > > > sg99 > > > I22 > > > sg100 > > > (dp143 > > > sg111 > > > S'()' > > > p144 > > > sg113 > > > S'viewcompany' > > > p145 > > > sa(dp146 > > > g91 > > > S'/home/sujith/Desktop/wcj/gluon/sql.py' > > > p147 > > > sg93 > > > (dp148 > > > S'i' > > > p149 > > > S'0' > > > p150 > > > sS'self' > > > p151 > > > S'<gluon.sql.Rows object at 0xa98896c>' > > > p152 > > > sS'self.records' > > > p153 > > > S'[]' > > > p154 > > > sS'row' > > > p155 > > > g125 > > > ssg99 > > > I3605 > > > sg100 > > > (dp156 > > > I3600 > > > S' returns a list of sorted elements (not sorted in place)' > > > p157 > > > sI3601 > > > S' """' > > > p158 > > > sI3602 > > > S' return > > > Rows(self.db,sorted(self,key=f,reverse=reverse),self.colnames)' > > > p159 > > > sI3603 > > > g2 > > > sI3604 > > > S' def __getitem__(self, i):' > > > p160 > > > sI3605 > > > S' row = self.records[i]' > > > p161 > > > sI3606 > > > S' keys = row.keys()' > > > p162 > > > sI3607 > > > S" if self.compact and len(keys) == 1 and keys[0] != '_extra':" > > > p163 > > > sI3608 > > > S' return row[row.keys()[0]]' > > > p164 > > > sI3609 > > > S' return row' > > > p165 > > > ssg111 > > > S'(self=<gluon.sql.Rows object at 0xa98896c>, i=0)' > > > p166 > > > sg113 > > > g19 > > > sasS'pyver' > > > p167 > > > S'Python 2.5.5: /usr/bin/python2.5' > > > p168 > > > sS'session' > > > p169 > > > (dp170 > > > sS'etype' > > > p171 > > > S"<type 'exceptions.IndexError'>" > > > p172 > > > sS'date' > > > p173 > > > S'Sat Oct 9 04:21:27 > > ... > > read more »

