Attendance plugin install error with 3.3.1

Attendance plugin install error with 3.3.1

by Gregory Paraham -
Number of replies: 6

I'm getting the following error when attempting to install from attendance zip file. Our server manager installed 3.3.1 and now the mod_attforblock is showing "missing from disk."

I've read in docs that the new Attendance replaces/renames the old module. Here's the error (and thanks for any help you can offer):


Upgrading to new version

mod_attendance

×Debug info: Table 'mdl_attendance' already exists
CREATE TABLE mdl_attendance (
id BIGINT(10) NOT NULL auto_increment,
course BIGINT(10) NOT NULL DEFAULT 0,
name VARCHAR(255) COLLATE utf8mb4_unicode_ci,
grade BIGINT(10) NOT NULL DEFAULT 100,
timemodified BIGINT(10) NOT NULL DEFAULT 0,
intro LONGTEXT COLLATE utf8mb4_unicode_ci,
introformat SMALLINT(4) NOT NULL DEFAULT 0,
subnet VARCHAR(255) COLLATE utf8mb4_unicode_ci,
sessiondetailspos VARCHAR(5) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'left',
showsessiondetails TINYINT(1) NOT NULL DEFAULT 1,
CONSTRAINT PRIMARY KEY (id)
, KEY mdl_atte_cou2_ix (course)
)
ENGINE = InnoDB
DEFAULT COLLATE = utf8mb4_unicode_ci ROW_FORMAT=Compressed
COMMENT='Attendance module table'
;
CREATE TABLE mdl_attendance_sessions (
id BIGINT(10) NOT NULL auto_increment,
attendanceid BIGINT(10) NOT NULL DEFAULT 0,
groupid BIGINT(10) NOT NULL DEFAULT 0,
sessdate BIGINT(10) NOT NULL DEFAULT 0,
duration BIGINT(10) NOT NULL DEFAULT 0,
lasttaken BIGINT(10),
lasttakenby BIGINT(10) NOT NULL DEFAULT 0,
timemodified BIGINT(10),
description LONGTEXT COLLATE utf8mb4_unicode_ci NOT NULL,
descriptionformat TINYINT(2) NOT NULL DEFAULT 0,
studentscanmark TINYINT(1) NOT NULL DEFAULT 0,
studentpassword VARCHAR(50) COLLATE utf8mb4_unicode_ci DEFAULT '',
subnet VARCHAR(255) COLLATE utf8mb4_unicode_ci,
statusset MEDIUMINT(5) NOT NULL DEFAULT 0,
caleventid BIGINT(10) NOT NULL DEFAULT 0,
CONSTRAINT PRIMARY KEY (id)
, KEY mdl_attesess_att2_ix (attendanceid)
, KEY mdl_attesess_gro2_ix (groupid)
, KEY mdl_attesess_ses2_ix (sessdate)
, KEY mdl_attesess_cal_ix (caleventid)
)
ENGINE = InnoDB
DEFAULT COLLATE = utf8mb4_unicode_ci ROW_FORMAT=Compressed
COMMENT='attendance_sessions table retrofitted from MySQL'
;
CREATE TABLE mdl_attendance_log (
id BIGINT(10) NOT NULL auto_increment,
sessionid BIGINT(10) NOT NULL DEFAULT 0,
studentid BIGINT(10) NOT NULL DEFAULT 0,
statusid BIGINT(10) NOT NULL DEFAULT 0,
statusset VARCHAR(100) COLLATE utf8mb4_unicode_ci,
timetaken BIGINT(10) NOT NULL DEFAULT 0,
takenby BIGINT(10) NOT NULL DEFAULT 0,
remarks VARCHAR(255) COLLATE utf8mb4_unicode_ci,
CONSTRAINT PRIMARY KEY (id)
, KEY mdl_attelog_ses2_ix (sessionid)
, KEY mdl_attelog_stu2_ix (studentid)
, KEY mdl_attelog_sta2_ix (statusid)
)
ENGINE = InnoDB
DEFAULT COLLATE = utf8mb4_unicode_ci ROW_FORMAT=Compressed
COMMENT='attendance_log table retrofitted from MySQL'
;
CREATE TABLE mdl_attendance_statuses (
id BIGINT(10) NOT NULL auto_increment,
attendanceid BIGINT(10) NOT NULL DEFAULT 0,
acronym VARCHAR(2) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
description VARCHAR(30) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
grade NUMERIC(5,2) NOT NULL DEFAULT 0,
studentavailability BIGINT(10),
visible TINYINT(1) NOT NULL DEFAULT 1,
deleted TINYINT(1) NOT NULL DEFAULT 0,
setnumber MEDIUMINT(5) NOT NULL DEFAULT 0,
CONSTRAINT PRIMARY KEY (id)
, KEY mdl_attestat_att2_ix (attendanceid)
, KEY mdl_attestat_vis2_ix (visible)
, KEY mdl_attestat_del2_ix (deleted)
)
ENGINE = InnoDB
DEFAULT COLLATE = utf8mb4_unicode_ci ROW_FORMAT=Compressed
COMMENT='attendance_statuses table retrofitted from MySQL'
;
CREATE TABLE mdl_attendance_tempusers (
id BIGINT(10) NOT NULL auto_increment,
studentid BIGINT(10),
courseid BIGINT(10),
fullname VARCHAR(100) COLLATE utf8mb4_unicode_ci,
email VARCHAR(100) COLLATE utf8mb4_unicode_ci,
created BIGINT(10),
CONSTRAINT PRIMARY KEY (id)
, KEY mdl_attetemp_cou_ix (courseid)
, UNIQUE KEY mdl_attetemp_stu_uix (studentid)
)
ENGINE = InnoDB
DEFAULT COLLATE = utf8mb4_unicode_ci ROW_FORMAT=Compressed
COMMENT='Stores temporary users details'
Error code: ddlexecuteerror
×Stack trace:
  • line 492 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown
  • line 1000 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 77 of /lib/ddl/database_manager.php: call to mysqli_native_moodle_database->change_database_structure()
  • line 425 of /lib/ddl/database_manager.php: call to database_manager->execute_sql_arr()
  • line 370 of /lib/ddl/database_manager.php: call to database_manager->install_from_xmldb_structure()
  • line 702 of /lib/upgradelib.php: call to database_manager->install_from_xmldb_file()
  • line 444 of /lib/upgradelib.php: call to upgrade_plugins_modules()
  • line 1754 of /lib/upgradelib.php: call to upgrade_plugins()
  • line 699 of /admin/index.php: call to upgrade_noncore()


Average of ratings: -
In reply to Gregory Paraham

Re: Attendance plugin install error with 3.3.1

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

The attendance plugin was renamed from "attforblock" to "attendance" a long time ago - it sounds like you haven't updated your site for a long time.

support for upgrading from the old attforblock code has been dropped in the latest versions of the code. The latest version of the attendance code that supported upgrading from attforblock was the version released for Moodle 2.7

you can get that from here:
https://github.com/danmarsden/moodle-mod_attendance/archive/MOODLE_27_STABLE.zip

You could try upgrading to that version first - then replace the moodle 2.7 attendance code with the latest version for your release.

In reply to Dan Marsden

Re: Attendance plugin install error with 3.3.1

by Gregory Paraham -

The installer you suggested is looking for the old attforblock table, which didn’t make it to the new installation apparently.

 

Is there another way to install the new attendance module?

 

(Edited by Dan Marsden - removing email footer - original submission Saturday, 5 August 2017, 3:42 AM)

In reply to Gregory Paraham

Re: Attendance plugin install error with 3.3.1

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

sounds like someone may have been making changes directly to the database instead of using the correct upgrade procedures.

you might need to:

delete all the mdl_attendance_* tables
delete the records in mdl_config_plugins where plugin = 'mod_attendance'
delete the records in mdl_modules where plugin = 'attendance'

then do the same for the mdl_attforblock

If you have existing records/data that you do not want to lose you could contact me privately and I can provide an estimate on the costs for my time to fix your database.

Good luck!

In reply to Dan Marsden

Re: Attendance plugin install error with 3.3.1

by Gregory Paraham -

Thank Dan.

I believe there was a setting on our new production server that was preventing the normal installation.


Our server manager got the plugin to work.


Greg Paraham

(Edited by Dan Marsden - removing email footer, original submission Tuesday, 15 August 2017, 2:46 AM)

In reply to Gregory Paraham

Re: Attendance plugin install error with 3.3.1

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

great to hear you have it sorted!