Problem activating Reporting module v1.09 with Gibbon v11

Hi folks,

When trying to activate the reporting module a lengthy error message appears. I have added the beginning of the error message below. Hope this will help.

Any ideas?

Kind regards
Roman

Install failed, but module was added to the system and set non-active.

The following SQL statements caused errors: DROP TABLE IF EXISTS arrCriteria; CREATE TABLE arrCriteria ( criteriaID int(10) unsigned NOT NULL AUTO_INCREMENT, subjectID int(10) unsigned zerofill NOT NULL, criteriaName varchar(255) NOT NULL, criteriaOrder tinyint(3) unsigned NOT NULL, timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (criteriaID) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.

DROP TABLE IF EXISTS arrReport; CREATE TABLE arrReport ( reportID int(10) unsigned NOT NULL AUTO_INCREMENT, schoolYearID int(3) unsigned zerofill NOT NULL, reportName varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, reportNum tinyint(3) unsigned NOT NULL DEFAULT ‘1’, reportOrder tinyint(4) DEFAULT NULL, gradeScale int(10) unsigned DEFAULT NULL, timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (reportID), UNIQUE KEY schoolYearID (schoolYearID,reportName), KEY reportNum (reportNum) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.

DROP TABLE IF EXISTS arrReportAssign; CREATE TABLE arrReportAssign ( reportAssignID int(10) unsigned NOT NULL AUTO_INCREMENT, schoolYearID int(3) unsigned zerofill NOT NULL, yearGroupID int(3) unsigned zerofill NOT NULL, reportID int(10) NOT NULL, assignStatus tinyint(1) NOT NULL, timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (reportAssignID), UNIQUE KEY yearGroupID (yearGroupID,reportID,schoolYearID) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.

DROP TABLE IF EXISTS arrReportGrade; CREATE TABLE arrReportGrade ( reportGradeID int(10) unsigned NOT NULL AUTO_INCREMENT, reportID int(10) unsigned DEFAULT NULL, criteriaID int(10) unsigned NOT NULL, studentID int(10) unsigned NOT NULL, gradeID int(10) unsigned NOT NULL, timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (reportGradeID), UNIQUE KEY criteriaID (studentID,criteriaID) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.

DROP TABLE IF EXISTS arrReportSection; CREATE TABLE arrReportSection ( sectionID int(10) unsigned NOT NULL AUTO_INCREMENT, reportID int(10) unsigned DEFAULT NULL, sectionType int(10) unsigned DEFAULT NULL, sectionOrder int(10) unsigned DEFAULT NULL, timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (sectionID) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.

DROP TABLE IF EXISTS arrReportSectionDetail; CREATE TABLE arrReportSectionDetail ( reportSectionDetailID int(10) unsigned NOT NULL AUTO_INCREMENT, sectionID int(10) unsigned DEFAULT NULL, sectionContent text, timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (reportSectionDetailID), UNIQUE KEY sectionID (sectionID) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.

DROP TABLE IF EXISTS arrReportSectionType; CREATE TABLE arrReportSectionType ( reportSectionTypeID int(11) NOT NULL AUTO_INCREMENT, sectionTypeName varchar(45) DEFAULT NULL, timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (reportSectionTypeID) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; INSERT INTO arrReportSectionType (reportSectionTypeID, sectionTypeName) VALUES (1, ‘Text’), (2, ‘Subject’), (3, ‘Pastoral’), (4, ‘Page Break’);
SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.

DROP TABLE IF EXISTS arrReportStatus; CREATE TABLE arrReportStatus ( reportAssignID int(10) unsigned NOT NULL AUTO_INCREMENT, reportID int(10) NOT NULL, roleID int(10) unsigned NOT NULL, assignStatus tinyint(1) NOT NULL, timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (reportAssignID), UNIQUE KEY reportID (reportID,roleID) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.

DROP TABLE IF EXISTS arrReportSubject; CREATE TABLE arrReportSubject ( reportSubjectID int(10) unsigned NOT NULL AUTO_INCREMENT, studentID int(10) unsigned zerofill NOT NULL, subjectID int(10) unsigned NOT NULL, classID int(8) unsigned zerofill NOT NULL, reportID int(10) unsigned NOT NULL, subjectComment text, teacherID int(10) unsigned DEFAULT NULL, timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (reportSubjectID), UNIQUE KEY arrPersonID (studentID,reportID,subjectID) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.

[…]

Meierrom,

The problem here is that the SQL statements in the installer are doubled up, with two statements where there should be one. This does not seem to be a problem in most installs, as we have had no complains so far, so I guess this is a setting somewhere in your PHP or MySQL setup.

However, a quick fix is to open manifest.php in the Reporting module folder, and remove all the DROP TABLE IF EXISTS statements. So, for example, the statement starting on line 31 goes from:

$moduleTables[0] = “DROP TABLE IF EXISTS arrArchive;
    CREATE TABLE arrArchive (
    archiveID int(10) unsigned NOT NULL AUTO_INCREMENT,
    studentID int(10) unsigned NOT NULL,
    reportID int(10) unsigned NOT NULL,
    reportName varchar(255) NOT NULL,
    created datetime NOT NULL,
    firstDate datetime NOT NULL,
    lastDate datetime NOT NULL,
    timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (archiveID),
    UNIQUE KEY studentID (studentID,reportID)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;”;

to

$moduleTables[0] = “CREATE TABLE arrArchive (
    archiveID int(10) unsigned NOT NULL AUTO_INCREMENT,
    studentID int(10) unsigned NOT NULL,
    reportID int(10) unsigned NOT NULL,
    reportName varchar(255) NOT NULL,
    created datetime NOT NULL,
    firstDate datetime NOT NULL,
    lastDate datetime NOT NULL,
    timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (archiveID),
    UNIQUE KEY studentID (studentID,reportID)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;”;

If you uninstall the module, then reinstall it after making the changes above (there should be 11 occurences), then it should work.

I am tagging the maker of this unit, @andystat, here, as he may wish to follow up.

Ross


Suggested quick fix worked perfectly!

Thanks Ross.

Hi Ross,

I tried to install the same report module under v12dev. Before doing so I did the changes discussed above. I noticed that the first part is processed well and 8 tables are correctly created. Then processing fails with the following error messages. I just pasted the first part.

Install failed, but module was added to the system and set non-active.

The following SQL statements caused errors: CREATE TABLE arrReportStatus ( reportAssignID int(10) unsigned NOT NULL AUTO_INCREMENT, reportID int(10) NOT NULL, roleID int(10) unsigned NOT NULL, assignStatus tinyint(1) NOT NULL, timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (reportAssignID), UNIQUE KEY reportID (reportID,roleID) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.

CREATE TABLE arrReportSubject ( reportSubjectID int(10) unsigned NOT NULL AUTO_INCREMENT, studentID int(10) unsigned zerofill NOT NULL, subjectID int(10) unsigned NOT NULL, classID int(8) unsigned zerofill NOT NULL, reportID int(10) unsigned NOT NULL, subjectComment text, teacherID int(10) unsigned DEFAULT NULL, timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (reportSubjectID), UNIQUE KEY arrPersonID (studentID,reportID,subjectID) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.

CREATE TABLE arrStatus ( statusID int(10) unsigned NOT NULL AUTO_INCREMENT, reportID int(10) NOT NULL, roleID int(3) unsigned zerofill NOT NULL, reportStatus tinyint(4) NOT NULL, timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (statusID), UNIQUE KEY reportID (reportID,roleID) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.

INSERT INTO gibbonAction SET gibbonModuleID=:gibbonModuleID, name=:name, precedence=:precedence, category=:category, description=:description, URLList=:URLList, entryURL=:entryURL, entrySidebar=:entrySidebar, defaultPermissionAdmin=:defaultPermissionAdmin, defaultPermissionTeacher=:defaultPermissionTeacher, defaultPermissionStudent=:defaultPermissionStudent, defaultPermissionParent=:defaultPermissionParent, defaultPermissionSupport=:defaultPermissionSupport, categoryPermissionStaff=:categoryPermissionStaff, categoryPermissionStudent=:categoryPermissionStudent, categoryPermissionParent=:categoryPermissionParent, categoryPermissionOther=:categoryPermissionOther
SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.

[…]

Kind regards,
Roman

Roman,

I just tried the latest version of Reporting from https://gibbonedu.org/extend on a clean install of v12 and it worked fine. Are you sure you don’t have any remnants of a previous Reporting install (like left over tables…I notice that Gibbon’s feature to remove old tables on module uninstall don’t work with Reporting, presumably to do with the way it creates its module…I will look into this!).

Thanks,

Ross

Hi Ross,

Well, I’m quite sure not having remnants hanging around. In fact, I have not installed the reporting module on my 12dev before.

Let me do a few more tests e.g. as you are suggesting with a clean install. I’ll then report back to you.

Kind regards,
Roman

Roman, try the latest Reporting, v1.12, which has improved uninstalling. Put the code in, then use Admin > System Admin > Manage Modules to uninstall it and reinstall it.

Ross

Hi Ross,

I tried the latest version as you suggested. It did non solve my problem. The error messages are identical.

Give me one or two days to do a few tests and report back to you.

Kind regards,
Roman

Hi Ross,

As you suggested I did a clean install of v12. I used an older version I had. The error message above is identical.

Yesterday I downloaded the latest version of v12. I wasn’t able to run it. More info here: https://ask.gibbonedu.org/discussion/778/error-message-with-cutting-edge#latest

That’s all I have for now…

Kind regards,
Roman

Roman,

As mentioned at https://ask.gibbonedu.org/discussion/778/error-message-with-cutting-edge#latest, I think this is a Windows-related issue, or possibly to do with the installer and detection of cutting edge code.

Ross

Hi Ross,

I switched to an linux server for further testing.

I still encounter problems with the cutting edge version I downloaded 2 days ago. Installation seems to go through smoothly but when I try to launch the Gibbon start page, I get a blank page. I think this may be a php related problem. I did no further tests/analysis with this version of cutting edge.

I then switched to an older version of cutting edge. As you suggested above I did a clean install. As expected installation of Gibbon went smoothly just like when I was doing installations on Wamp/Windows. I then proceeded with the installation of the latest reporting module v1.12. To my surprise installation worked perfectly. It seems that the reporting module has difficulties to install on Wamp/Windows. Should we report this to Andy Statham?

Kind regards,
Roman

Roman,

The version I tested was the very latest commit, and it worked with no issues, so perhaps your older version had an issue that was subsequently fixed, or perhaps there was a server config issue.

For Reporting, yes, if you can report the issue to Andy at Rapid36, I am sure he would appreciate it.

Thanks,

Ross

Hi Ross,

I have reported the issue to Andy. Let’s see what he comes up with.

Kind regards,
Roman