← Back to team overview

mahara-contributors team mailing list archive

[Bug 1912705] [NEW] Task "export_process_queue" fails on cron run

 

Public bug reported:

When submissions are set to be archived before being released back to
the submitter, they are queued for export and an archived version is
created. This processed failed for us and we were given a hint in the
cron logs/output that the error was thrown at
`htdocs/artefact/comment/blocktype/comment/lib.php:111`.

Adding a `debug_print_backtrace()` to the file reveals more in the cron output:
```
[INF] 35 (lib/cron.php:190) Running core cron export_process_queue
#0  PluginBlocktypeComment::render_instance_export(BlockInstance Object ([BlockInstanceid] => 320133,[BlockInstanceblocktype] => comment,[BlockInst............[truncated]
    , html) called at [<siteroot>/mahara/htdocs/lib/mahara.php:1818]
#1  call_static_method(PluginBlocktypeComment, render_instance_export, BlockInstance Object ([BlockInstanceid] => 320133,[BlockInstanceblocktype] => comment,[BlockInst............[truncated]
    , html) called at [<siteroot>/mahara/htdocs/blocktype/lib.php:1351]
#2  BlockInstance->render_viewing(html, ) called at [<siteroot>/mahara/htdocs/lib/view.php:2290]
#3  View->build_column(3, 1, , html, ) called at [<siteroot>/mahara/htdocs/lib/view.php:2241]
#4  View->build_columns(3, , html, ) called at [<siteroot>/mahara/htdocs/lib/view.php:2182]
#5  View->build_rows(, html) called at [<siteroot>/mahara/htdocs/export/html/lib.php:479]
#6  PluginExportHtml->dump_view_export_data() called at [<siteroot>/mahara/htdocs/export/html/lib.php:242]
#7  PluginExportHtml->export() called at [<siteroot>/mahara/htdocs/export/lib.php:1015]
#8  PluginExportAll->export() called at [<siteroot>/mahara/htdocs/export/lib.php:704]
#9  export_process_queue() called at [<siteroot>/mahara/htdocs/lib/cron.php:198]
[WAR] 35 (lib/errors.php:536) [Error]: Call to a member function get() on null at <siteroot>/mahara/htdocs/artefact/comment/blocktype/comment/lib.php:112
Call stack (most recent first):
  * exception(object(Error)) at Unknown:0
A nonrecoverable error occurred. This probably means you have encountered a bug in the system
```

We were able to fix it by explicitly declaring `global $exporter;` in
`htdocs/export/lib.php:602` at the very start of the
`export_process_queue` function - please refer to attached patch.

It also affects portfolio exports when the "Export to queue" settings is
enabled in Configure site > Site options > Account settings.


------------------------------
Application/System version(s):
Mahara
$config->version = 2020013013;
$config->series = '20.04';
$config->release = '20.04.2';

OS
Ubuntu 18.04.5 LTS

DB
MySQL 5.7
------------------------------

** Affects: mahara
     Importance: Undecided
         Status: New


** Tags: bug cron export queue

** Patch added: "export_queue_fix.patch"
   https://bugs.launchpad.net/bugs/1912705/+attachment/5455339/+files/export_queue_fix.patch

** Description changed:

  When submissions are set to be archived before being released back to
  the submitter, they are queued for export and an archived version is
  created. This processed failed for us and we were given a hint in the
  cron logs/output that the error was thrown at
  `htdocs/artefact/comment/blocktype/comment/lib.php:111`.
  
  Adding a `debug_print_backtrace()` to the file reveals more in the cron output:
  ```
  [INF] 35 (lib/cron.php:190) Running core cron export_process_queue
  #0  PluginBlocktypeComment::render_instance_export(BlockInstance Object ([BlockInstanceid] => 320133,[BlockInstanceblocktype] => comment,[BlockInst............[truncated]
-     , html) called at [<siteroot>/mahara/htdocs/lib/mahara.php:1818]
+     , html) called at [<siteroot>/mahara/htdocs/lib/mahara.php:1818]
  #1  call_static_method(PluginBlocktypeComment, render_instance_export, BlockInstance Object ([BlockInstanceid] => 320133,[BlockInstanceblocktype] => comment,[BlockInst............[truncated]
-     , html) called at [<siteroot>/mahara/htdocs/blocktype/lib.php:1351]
+     , html) called at [<siteroot>/mahara/htdocs/blocktype/lib.php:1351]
  #2  BlockInstance->render_viewing(html, ) called at [<siteroot>/mahara/htdocs/lib/view.php:2290]
  #3  View->build_column(3, 1, , html, ) called at [<siteroot>/mahara/htdocs/lib/view.php:2241]
  #4  View->build_columns(3, , html, ) called at [<siteroot>/mahara/htdocs/lib/view.php:2182]
  #5  View->build_rows(, html) called at [<siteroot>/mahara/htdocs/export/html/lib.php:479]
  #6  PluginExportHtml->dump_view_export_data() called at [<siteroot>/mahara/htdocs/export/html/lib.php:242]
  #7  PluginExportHtml->export() called at [<siteroot>/mahara/htdocs/export/lib.php:1015]
  #8  PluginExportAll->export() called at [<siteroot>/mahara/htdocs/export/lib.php:704]
  #9  export_process_queue() called at [<siteroot>/mahara/htdocs/lib/cron.php:198]
  [WAR] 35 (lib/errors.php:536) [Error]: Call to a member function get() on null at <siteroot>/mahara/htdocs/artefact/comment/blocktype/comment/lib.php:112
  Call stack (most recent first):
-   * exception(object(Error)) at Unknown:0
+   * exception(object(Error)) at Unknown:0
  A nonrecoverable error occurred. This probably means you have encountered a bug in the system
  ```
  
  We were able to fix it by explicitly declaring `global $exporter;` in
  `htdocs/export/lib.php:602` at the very start of the
  `export_process_queue` function - please refer to attached patch.
  
  
+ ------------------------------
  Application/System version(s):
  Mahara
  $config->version = 2020013013;
  $config->series = '20.04';
  $config->release = '20.04.2';
  
  OS
  Ubuntu 18.04.5 LTS
  
  DB
  MySQL 5.7
+ ------------------------------

** Description changed:

  When submissions are set to be archived before being released back to
  the submitter, they are queued for export and an archived version is
  created. This processed failed for us and we were given a hint in the
  cron logs/output that the error was thrown at
  `htdocs/artefact/comment/blocktype/comment/lib.php:111`.
  
  Adding a `debug_print_backtrace()` to the file reveals more in the cron output:
  ```
  [INF] 35 (lib/cron.php:190) Running core cron export_process_queue
  #0  PluginBlocktypeComment::render_instance_export(BlockInstance Object ([BlockInstanceid] => 320133,[BlockInstanceblocktype] => comment,[BlockInst............[truncated]
      , html) called at [<siteroot>/mahara/htdocs/lib/mahara.php:1818]
  #1  call_static_method(PluginBlocktypeComment, render_instance_export, BlockInstance Object ([BlockInstanceid] => 320133,[BlockInstanceblocktype] => comment,[BlockInst............[truncated]
      , html) called at [<siteroot>/mahara/htdocs/blocktype/lib.php:1351]
  #2  BlockInstance->render_viewing(html, ) called at [<siteroot>/mahara/htdocs/lib/view.php:2290]
  #3  View->build_column(3, 1, , html, ) called at [<siteroot>/mahara/htdocs/lib/view.php:2241]
  #4  View->build_columns(3, , html, ) called at [<siteroot>/mahara/htdocs/lib/view.php:2182]
  #5  View->build_rows(, html) called at [<siteroot>/mahara/htdocs/export/html/lib.php:479]
  #6  PluginExportHtml->dump_view_export_data() called at [<siteroot>/mahara/htdocs/export/html/lib.php:242]
  #7  PluginExportHtml->export() called at [<siteroot>/mahara/htdocs/export/lib.php:1015]
  #8  PluginExportAll->export() called at [<siteroot>/mahara/htdocs/export/lib.php:704]
  #9  export_process_queue() called at [<siteroot>/mahara/htdocs/lib/cron.php:198]
  [WAR] 35 (lib/errors.php:536) [Error]: Call to a member function get() on null at <siteroot>/mahara/htdocs/artefact/comment/blocktype/comment/lib.php:112
  Call stack (most recent first):
    * exception(object(Error)) at Unknown:0
  A nonrecoverable error occurred. This probably means you have encountered a bug in the system
  ```
  
  We were able to fix it by explicitly declaring `global $exporter;` in
  `htdocs/export/lib.php:602` at the very start of the
  `export_process_queue` function - please refer to attached patch.
  
+ It also affects portfolio exports when the "Export to queue" settings is
+ enabled in Configure site > Site options > Account settings.
+ 
  
  ------------------------------
  Application/System version(s):
  Mahara
  $config->version = 2020013013;
  $config->series = '20.04';
  $config->release = '20.04.2';
  
  OS
  Ubuntu 18.04.5 LTS
  
  DB
  MySQL 5.7
  ------------------------------

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1912705

Title:
  Task "export_process_queue" fails on cron run

Status in Mahara:
  New

Bug description:
  When submissions are set to be archived before being released back to
  the submitter, they are queued for export and an archived version is
  created. This processed failed for us and we were given a hint in the
  cron logs/output that the error was thrown at
  `htdocs/artefact/comment/blocktype/comment/lib.php:111`.

  Adding a `debug_print_backtrace()` to the file reveals more in the cron output:
  ```
  [INF] 35 (lib/cron.php:190) Running core cron export_process_queue
  #0  PluginBlocktypeComment::render_instance_export(BlockInstance Object ([BlockInstanceid] => 320133,[BlockInstanceblocktype] => comment,[BlockInst............[truncated]
      , html) called at [<siteroot>/mahara/htdocs/lib/mahara.php:1818]
  #1  call_static_method(PluginBlocktypeComment, render_instance_export, BlockInstance Object ([BlockInstanceid] => 320133,[BlockInstanceblocktype] => comment,[BlockInst............[truncated]
      , html) called at [<siteroot>/mahara/htdocs/blocktype/lib.php:1351]
  #2  BlockInstance->render_viewing(html, ) called at [<siteroot>/mahara/htdocs/lib/view.php:2290]
  #3  View->build_column(3, 1, , html, ) called at [<siteroot>/mahara/htdocs/lib/view.php:2241]
  #4  View->build_columns(3, , html, ) called at [<siteroot>/mahara/htdocs/lib/view.php:2182]
  #5  View->build_rows(, html) called at [<siteroot>/mahara/htdocs/export/html/lib.php:479]
  #6  PluginExportHtml->dump_view_export_data() called at [<siteroot>/mahara/htdocs/export/html/lib.php:242]
  #7  PluginExportHtml->export() called at [<siteroot>/mahara/htdocs/export/lib.php:1015]
  #8  PluginExportAll->export() called at [<siteroot>/mahara/htdocs/export/lib.php:704]
  #9  export_process_queue() called at [<siteroot>/mahara/htdocs/lib/cron.php:198]
  [WAR] 35 (lib/errors.php:536) [Error]: Call to a member function get() on null at <siteroot>/mahara/htdocs/artefact/comment/blocktype/comment/lib.php:112
  Call stack (most recent first):
    * exception(object(Error)) at Unknown:0
  A nonrecoverable error occurred. This probably means you have encountered a bug in the system
  ```

  We were able to fix it by explicitly declaring `global $exporter;` in
  `htdocs/export/lib.php:602` at the very start of the
  `export_process_queue` function - please refer to attached patch.

  It also affects portfolio exports when the "Export to queue" settings
  is enabled in Configure site > Site options > Account settings.

  
  ------------------------------
  Application/System version(s):
  Mahara
  $config->version = 2020013013;
  $config->series = '20.04';
  $config->release = '20.04.2';

  OS
  Ubuntu 18.04.5 LTS

  DB
  MySQL 5.7
  ------------------------------

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1912705/+subscriptions


Follow ups