Mysterious "Internal Server Error" problem and "Try turning it on and off again" solution. PHP related

The system info, in this case, is a red-herring but it’s here if you really want to know.

System info

Nextcloud version: 20.0.7
Operating system and version: Ubuntu 18.04 LTS
Apache version: 2.4.46
PHP version: 7.4.15 (or maybe slightly earlier when the problem was happening)

Important Information

  • A PHP Upgrade on or about February 16th, 2021 was installed on my server.
  • The problem happened immediately after that upgrade.
  • Assuming people would freak the hell out and it would get fixed, I waited for the next PHP upgrade before even trying to fix it.
  • No immediate PHP upgrades were forthcoming.
  • PHP didn’t have another upgrade until the evening of February 19th, 2021 after I got the problem to go away.

Spoiler Alert

I believe it was caused by a quirk of a PHP upgrade which was probably responsible for the problem happening in the past. I never found out how to solve the problem in the past and just waited for it to go away. This time I couldn’t wait too long and got lucky finding a simple solution.

The issue you are facing:

A set of apps and functions including the Admin pages wouldn’t load and just threw that unhelpful page titled, Internal Server Error, the “Blue Screen Of Death” for Nextcloud. One of the apps was the Passwords page, so it was an inconvenience, to say the least.

Soon after that, other problems began to happen. I gave a whirl at rebooting my server and that had no effect. I rebooted the workstation computer I was using and that had no effect. At this time I noticed my mobile device didn’t synch a screenshot to the cloud, so I rebooted that device and it had no effect.

So now I realize that no device has the ability to synch to the cloud with the desktop apps either, Windows 10 & Ubuntu 20.04 alike. The Passwords Plugins for browsers began throwing cannot communicate with server errors. I was trying to keep my cool and wait for the fix to find me but it didn’t.

Friday morning I finally couldn’t take it anymore and started to try doing diagnostics despite having no admin pages in Nextcloud to look at. A user account without admin privileges could open their Settings page normally. I gave a whirl at doing things via php occ commands, but all that happened was I found out everything was fine.

Is this the first time you’ve seen this error?: N

Steps to replicate it:

  1. Routinely update PHP as soon as upgrades are released.
  2. Notice the problem.

How to make it go away

I switched the version of PHP my Nextcloud site was working with and then switched it back.
While I was switched back to PHP 7.3.27 (or maybe slightly earlier when the problem was happening), I tried opening all the pages that were throwing that Internal Server Error page. All pages opened correctly except Passwords because that app specifies only working with PHP 7.4 or better. After switching back to using PHP 7.4 all pages, apps, plugins and desktop systems were in working order.

Maybe there was a cache issue? The cause is beyond my knowledge, but I will try this fix the next time I see a cursed Internal Server Error page.

I don’t know how to switch versions with command-line statements, so if somebody does know post a reply for the next person. :slightly_smiling_face: I’m managing my server with Virtualmin so I just click into a menu for that virtual server and switch versions with a drop-down list. The Virtualmin system does a bunch of operations for me after that.

I guess I ran into the same problem. Unfortunately, I am not able to solve this by repeating your steps. I am using Virtualmin on Ubuntu 18.
My nextcloud is installed in subdomain. Do you think I need to rollback the PHP version for the main domain or just the subdomain is enough?

Took me so long to notice I had messages that I assume you got through the problem already. Sorry @manojknaikade for not noticing your question till now.

I am a bit of a hack as far as admin work goes. From what I understand about Virtualmin, any sub-server is logically a sub-domain, but it’s defacto a stand-alone server which should de-couple the PHP for the two. If the BIND option is on for servers, the BIND entries are definitely nested, but that’s irrelevant here.

Virtualmin long ago had an option to create “sub-domains” or “sub-servers”, but I got told by their people to stop using the sub-domain option. Now it’s not an option.