Adding block causes 500 internal server error

Adding block causes 500 internal server error

by Kevin Falconett -
Number of replies: 8

Hello, I tried to add some blocks to my site, and discovered after selecting this block called 'Competency Progress' the page gives me a 500 error and I every time I try to go back to that page it gives me the same error. So after adding it to my front page I cannot access it anymore without getting the error, but every other page where I did not try to add this to works fine. I can also add other blocks on pages that work fine.

Looking at the 'Manage Blocks' page the block named 'Competency Progress' is not there, so where is it coming from and how to I get rid of it? I already tried purging the cache and turning on debugging but that doesn't show anything, neither does the error log. 

Version: Moodle 3.10.3 (Build: 20210325)

               PHP 7.4



Average of ratings: -
In reply to Kevin Falconett

Re: Adding block causes 500 internal server error

by Carolina Blackman -
Hey there!

Most 500 errors are server issues. There are lots of reasons why your site might be showing a 500 Error to your users, but the most common are:

  • A Permissions Error. In most cases, a 500 Internal Server Error is due to an incorrect permission on one or more files or folders.
  • A PHP Timeout. If your script connects to external resources and those resources timeout, an HTTP 500 error can occur. Timeout rules, or better error handling in your script, should help if this is the cause of the 500 error.
  • A Coding Error in .htaccess. While not as common, be sure to check that your site's .htaccess file is properly structured.

Also, if this is a recent issue, you can check with your hosting provider if they made any important change in your service. 

In reply to Carolina Blackman

Re: Adding block causes 500 internal server error

by Kevin Falconett -
I already know what's causing the error, in this case it's a block plugin that doesn't exist anywhere else but this 'add block' menu. I just need to know how I can fix it or where I should be looking to fix it. Since every page this block as been 'added to' gives the error. The file for this block doesn't exist anywhere.
In reply to Kevin Falconett

Re: Adding block causes 500 internal server error

by Ken Task -
Picture of Particularly helpful Moodlers

@Kevin ... sounds like an improperly un-installed plugin.

The plugin is compat up to and including 4.0 ... or so this says:

https://moodle.org/plugins/block_completion_progress/versions

If you really want it gone ...

Look in moodlecode/blocks/ for a directory named "completion_progress".

Manually remove that directory.

Then in your database, mdl_config_plugins table should have references to that block plugin.   Remove those rows and it should not appear after purging caches.

Anytime one works directly with the DB and tables, it's advised to make a backup first ... just in case.

If that doesn't work (you are on version 4 of Moodle), restore the files in code/blocks/ ... db already knows of it's existence.    Then properly un-install via Moodle Admin area:

https://yoursite/admin/plugins.php

or

https://yoursite/admin/plugins.php?updatesonly=0&contribonly=1

where you should see an 'un-install' link in the rows for that addon.

Sometimes with moodle one needs to 'give it what it wants' ... sorta one step forward, one step back kinda docido! :|

'SoS', Ken


'SoS', Ken


Average of ratings: Useful (1)
In reply to Ken Task

Re: Adding block causes 500 internal server error

by Kevin Falconett -
Thanks Ken, I've fully uninstalled 'completion_progress' so it doesn't show up when I try to add anymore. However, the main block that I was having trouble with which is 'Competency Progress' still shows that it can be added although it does not show up anywhere in my blocks directory or 'manage blocks' page. It doesn't show in the database either.

Additionally, the pages that had this block added to still give me the 500 error. 

Is there a reference to this block somewhere although it doesn't exist perhaps? And where would this reference be?

In reply to Kevin Falconett

Re: Adding block causes 500 internal server error

by Ken Task -
Picture of Particularly helpful Moodlers

Ok, my bad ...

Do you recognize anything like your 'Competency Progress' in the following list of plugins?

https://moodle.org/plugins/index.php?q=progress

https://moodle.org/plugins/?q=competency

If so, please provide the link to the one that looks familiar and I'll attempt to see what it looks like on my sandbox 311.

'SoS', Ken


Average of ratings: Useful (1)
In reply to Kevin Falconett

Re: Adding block causes 500 internal server error

by Ken Task -
Picture of Particularly helpful Moodlers

What theme is your site using?

Your screen shot shows (I think) you are in a course and you've added blocks always to left side.  Your 'add block' shows a pick list ... on a stock 3.10.highest, using boost, there is only a "+" kinda icon in boost for adding a block.

Can you change the theme of that course? or set site to a stock theme (that came with your version of Moodle - which would be either boost or classic)?

'SoS', Ken


Average of ratings: Useful (1)
In reply to Ken Task

Re: Adding block causes 500 internal server error

by Kevin Falconett -
Thank you Ken, I have actually figured out the issue. It was a block plugin written by the previous website manager and the name of the plugin and the block did not match up, thus causing my confusion.

Thanks for all the help!
In reply to Kevin Falconett

Re: Adding block causes 500 internal server error

by Ken Task -
Picture of Particularly helpful Moodlers

Welcome!   I think! smile ... I was kinda chasin' down another rabbit hole ... not the one you found.  

So it was a custom block ... you might want to keep notes of this and be aware of your next upgrade to 4.0.x.   Matter of fact, might be a good time to duplicate site and test upgrading to 4.0.x to see how that version handles the custom block.

'SoS', Ken