Dataform preset error cannot_precheck_wrong_status

Dataform preset error cannot_precheck_wrong_status

by Ajay P -
Number of replies: 12
When applying a preset to a newly created Dataform 2.7 resource in Moodle 2.7.1, the error occurs (full debugging):

At the top of the html:

Not a zip archive.: /home/ccg/moodledata/filedir/1e/69/1e69367645920c5e06fee5d762804da3fcb4a1ea

  • line 133 of /lib/filestorage/zip_archive.php: call to debugging()
  • line 278 of /lib/filestorage/zip_packer.php: call to zip_archive->open()
  • line 536 of /lib/filestorage/stored_file.php: call to zip_packer->extract_to_pathname()
  • line 386 of /mod/dataform/classes/preset_manager.php: call to stored_file->extract_to_pathname()
  • line 225 of /mod/dataform/classes/preset_manager.php: call to mod_dataform_preset_manager->apply_preset()
  • line 53 of /mod/dataform/preset/index.php: call to mod_dataform_preset_manager->process_presets()
and in the Moodle page:

error/cannot_precheck_wrong_status

More information about this error

Debug info:
Error code: cannot_precheck_wrong_status
$a contents: 200
Stack trace:
  • line 371 of /backup/controller/restore_controller.class.php: restore_controller_exception thrown
  • line 404 of /mod/dataform/classes/preset_manager.php: call to restore_controller->execute_precheck()
  • line 225 of /mod/dataform/classes/preset_manager.php: call to mod_dataform_preset_manager->apply_preset()
  • line 53 of /mod/dataform/preset/index.php: call to mod_dataform_preset_manager->process_presets()
This error occurs when importing from file or applying from course or site presets.

Thanks for all that you are doing!


Average of ratings: -
In reply to Ajay P

Re: Dataform preset error cannot_precheck_wrong_status

by Itamar Tzadok -

A simple scenario of creating a preset of an existing Dataform, then creating a new Dataform in the course and applying the preset to it, seems to work. Can you confirm that such a scenario works in your Moodle? If that's the case then it might be something with the preset you are trying to apply. smile

In reply to Itamar Tzadok

Re: Dataform preset error cannot_precheck_wrong_status

by Ajay P -

Just to be sure, I recreated the Dataform then saved the preset, then shared it site-wide.  I created a new Dataform in another course and applied the site preset.  The same error occurred.

The idea of this Dataform activity is to provide an area for students to upload their work for trainers to review or assess, as discussed in other threads for this activity.

I've attached the preset mbz file for reference.

In reply to Ajay P

Re: Dataform preset error cannot_precheck_wrong_status

by Itamar Tzadok -

Your preset indeed fails but at this point I don't know why. I've extended the preset behat test and it passes. I thought that the problem could be with the access rules but that seems to pass too.

Can you try with a simple Dataform activity, say, 1 view no fields? If this doesn't work it may be something in your environment.

smile

In reply to Ajay P

Re: Dataform preset error cannot_precheck_wrong_status

by Itamar Tzadok -

Also, the problem seems to be that the file doesn't open, and if it doesn't open then restore precheck is bound to fail. So we need to check if this happens with every Dataform preset you create in your moodle. smile

In reply to Itamar Tzadok

Re: Dataform preset error cannot_precheck_wrong_status

by Ajay P -
Thanks so much for your suggestions and support. 

I created a test dataform with no fields and one view and then saved the preset.    I then created another dataform and immediately applied the preset.  The same error occured.  I've attached the preset mbz file for reference.

I tidied up and purged all caches but no improvement.  It does look like some issue with our environment.

In Server checks, there are four warnings:
php_extension     xmlrpc     should be installed and enabled for best results.  The xmlrpc extension is needed for hub communication, and useful for web services and Moodle networking.    Check
php_extension     soap     should be installed and enabled for best results.  Installing the optional SOAP extension is useful for web services and some plugins.    Check
php_extension     intl     should be installed and enabled for best results.  Intl extension is used to improve internationalization support, such as locale aware sorting.    Check
php_setting     opcache.enable     PHP setting should be changed.  PHP opcode caching improves performance and lowers memory requirements, OPcache extension is recommended and fully supported.  Check
In reply to Ajay P

Re: Dataform preset error cannot_precheck_wrong_status

by Ajay P -
Did the latest test confirm anything for the devs?  Can you suggest folders/files where permissions should be checked for the presets?

This is an active Moodle installation, about three years old and everything else seems to be working well.

Thanks in anticipation.
In reply to Ajay P

Re: Dataform preset error cannot_precheck_wrong_status

by Itamar Tzadok -

The preset file you've attached does not seem to have the proper structure. It seems to be archived twice, one time too many. Try the preset attached here and let me know if it worked. smile

In reply to Itamar Tzadok

Re: Dataform preset error cannot_precheck_wrong_status

by Ajay P -

Thankyou!  Your preset file worked.  Do you have any ideas about how the presets are getting 'double wrapped'?


In reply to Ajay P

Re: Dataform preset error cannot_precheck_wrong_status

by Itamar Tzadok -

No idea. The dataform preset uses the core backup/restore component and creating a preset creates a standard activity backup file. Have you tried to do course or activity backup via the standard administration navigation to see if the standard backup generates valid backup files? smile

In reply to Itamar Tzadok

Re: Dataform preset error cannot_precheck_wrong_status

by Ajay P -
Yes, I have backed up and restored before, however I did this again to check, as we've just upgraded to v2.7.1.  The result was that the backup and restore operations worked from the standard administration navigation, using the mbz file.

Cheers - Andrew
In reply to Itamar Tzadok

Re: Dataform preset error cannot_precheck_wrong_status

by Ajay P -

As per your logical instructions I downloaded the preset, extracted the inner archive file, added to the file name the mbz type extension and uploaded it to the presets list.  Unfortunately I got the same error.  I've uploaded this 'inner' archive for reference.

In this archive, you can see the file structure, so I was very hopeful that it would work!

Thanks again as always!

In reply to Ajay P

Re: Dataform preset error cannot_precheck_wrong_status

by Itamar Tzadok -

You're righ, it doesn't work. A workaround that does seem to work (have just tried it) is to extract all the backup files from the inner file, zip them, change the extension from zip to mbz, and then upload the preset. smile

Average of ratings: Useful (1)