Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Many warnings in Moodle cronjob #199

Open
Richardvi opened this issue Apr 21, 2023 · 5 comments
Open

Many warnings in Moodle cronjob #199

Richardvi opened this issue Apr 21, 2023 · 5 comments

Comments

@Richardvi
Copy link

I'm running Moodle 4.1.2 with latest Panopto plugin and see a lot of these warnings in the Cronjob log:

Execute adhoc task: block_panopto\task\sync_user_login
Adhoc task id: 10342
Adhoc task custom data: {"userid":"4279"}
... started 20:10:54. Current memory use 20.8 MB.

Warning: Use of undefined constant STDOUT - assumed 'STDOUT' (this will throw an Error in a future version of PHP) in /home/learndev/public_html/lib/clilib.php on line 45

Warning: fwrite() expects parameter 1 to be resource, string given in /home/learndev/public_html/lib/clilib.php on line 36

Warning: Use of undefined constant STDOUT - assumed 'STDOUT' (this will throw an Error in a future version of PHP) in /home/learndev/public_html/lib/clilib.php on line 45

Warning: fwrite() expects parameter 1 to be resource, string given in /home/learndev/public_html/lib/clilib.php on line 36

Warning: Use of undefined constant STDOUT - assumed 'STDOUT' (this will throw an Error in a future version of PHP) in /home/learndev/public_html/lib/clilib.php on line 45

Warning: fwrite() expects parameter 1 to be resource, string given in /home/learndev/public_html/lib/clilib.php on line 36

Warning: var_export does not handle circular references in /home/learndev/public_html/blocks/panopto/lib/panopto_user_soap_client.php on line 122

Warning: var_export does not handle circular references in /home/learndev/public_html/blocks/panopto/lib/panopto_user_soap_client.php on line 122

Warning: var_export does not handle circular references in /home/learndev/public_html/blocks/panopto/lib/panopto_user_soap_client.php on line 122

Warning: var_export does not handle circular references in /home/learndev/public_html/blocks/panopto/lib/panopto_user_soap_client.php on line 122

Warning: Use of undefined constant STDOUT - assumed 'STDOUT' (this will throw an Error in a future version of PHP) in /home/learndev/public_html/lib/clilib.php on line 45

Warning: fwrite() expects parameter 1 to be resource, string given in /home/learndev/public_html/lib/clilib.php on line 36
... used 7 dbqueries
... used 0.10246300697327 seconds
Adhoc task complete: block_panopto\task\sync_user_login

@jrchamp
Copy link

jrchamp commented Apr 21, 2023

The STDOUT constant is supposed to be built into the CLI environment so that you don't have to open the php://stdout handle multiple times. Seems a bit odd that it's failing, but the purpose is to print output. The var_export() is very odd, almost like the value being passed in is a very messy object, but it at least points us to problem.

if (!$this->usermanagementservicesync->SyncExternalUser($syncparamsobject)) {
\panopto_data::print_log(var_export($this->usermanagementservicesync->getLastError(), true));

The SyncExternalUser function is failing. Now, I'm not sure why, and that's what the "getLastError" is supposed to be explaining, but there's probably a different problem like there's users on Moodle that are not on Panopto or the API call is failing.

@jmalmsten-panopto
Copy link

Hi,

I have filed an internal work item to look into this issue.

Thank you for your patience,
Joe

@Richardvi
Copy link
Author

Richardvi commented Oct 28, 2023

We updated our test server to Moodle 4.3 and this is showing the same errors. I also see a new error, more or less the same as the old error.

Execute adhoc task: block_panopto\task\ensure_category
Adhoc task id: 17355
Adhoc task custom data: {"categoryid":"336"}
... started 21:38:26. Current memory use 7.7 MB.
... used 2 dbqueries
... used 0.11007881164551 seconds
Adhoc task failed: block_panopto\task\ensure_category,Undefined constant "STDOUT"
Backtrace:

  • line 1831 of /blocks/panopto/lib/panopto_data.php: call to cli_writeln()
  • line 1863 of /blocks/panopto/lib/panopto_data.php: call to panopto_data::print_log()
  • line 239 of /blocks/panopto/lib/panopto_category_data.php: call to panopto_data::print_log_verbose()
  • line 63 of /blocks/panopto/classes/task/ensure_category.php: call to panopto_category_data->ensure_category_branch()
  • line 508 of /lib/classes/cron.php: call to block_panopto\task\ensure_category->execute()
  • line 302 of /lib/classes/cron.php: call to core\cron::run_inner_adhoc_task()
  • line 128 of /lib/classes/cron.php: call to core\cron::run_adhoc_tasks()
  • line 186 of /admin/cli/cron.php: call to core\cron::run_main_process()

@Richardvi
Copy link
Author

And the old one:

Execute adhoc task: block_panopto\task\sync_user_login
Adhoc task id: 16987
Adhoc task custom data: {"userid":"17859"}
... started 21:56:05. Current memory use 7.6 MB.
... used 0 dbqueries
... used 0.0084228515625 seconds
Adhoc task failed: block_panopto\task\sync_user_login,Undefined constant "STDOUT"
Backtrace:

  • line 1831 of /blocks/panopto/lib/panopto_data.php: call to cli_writeln()
  • line 1863 of /blocks/panopto/lib/panopto_data.php: call to panopto_data::print_log()
  • line 940 of /blocks/panopto/lib/panopto_data.php: call to panopto_data::print_log_verbose()
  • line 61 of /blocks/panopto/classes/task/sync_user_login.php: call to panopto_data->sync_external_user()
  • line 508 of /lib/classes/cron.php: call to block_panopto\task\sync_user_login->execute()
  • line 302 of /lib/classes/cron.php: call to core\cron::run_inner_adhoc_task()
  • line 128 of /lib/classes/cron.php: call to core\cron::run_adhoc_tasks()
  • line 186 of /admin/cli/cron.php: call to core\cron::run_main_process()

@Richardvi
Copy link
Author

Moodle 4.3, PHP 8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants