As per title, 2 days later it just shows stuck in progress. Any logs or places I can check?
Unfortunately, 'in progress' puts the copy in a background process and no button to 'cancel' now.
Places to check ... things to try?
moodledata/temp/backup/ ... think the copy course creates a backup first.
Do you see any contenthash named (bunch of letters/numbers) directories there? If, from whatever you have to browse files (command line would be 'best') see if there is/are any .xml files - maybe moodle_backup.xml there.
xml files are asciii text so one could open in an edtor to inspect for clues.
Size of the course being copied? Got a backup of it? How large is that backup file?
When ever newer versions of Moodle can't finish a job it might que the job up for execution/try again at a later time. So, hopefully, you have command line access and don't suffer from 'command line avoidance syndrome' ... in code/admin/tool/task/cli/ there is a command line only script called adhoc_task.php that's supposed to pick up where something like copy didn't finish.
cd code/admin/tool/task/cli/
php adhoc_task.php [ENTER] will bring up a help screen:
[root@sos cli]# php adhoc_task.php
Ad hoc cron tasks.
Options:
-h, --help Print out this help
--showsql Show sql queries before they are executed
--showdebugging Show developer level debugging information
-e, --execute Run all queued adhoc tasks
-k, --keep-alive=N Keep this script alive for N seconds and poll for new adhoc tasks
-i --ignorelimits Ignore task_adhoc_concurrency_limit and task_adhoc_max_runtime limits
Example:
$sudo -u www-data /usr/bin/php admin/tool/task/cli/adhoc_task.php --execute
Also, check web server error logs.
Got any site protects - a web application firewall - that might have triggered?
Some sites are set up to write php error logs in directories where error ocurred - typically those are called 'error_log'. Got any of those in any directory of your site?
Sorry ... no magic bullet here! Just lots of 'sluething'! :\
Might help to know some technical details about site:
Minimally .. how about Moodle version? How hosted? (shared/dedicated/whatever) Any issues with additional plugins? Space issues?
'SoS', Ken
Follow up ... there is a tracker entry that deals with the copy course interface:
https://tracker.moodle.org/browse/MDL-64843?attachmentViewMode=list
In the 'Testing Instructions' mentioned many times is the running of cron job. While not exactly the same as your issue, is closely related. And while not exactly mentioning the actual API/process does hint at using core backup and restore.
Does any of info in that tracker item stand out to you?
'SoS', Ken
And another follow up ... on a sandbox 3.9.highest copy course of 65.6 MB in size
stepped through the single screen for making a course copy of above.
Performed. Screen refreshes and informs 'in progress'
Nothing in moodledata/temp/backup/ yet.
Ran cron job from command line
The course copy was in adhoc_task ... cron output for this test below:
Execute adhoc task: core\task\asynchronous_copy_task
... started 18:00:41. Current memory use 49.3MB.
Course copy: Processing asynchronous course copy for course id: 6
Course copy: Backing up course, id: 6
Course copy: Restoring into course, id: 9
Course copy: Copy completed in: 3 seconds
... used 4005 dbqueries
... used 2.8616149425507 seconds
Adhoc task complete: core\task\asynchronous_copy_task
Execute adhoc task: core\task\refresh_mod_calendar_events_task
... started 18:00:44. Current memory use 53.3MB.
Refreshing events for assign
Refreshing events for assignment
Refreshing events for book
Refreshing events for chat
Refreshing events for choice
Refreshing events for data
Refreshing events for feedback
Refreshing events for folder
Refreshing events for forum
Refreshing events for glossary
Refreshing events for h5pactivity
Refreshing events for imscp
Refreshing events for label
Refreshing events for lesson
Refreshing events for lti
Refreshing events for offlinequiz
Refreshing events for page
Refreshing events for quiz
Refreshing events for resource
Refreshing events for scorm
Refreshing events for survey
Refreshing events for url
Refreshing events for wiki
Refreshing events for workshop
... used 109 dbqueries
... used 0.10778307914734 seconds
Adhoc task complete: core\task\refresh_mod_calendar_events_task
Ran 2 adhoc tasks found at Tue, 29 Dec 2020 18:00:39 -0600
Cron script completed correctly
Cron completed at 18:00:44. Memory used 56.4MB.
Execution took 4.476938 seconds
Course copies in progress screen refreshed to display:
current operation complete with a status of a 'check'.
So bottom line for your issue might be the running of cron. Check the cron job set up. You can also run the cron job via the web interface ... although without knowing the size of the course to be copied that might time out.
'SoS', Ken
This is Moodle 3.9.1 (build 20200713) hosted with TMD, access thru cPanel interface.
moodledata/temp/backup/ ...
Softac ... ugh!
Those look like site backups? The .tar.gz filename extensions.
Moodle backups have .mbz extensions.
Contenthash question ...
any .log file in moodledata/temp/backup/ that is 0 bytes in size can be
ignored in this case ... indicates a successful backup of a course.
any .log file over 0 bytes indicates there could have been an issue.
What I was trying to get you to do is look in a directory ...
screen shot shows 3ff7blahblah directory.
Still there today? Hope not.
Change into: cd 3ff7[tab key on keyboard]
pwd to make sure you are in that directory
ls -l to see what's in it.
Running of commands.
Screen shot shows user is vm1277. One has to adjust -u (user) provided in the help screen for the command **example** cause www-data - the typical user under which web service would run on a standalone ubuntu/debian server - probably doesn't exist on *your* system.
So
if you have already changed directories (cd command) to the directory where the script resides you did this:
cd public_html/admin/tool/task/cli/
pwd [ENTER]
will show present working directory:
ls -l will show the files at that location.
and should show owner of files as well as permissions.
You should see 2 php scripts:
adhoc_task.php and schedule_task.php
To execute:
php adhoc_task.php -e [ENTER]
OR if above php isn't php-cli/
/usr/bin/php adhoc_task.php -e [ENTER]
Be prepared to wait ... script might take some time to run.
Be patient!
'SoS', Ken
I tested that by copying anohter course. In one window I had the web interface copying course screen showing "Copy pending" that gets stuck. In a separate window I have the terminal window open. Once I run php adhoc_task.php -e and script starts, within 10 seconds the GUI window releases the pending and processes the job. Kind of way before it seems much script processing is even close to done.
Regardless, the solution worked. Thank you! But it seems a clunky solution everytime I want to copy a course its going to hang until I run that command via terminal. Assume something else must not be set right that prevents for GUI copy from working?