Strange Occurrence of error: sqlalchemy.orm.exc : No row was found for one()

461 views
Skip to first unread message

Michael Semcheski

unread,
Jan 4, 2011, 12:25:40 PM1/4/11
to turbo...@googlegroups.com
Hi,

I've got an interesting problem with a web app I'm working on.
Whenever I load a page, I get the error
"sqlalchemy.orm.exc.NoResultFound'>: No row was found for one()" in my
mail. (Courtesy of the very useful weberror middleware.)

What makes this strange is:
Every other indication is that there's no problem. The app works as I
expect it to, with no visual errors. I've identified the code in my
app that the middleware reports as responsible. In fact, it is
loading the contents for the page from the database, and if there were
an error, the page could not display correctly.

The problem only occurs in the production code (using mod_wsgi). In
the development version, using paster serve, there's no errors being
reported, and I'm reasonably sure that at this time production and
development are in sync, as are the database records.

Is there some flaw in my understanding of what's going on? I'm not
going to try to fix this by turning off the error, but every time
somebody hits the site I get an an email.

Mike

Diez Roggisch

unread,
Jan 4, 2011, 4:51:22 PM1/4/11
to turbo...@googlegroups.com
Please show the full traceback.

Diez


----Ursprüngliche Nachricht-----
Von: "Michael Semcheski" <mhsem...@gmail.com>
Gesendet: 04.01.2011 18:25:40
An: turbo...@googlegroups.com
Betreff: [TurboGears] Strange Occurrence of error: sqlalchemy.orm.exc : No row was found for one()

>--
>You received this message because you are subscribed to the Google Groups "TurboGears" group.
>To post to this group, send email to turbo...@googlegroups.com.
>To unsubscribe from this group, send email to turbogears+...@googlegroups.com.
>For more options, visit this group at http://groups.google.com/group/turbogears?hl=en.
>
___________________________________________________________
NEU: FreePhone - kostenlos mobil telefonieren und surfen!
Jetzt informieren: http://produkte.web.de/go/webdefreephone

Michael Semcheski

unread,
Jan 4, 2011, 5:12:28 PM1/4/11
to turbo...@googlegroups.com
On Tue, Jan 4, 2011 at 4:51 PM, Diez Roggisch <de...@web.de> wrote:
> Please show the full traceback.
>

I was getting ready to send the full traceback but wanted to obfuscate
the traceback a little so as not to reveal the true identity of the
site. (I don't mind sharing the URL, but I worried I might reveal a
vulnerability in my code that could be used in an attack on the site.)

That exercise allowed me to figure out the problem (by forcing me to
look at parts of the error I had skimmed over, namely the URL). The
actual page I was accessing was fine. But, there was a bad link to an
image in the site's basic framework. That translated into a request
which actually caused the error. Since every page load caused this
problem exactly once, I just assumed the URL was the same as I was
seeing in the browser's address bar.

Mea culpa.

Mike

Reply all
Reply to author
Forward
0 new messages