Looking at the traceback, you are trying to access a broken reference
from a view. Something like

{{=row.user.first_name}}

where row.user is user id and web2py needs a db query to find the
first_name of the user. If the user does not exit, web2py cannot
determine his first name.

What puzzles me is that in you case the view is
/Users/molly/Work/web2py/applications/swimnutz/views/appadmin.html

appadmin by default does not do anything like {{=row.user.first_name}}
but it may if a field has a represent= attribute and a field has one
if the table referred_by has a format= attribute.

So try this... for all define_table(...format="something") set
format=None. The error should go away and you should be able to see
what the records contain.


On May 9, 1:25 pm, Joe  Barnhart <joe.barnh...@gmail.com> wrote:
> 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 <kenneth.t.lundst...@gmail.com> 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