HTTP 500 Error trying to add Assignment after Version updates

HTTP 500 Error trying to add Assignment after Version updates

by Ryan Tanner -
Number of replies: 10
After going through a couple version updates, the assignment module in our Moodle build has stopped working - hoping someone may be able to help assist

Currently running Version 4.3+ (Build: 20231124) 

We had a course with an existing Assignment module, which stopped loading once we upgraded to 4.3 (Previously had been in a build 3+ build...)

Attempting to add an "Assignment" to a course immediately returns a HTTP 500 Error

Looking at the Console, I'm seeing a "VM50:5 crbug/1173575, non-JS module files deprecated."

The details of which look like:

  • "use strict";
  • // Copyright 2012 The Chromium Authors
  • // Use of this source code is governed by a BSD-style license that can be
  • // found in the LICENSE file.
  • var loadTimeData;
  • class LoadTimeData {
  •     constructor() {
  •         this.data_ = null
  •     }
  •     set data(value) {
  •         expect(!this.data_, "Re-setting data.");
  •         this.data_ = value
  •     }
  •     valueExists(id) {
  •         return id in this.data_
  •     }
  •     getValue(id) {
  •         expect(this.data_, "No data. Did you remember to include strings.js?");
  •         const value = this.data_[id];
  •         expect(typeof value !== "undefined", "Could not find value for " + id);
  •         return value
  •     }
  •     getString(id) {
  •         const value = this.getValue(id);
  •         expectIsType(id, value, "string");
  •         return value
  •     }
  •     getStringF(id, var_args) {
  •         const value = this.getString(id);
  •         if (!value) {
  •             return ""
  •         }
  •         const args = Array.prototype.slice.call(arguments);
  •         args[0] = value;
  •         return this.substituteString.apply(this, args)
  •     }
  •     substituteString(label, var_args) {
  •         const varArgs = arguments;
  •         return label.replace(/\$(.|$|\n)/g, (function(m) {
  •             expect(m.match(/\$[$1-9]/), "Unescaped $ found in localized string.");
  •             return m === "$$" ? "$" : varArgs[m[1]]
  •         }
  •         ))
  •     }
  •     getBoolean(id) {
  •         const value = this.getValue(id);
  •         expectIsType(id, value, "boolean");
  •         return value
  •     }
  •     getInteger(id) {
  •         const value = this.getValue(id);
  •         expectIsType(id, value, "number");
  •         expect(value === Math.floor(value), "Number isn't integer: " + value);
  •         return value
  •     }
  •     overrideValues(replacements) {
  •         expect(typeof replacements === "object", "Replacements must be a dictionary object.");
  •         for (const key in replacements) {
  •             this.data_[key] = replacements[key]
  •         }
  •     }
  • }
  • function expect(condition, message) {
  •     if (!condition) {
  •         throw new Error("Unexpected condition on " + document.location.href + ": " + message)
  •     }
  • }
  • function expectIsType(id, value, type) {
  •     expect(typeof value === type, "[" + value + "] (" + id + ") is not a " + type)
  • }
  • expect(!loadTimeData, "should only include this file once");
  • loadTimeData = new LoadTimeData;
  • window.loadTimeData = loadTimeData;
  • console.warn("crbug/1173575, non-JS module files deprecated.");

Not sure if also related - but was exploring around the site to gather more info, look for other errors - and this page displays when clicking on "Acceptance Testing"


Additional context information if helpful - have installed moodle on a VPS, I do have Root access. 

I normally update code via git pull command from the cli into a folder on the server, backup the existing moodle code in public_html, remove existing code from the puiblic_html folder, then replace with the new Moodle code and copy the config.php file from the backup back into the public_html folder. 

Been learning as I go managing this site - so welcome thoughts or suggestions, and can provide more info. Been poking around for a few days, and browsing the forums here, but haven't found any luck on clues to move forward. 

Thanks in advance for any insights,

Ryan




Average of ratings: -
In reply to Ryan Tanner

Re: HTTP 500 Error trying to add Assignment after Version updates

by Selma Limbo -
Hi, 


Were you able to have this resolved? Facing the same issue.  

In reply to Ryan Tanner

Re: HTTP 500 Error trying to add Assignment after Version updates

by Ken Task -
Picture of Particularly helpful Moodlers
Is this 'assignment' of the old assignment 2.2 which has been hidden for years ... and last had an admin menu item to convert 'assignment' to 'assign' (the new assignment module) I think early/mid 3.x?

That old 'assignment' directory should have been removed and DB updated to remove all references to the old assignment mod in 4.3.

And, did you hyperjump the site from 3.x to 4.3?

Moodle upgrade: Moodle 3.11.8 or later

'SoS', Ken

In reply to Ken Task

Re: HTTP 500 Error trying to add Assignment after Version updates

by Selma Limbo -
Hi Ken, 

It's actually 2 moodle giving that.  One was upgraded from 4.0 and another one from 4.1. 

Is it possible to remove the mod_assign and install a new one?  

No, I don't have assignment 2.2 plug-in, neither available in the database.

one more thing,  moodle upgraded from 4.0 is giving unknown plugin: core error and just taking me to release note page when I access the site admin.  It's running on 4.3 and PHP v8.

Please Assist,  I can't continue using Moodle with those errors 


In reply to Selma Limbo

Re: HTTP 500 Error trying to add Assignment after Version updates

by Ken Task -
Picture of Particularly helpful Moodlers
@Selma Limbo
Probably not a good idea to 'piggy back' off another's posting ... cause your problem, even though it might seem like it, isn't the same.   Having said that ... this is just for you ...

Do NOT ... repeat do NOT ... remove mod_assign.   That's the one that should be there.
It's the 'mod_assignment' that needs to go.

The 'unknown plugin: core error' error might be misleading ... it's not a core plugin that's the issue, but it is an addon that's no longer compatible (without updating - if there is an update for it) with version 4 of Moodle.

Did you check plugins for compatibility prior to upgrading?

Since you cannot get to admin directly another way to find out what addons you have installed is via command line.   Do you have access to command line of your server.
IF you do, in the moodlecode directory admin/cli/ there is a script called: uninstall_plugins.php
Call the script with the following parameter:

php uninstall_plugins.php  --show-contrib

That should show all the addons/contributed plugins installed in your site.
Use that info to search Moodle plugins site
https://moodle.org/plugins/?q=
for compatibility with 4.3.x

If you can't do any of the above, there is another thing you could try, but i'll send that info to you via PM on this system.

In general, do NOT panic and guess at doing something that might make things worse!!

'SoS', Ken

In reply to Ken Task

Re: HTTP 500 Error trying to add Assignment after Version updates

by Selma Limbo -
Hi Ken, 


I will try this and update you. If it does not work I will create another forum 😊.. I also got your other detailed information.  Thank you so much.  


Selma

In reply to Selma Limbo

Re: HTTP 500 Error trying to add Assignment after Version updates

by Ryan Tanner -
Hi Selma (and Ken),

I did end up getting the first issue with the 500 error resolved - it ended up being related to a different plugin (not an assignment plugin), and after removing that mod the 500 error went away. (I believe it ended up being an out of date Microsoft plugin)

Unfortunately, not too long after that, I ran into the same problem you're experiencing now Selma with the "unknown plugin:core" error.

This error I could not resolve, and ended up rebuilding the site due to time constraints, and then restoring my courses from backups.

I've since switched how my code is maintained to a git setup, as I believe a poor code update from my end caused the "unknown plugin:core" error.
In reply to Ryan Tanner

RESOLVED - Re: HTTP 500 Error trying to add Assignment after Version updates

by Ken Task -
Picture of Particularly helpful Moodlers
@Ryan
Good to hear.  Have marked thread as 'resolved' ... at least for you Ryan.
Others are reporting the exact same error ... hard to replicate.

Question: after you removed the errant plugin, did you purge all the caches?

And it's very good that you have been following good practice of course backups!

'SoS', Ken

In reply to Ken Task

Re: RESOLVED - Re: HTTP 500 Error trying to add Assignment after Version updates

by Ryan Tanner -
I purged caches for sure - after any small tweak trying to resolve the error I was purging caches in Moodle and my browser to test

And thanks for marking resolved smile 
In reply to Ken Task

Re: RESOLVED - Re: HTTP 500 Error trying to add Assignment after Version updates

by Selma Limbo -
Hi Ken and Ryan,  


I have to go back to site restore,  big issue my backup company only did a backup of mysql files,  mysql/moodledatabase,  everything is in there is backed up .  Can I cp those files in the current mysql/moodledatabase? They didn't use mysqldump to have a. sql files.  


Data directory and web are backed up fine

In reply to Selma Limbo

Re: RESOLVED - Re: HTTP 500 Error trying to add Assignment after Version updates

by Ken Task -
Picture of Particularly helpful Moodlers
@Selma

big issue my backup company only did a backup of mysql files"

Who/what is this backup company?

"Can I cp those files in the current mysql/moodledatabase?"

Does that mean the raw mysql database files?  Is that what your hosting provider is recommending?

What is the date on those raw DB files?

"Data directory and web are backed up fine"
Is the date of data directory and web files backups the same as DB raw files backup?

A site backup restore is all of it ... DB, web, and moodledata.

'SoS', Ken