Internal Server Error after sudo supervisorctl restart all

I have tried all possible solutions related to this topics, but unfortunately, I cannot find the solution in my case. most of all the services are Active and running well, I executed the following commands to check,

sudo service mariadb status 
sudo service mysql status 
sudo service nginx status
redis-cli ping

No error in response to all the above commands and shows running in green.

I reinstalled the Nginx server using following commands

dpkg --get-selections | grep nginx
sudo apt --purge remove nginx -y
sudo apt --purge remove nginx-common -y
sudo apt --purge remove nginx-core -y
sudo apt install nginx -y
sudo service nginx status

nginx removed and reinstalled I can access other sides.

tried bench commands to refresh using the following command

bench migrate
bench --site all clear-cache
sudo supervisorctl reload
sudo service nginx restart

all above result was normal and no error.

additionally, checked the database name+pwd in the site .config file which is fine to access the database from the command prompt it returns SQL Queries results perfectly.

but still getting the same error: Internal Server Error. :frowning:

seems like everything is working well but the website is giving this error. I cannot understand the reason not sure if the files get corrupted while restarting the services or what else to do? How can I resolve this error please?

image

Hi,

It may help to say the operating environment, versions of Frappe and any apps, and whether this is a new installation or one that was working and the problem arose after some changes.

Does service supervisorctl status look ok?

1 Like

thank you @smino for the reply,

I tried and got the below error.

$ sudo service supervisorctl status
Unit supervisorctl.service could not be found.

Since I am using Ubuntu OS and then I executed the following command to check and got a successful response as RUNNING.

$ sudo supervisorctl status

frappe-bench-redis:frappe-bench-redis-cache               RUNNING   pid 17295, uptime 0:13:04
frappe-bench-redis:frappe-bench-redis-queue               RUNNING   pid 17296, uptime 0:13:04
frappe-bench-web:frappe-bench-frappe-web                  RUNNING   pid 17941, uptime 0:12:02
frappe-bench-web:frappe-bench-node-socketio               RUNNING   pid 17942, uptime 0:12:02
frappe-bench-workers:frappe-bench-frappe-long-worker-0    RUNNING   pid 17301, uptime 0:13:04
frappe-bench-workers:frappe-bench-frappe-schedule         RUNNING   pid 17299, uptime 0:13:04
frappe-bench-workers:frappe-bench-frappe-short-worker-0   RUNNING   pid 17300, uptime 0:13:04

but still the site is running with INTERNAL SERVER ERROR :frowning:

Now when trying to migrate the site it’s getting stuck in the DB connection. shows β€œConnected to site DB” but not moving on, after long waiting time, I broke the process and β€œbench migrate” is not finishing. seems like DB connection problem but not sure

Site error is still same Internal Server Error

Does bench ---site (sitename) mariadb connect?

thank for the reply, yes it is connecting as well.

Take a look at some of the log files and see if anything is showing up that will help.

https://frappeframework.com/docs/user/en/logging

Try:

sudo bench setup production $USER
1 Like

@ashaseeb

Have you found solution?

@hsrai Oh yes, I fixed it.

I would suggest that whenever this error occurs, check the following list.

  • If restoring backup, ensure all the apps are installed and the site_config file covers all the settings/json/keys from the source.

  • This error may appear when Nginx Configuration is not correct, make sure nginx entries are correct in β€œ/etc/nginx/conf.d/{YourSite.config}” file to ensure everything is fine run this command and nginx shouldn’t return any error. β€œsudo service nginx restart”

  • Ensure database connection and database name in config file for the site. β€œbench --site {yousite} mariadb”

  • Migrate/build your site β€œbench --site {yoursite} migrate” and β€œbench build”

  • check log files β€œbench logs”

  • Build and migrate the site. β€œbench build” or β€œbench migrate”

  • Run commands β€œsudo supervisorctl restart all” , β€œsudo systemctl restart redis-server” , β€œsudo systemctl restart mariadb” , β€œbench setup requirements” , β€œbench restart”

  • This error also appears if Insufficient Server Resources

  • Reboot machine β€œsudo init 6”

hope this will help others.

1 Like

@ashaseeb
Today I had power failure . After that I am getting " Internal Server Error "
We are using ERPNEXT v 12.7 , On Virtual Box .
I have read the detailed procedure given by you .
I am weak in executing these commands for first time . Is it possible to take remote and see once .

Thanks
Nagaraja,
Bangalore

it seems like your database is damaged and the app cannot connect to the DB,

bench --site {{sitename}} mariadb

what is the response of above command does it connect?

I strongly recommend you take backups before taking any action. then try to restore the last working database backup.

provide the following details:

  • OS version?
  • Frappe version ?
  • Environment development or product?

Thank you for the response
ububtu 18.04
ERPNEXT 12.21
Frappe framework 12.18.1

I will share the bench – site {{sitename}} mariadb in next message .

Thanks
Nagaraja

I am using Oracle VirtualBox 5.x in that ubuntu 18.04 ,
This version installed in year 2021 , I have downloaded the ERPNEXTprocuction.ova file , this file was found on ERPNEXT site link . Is this ova file having restrictions , I want to know .
Now we want to upgrade to version 15 . as this version 12 is not having email and whatsapp message , lot of features .
Pls adv
Thanks and Regards
Nagaraja

Hi,

Before trying to upgrade this installation, if possible clone the VM and operate on the close so that the original remains. If things go badly you will be able to start over with another clone.

Trying to restore a backup to a VM created from a .ova of a newer version is not likely to succeed. You will have to go through the steps of upgrading Ubuntu , the dependencies and then switch to versions 13,14 then 15 in turn.