This is a known problem with the web based shell likely due to
database timeout.
Do not use the web shell for db operations. Instead use a the regular
shell:

python web2py.py -S yourapp -M -N

until we figure out why the db gets closed.

On Sep 3, 2:45 am, Geo <geo.petr...@gmail.com> wrote:
> All this web2py is new for me so it's likely that I messed up
> something.
> It's all part of a monitoring page where I can check the processes
> running on the server.
>
> from: applications\monitor\views\default\index.html
> I call:
> {{=TD(LOAD(url=URL(r=request,f='getProcesStatus',args=proces_key),
> ajax=True))}}
>
> the getProcesStatus is in applications\monitor\controllers\default.py
>
> which calls getProcess(command_line=proces_cmd) from applications
> \monitor\models\monitor.py
>
> which calls updateProcessesList() from applications\monitor\models
> \processes.py
>
> updateProcessesList() checks an update time stored in
> monitordb.updates (the last update time of the processes list stored
> in another table: monitordb.processes ), and if needed uses WMI to get
> the list of processes and update the db
>
> also, the table used to cache the processes list is defined as
> follows:
> monitordb.define_table('processes',
>                         Field('processid'),
>                         Field('parentprocessid'),
>                         Field('creationdate'),
>                         Field('name'),
>                         Field('commandline'),
>                         Field('updatetime')
>                       )
>
> and I have the same "OperationalError: no such table:" problem
> described above when I try to execute:
> monitordb.processes.insert(**process_details)
>
> from shell:
> monitordb.processes.insert(**process_details)
> or
> monitordb.processes.truncate()
>
> return
>
> Traceback (most recent call last):
>   File "<input>", line 1, in <module>
>   File "C:\LOCALWORKS\python\web2py\gluon\sql.py", line 2005, in
> insert
>     self._db._execute(query)
>   File "C:\LOCALWORKS\python\web2py\gluon\sql.py", line 947, in
> <lambda>
>     self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> ProgrammingError: Cannot operate on a closed database.
>
> Am I over complicating everything?

Reply via email to