Edgewall Software
Modify

Opened 16 years ago

Closed 16 years ago

#5337 closed defect (fixed)

ProgrammingError: Cannot operate on a closed database.

Reported by: ddorothy@… Owned by: Christian Boos
Priority: high Milestone: 0.11
Component: ticket system Version: devel
Severity: minor Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I am running revision r5443 from trunk. I just updated today to verify that this was not corrected.

All my environments were upgraded from 0.10 (not sure if this relates) and use SqlLite.

All but one environment do not use custom fields on the tickets and work fine. The one environment using a custom field throws the following error:

2007-05-19 14:26:43,752 Trac[__init__] ERROR: Cannot operate on a closed database.
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r5443-py2.4.egg/trac/web/main.py", line 428, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r5443-py2.4.egg/trac/web/main.py", line 216, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r5443-py2.4.egg/trac/ticket/web_ui.py", line 124, in process_request
    return self._process_ticket_request(req)
  File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r5443-py2.4.egg/trac/ticket/web_ui.py", line 375, in _process_ticket_request
    self._do_save(context)
  File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r5443-py2.4.egg/trac/ticket/web_ui.py", line 781, in _do_save
    context.db.commit()
ProgrammingError: Cannot operate on a closed database.

I checked to make sure that context.db was an existing object and it is both before and after line 776.

I was able to work around this by setting lines 776 to read the following:

        if ticket.save_changes(get_reporter_id(req, 'author'),
                               req.args.get('comment'), when=now,
                               db=None, cnum=internal_cnum):

and then I commented out the following line that calls context.db.commit() .

I do not believe that this is the correct solution or I would post a diff. Any assistance on correcting this properly would be appreciated.

Attachments (0)

Change History (5)

comment:1 by Christian Boos, 16 years ago

Owner: changed from Jonas Borgström to Christian Boos

It seems I have an issue with custom fields as well, but on new tickets… Probably not a big deal, I'll look into it tomorrow.

comment:2 by Christian Boos, 16 years ago

I couldn't reproduce it…

Can you please:

  • try again with latest trunk
  • specify if you're using plugins, and then which ones?
  • mention the versions of sqlite and its binding used (see you /about page in admin mode)
  • help to reproduce the issue, like showing us how your [ticket-custom] looks like

comment:3 by ddorothy@…, 16 years ago

I believe this is the information that you need ([REMOVED] indicates that I cannot give you that information):

System Information
Trac: 	0.11dev-r5443
Python: 	2.4.4 (#1, Apr 5 2007, 20:09:06) [GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)]
setuptools: 	0.6c3
SQLite: 	3.3.7
pysqlite: 	2.3.2
Genshi: 	0.5dev-r579
jQuery:	1.1.2
Configuration
Section 	Name 	Value
components 	wwrecentchanges.* 	enabled
wwtitleindex.* 	enabled
header_logo 	link 	http://www.worthwhile.com
src 	site/logo.gif
logging 	log_type 	file
notification 	smtp_always_cc 	ddorothy@worthwhile.com, [REMOVED]
smtp_default_domain 	[REMOVED]
smtp_enabled 	true
smtp_from 	trac@worthwhile.com
smtp_replyto 	ddorothy@worthwhile.com
smtp_server 	[REMOVED]
project 	descr 	The [REMOVED] Project
name 	[REMOVED]
ticket 	default_milestone 	5/1/2007-7/1/2007 BLS Requested
ticket-custom 	phase 	select
phase.label 	Current Phase
phase.options 	New|Development|Testing|Live
phase.value 	0

I am using 2 custom plugins that affect the wiki and changesets. (They allowed me to give some custom permissions but should not be affecting the ticket piece).

Below is my [ticket-custom]:

[ticket-custom]
phase = select
phase.label = Current Phase
phase.options = New|Development|Testing|Live
phase.value = 0

Is there a way to see if a connection is open or not? If so I could attempt to do some more debugging on my own to try to pinpoint the source of the problem. (I looked in the documentation but could not find this info)

Thanks.

comment:4 by Christian Boos, 16 years ago

Priority: normalhigh
Summary: When using custom fields, cannot comment ticketsProgrammingError: Cannot operate on a closed database.

Ok, I've been getting a few similar reports lately. I think it's because of r5401. Please try to see if it works again when you revert that change.

comment:5 by Christian Boos, 16 years ago

Resolution: fixed
Severity: normalminor
Status: newclosed

Yes, that was it. I reverted r5401 for now (r5466).

Please upgrade and feel free to reopen if it was not actually that.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.