Forums

500 Internal Server Error - No Such Table

My program (bottle app) ran fine on my computer, but when I run it on PA as a webapp I get a 500 error. In the logs it says it can't find the one table the default page loads.

I ran a test script in console to read the SQLite database and it was able to read the database file just fine, and the table is there.

The bottle app can find the database just fine (tested this) but it is still not loading the table. Any thoughts?

We've often seen problems like this when people don't specify a full path to their database. Can you try it with a full, absolute path, eg /home/myusername/path/to/my-database.sqlite, instead of just database.sqlite? And then you may need to re-run any database initialisation code?

Added in the full path to all the database calls and now I still get the 500 error, but in the log it states "OperationalError: unable to open database file".

Is the database definitely there? Have you run whatever creation script you need to on it? Can you open it up with sqlite3 manually?

The .db file is there. I ran a test script in console to read the database and print out the contents and it worked, just isn't working within the webapp for some reason.

Can I take a look at your code? We can see it from our side, but we never look without permission.

Yes you can look through it, probably something minor that I forgot. Thanks!

Looks like you're missing the leading slash from the path your providing for the database file -- that is, you're using "home/mrh5028/something/database.db" when you should be using "/home/mrh5028/something/database.db"

Whoops, knew it was something like that. Page loaded, but without the template. Getting closer.

Scratch that, fixed it. Thanks for the help!

Great! Glad we could help :-)