I have the exact same problem.  My database was created on an older
web2py and now I get this exception "undefined record" for a number of
my tables.  Like you, my application still runs, but I'm unable to
administer it using the database admin tool because of the walkbacks.
Even the default auth tables such as db.auth_membership result in an
error when I try to view them in database admin!

This is all using the built-in sqllite database and standard automatic
"auth" tables.  Here is an example of one of my own tables that now
fails to view in database admin:

db.define_table("signup",
      SQLField("id_team_member", db.team_member, label="Team member"),
      SQLField("id_meet_event", db.meet_event, label="Event"),
      SQLField("best_time", "double"),
      SQLField("course", "string", length=1, default='Y'),
      SQLField("leg", "integer"),
      SQLField("paid", "boolean", default=False))

Here is a complete traceback:

Traceback (most recent call last):
  File "/Users/molly/Work/web2py/gluon/restricted.py", line 178, in
restricted
    exec ccode in environment
  File "/Users/molly/Work/web2py/applications/swimnutz/views/
appadmin.html", line 100, in <module>
  File "/Users/molly/Work/web2py/gluon/globals.py", line 105, in write
    self.body.write(xmlescape(data))
  File "/Users/molly/Work/web2py/gluon/html.py", line 99, in xmlescape
    return data.xml()
  File "/Users/molly/Work/web2py/gluon/html.py", line 521, in xml
    (fa, co) = self._xml()
  File "/Users/molly/Work/web2py/gluon/html.py", line 512, in _xml
    self.components])
  File "/Users/molly/Work/web2py/gluon/html.py", line 99, in xmlescape
    return data.xml()
  File "/Users/molly/Work/web2py/gluon/html.py", line 521, in xml
    (fa, co) = self._xml()
  File "/Users/molly/Work/web2py/gluon/html.py", line 512, in _xml
    self.components])
  File "/Users/molly/Work/web2py/gluon/html.py", line 99, in xmlescape
    return data.xml()
  File "/Users/molly/Work/web2py/gluon/html.py", line 521, in xml
    (fa, co) = self._xml()
  File "/Users/molly/Work/web2py/gluon/html.py", line 512, in _xml
    self.components])
  File "/Users/molly/Work/web2py/gluon/html.py", line 99, in xmlescape
    return data.xml()
  File "/Users/molly/Work/web2py/gluon/html.py", line 521, in xml
    (fa, co) = self._xml()
  File "/Users/molly/Work/web2py/gluon/html.py", line 512, in _xml
    self.components])
  File "/Users/molly/Work/web2py/gluon/html.py", line 99, in xmlescape
    return data.xml()
  File "/Users/molly/Work/web2py/gluon/html.py", line 521, in xml
    (fa, co) = self._xml()
  File "/Users/molly/Work/web2py/gluon/html.py", line 512, in _xml
    self.components])
  File "/Users/molly/Work/web2py/gluon/html.py", line 99, in xmlescape
    return data.xml()
  File "/Users/molly/Work/web2py/gluon/sql.py", line 1462, in
__getattr__
    self.__allocate()
  File "/Users/molly/Work/web2py/gluon/sql.py", line 1457, in
__allocate
    raise Exception, "undefined record"
Exception: undefined record

On Apr 3, 5:44 pm, Kenneth <[email protected]> wrote:
> Last summer I started on an application that has been in use so far. I
> havn´t upgraded it because there was no need for it.
>
> Last month I started to do some serious updating of the code and the
> first thing I did was upgrading web2py. Everything has been working
> great so far, but two days ago I noticed something is wrong. I been
> pulling my hair out trying to find out why the application is not
> working. An hour ago i remembered that I indeed did an upgrade.
>
> Old version is 1.65.4 and new version is the newest one.
>
> Error message is:
> File "gluon/sql.py", line 1428, in __allocate
>     raise Exception, "undefined record"
>
> In paralell I´m still using the old version of the application so I
> took the whole old application and copied it to an new directory. Made
> a copy of the database och got the application to work. I tested that
> it is working and then I applied to the new version Web2py on it (just
> unzipped it and copied it on the old version). Application stopped
> working.
>
> Any ideas where to continue looking for the problem?
>
> Kenneth

Reply via email to