Bug 138071

Summary: ERROR: attachments_attach_id_seq.currval is not yet defined in this session
Product: [Community] Bugzilla Reporter: James Laska <jlaska>
Component: Bugzilla GeneralAssignee: David Lawrence <dkl>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.18CC: jturner, mmackenz
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-11-11 18:50:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 138111    

Description James Laska 2004-11-04 13:58:06 UTC
Trying to create a new bug, with an attachment I get the following software error:

Software error:

DBD::Pg::st execute failed: ERROR:  attachments_attach_id_seq.currval is not yet
defined in this session [for Statement "SELECT
currval('attachments_attach_id_seq')"] at Bugzilla/DBcompat.pm line 112
	Bugzilla::DBcompat::LastKey('attachments','attach_id') called at
/var/www/bugzilla/beta2/post_bug.cgi line 678

For help, please send mail to the webmaster (bugzilla), giving this
error message and the time and date of the error.

Comment 1 James Laska 2004-11-04 13:59:28 UTC
When I try to attach to the bug after it is filed ...

Software error:

DBD::Pg::st execute failed: ERROR:  attachments_attach_id_seq.currval is not yet
defined in this session [for Statement "SELECT
currval('attachments_attach_id_seq')"] at Bugzilla/DBcompat.pm line 112
	Bugzilla::DBcompat::LastKey('attachments','attach_id') called at
/var/www/bugzilla/beta2/attachment.cgi line 888
	main::insert('\x{89}PNG\x{d}\x{a}\x{1a}\x{a}\x{0}\x{0}\x{0}\x{d}IHDR\x{0}\x{0}\x{4}\x{0}\x{0}\x{0}\x{3}\x{0}\x{8}\x{2}\x{0}\x{0}\x{0}5\x{d8}\x{82}Z\x{0}\x{0}\x{0}\x{3}sBIT\x{8}\x{8}\x{8}\x{db}\x{e1}O\x{e0}\x{0}\x{0}
\x{0}IDATx\x{9c}\x{ec}\x{bd}_...') called at
/var/www/bugzilla/beta2/attachment.cgi line 125

For help, please send mail to the webmaster (bugzilla

Comment 2 David Lawrence 2004-11-04 18:47:33 UTC
Need to have fixed by beta3

Comment 3 David Lawrence 2004-11-04 19:36:23 UTC
(In reply to comment #0)
> Trying to create a new bug, with an attachment I get the following software error:
> 
> Software error:
> 
> DBD::Pg::st execute failed: ERROR:  attachments_attach_id_seq.currval is not yet
> defined in this session [for Statement "SELECT
> currval('attachments_attach_id_seq')"] at Bugzilla/DBcompat.pm line 112
> 	Bugzilla::DBcompat::LastKey('attachments','attach_id') called at
> /var/www/bugzilla/beta2/post_bug.cgi line 678
> 
> For help, please send mail to the webmaster (bugzilla), giving this
> error message and the time and date of the error.


If you visit this bug did the attachment actually get added to the new bug? What
is the bug number?

Comment 4 David Lawrence 2004-11-04 19:48:40 UTC
Found the reason for the error message, strange how it doesnt happen all the
time.  Somehow the session is ending before the get last id key is being called.

Explanation:

You attempted to execute <sequence name>.CURRVAL before using <sequence
name>.NEXTVAL in the current session.

User Action:

Execute <sequence name>.NEXTVAL before executing <sequence name>.CURRVAL

Comment 5 David Lawrence 2004-11-11 18:33:50 UTC
Ping

Comment 6 James Laska 2004-11-11 18:43:11 UTC
did you change anything?  It seems to have worked when I tried this yesterday
(or day before).

Comment 7 David Lawrence 2004-11-11 18:50:29 UTC
I have changed the way LastKey() behaves which may help with this since it was
working in differnt section of code instead of the same db handle that was in
post_bug.cgi. So we will close this and reopen if you see it again.