Sorry! We will be back soon!

Lawes_Chan,
All,

I’ve poked around a bit today and am lost. Nginx is running and serving other web apps without any problems. Redis is running and seems to be properly configured. I have the path to my valid SSL certificates set properly…but now, after last night running

bench setup nginx

My ERPNext is entirely inaccessible. I get a “cannot establish a secure connection” error when trying to access via my domain. The

show-config

output seems to indicate that it’s configured properly. After adding the ssl certificate path I get the following (with private information blocked out).

Does anyone have any suggestions as to how I can troubleshoot this? For example, bench commands that allow me to obtain more diagnostic information? Any help/advice will be most appreciated.

Jason

P.S. I do get the “bench is installed in editable mode” message but that is ok for now as this is a production demo. Or, at least I think that is ok…?

P.P.S. One more comment here and then I’m going to take a break. :slight_smile: In my sites-available directory (for Nginx) I see no reference to ERPNext…? I’ve forgotten how it was configured prior to the problem I’m experiencing here but it seems like there should be something, somewhere, pointing to ERPNext…no? I have 4 sites-enabled files all pointing to other little web apps and they all work flawlessly. The ‘default’ file seems to just be for port 80…so, this is probably a very ignorant question but, where is the Nginx config to make it ‘aware’ of ERPNext?

you seem lost of direction :sweat_smile:

we will try help , hope we can.

first, bench setup nginx will overwrite previous config as I mention, so first check should be the config file, the generated file should be ~/frappe-bench/config

check the content , at least the config is included ssl setting, then you should check nginx setting, if you have another web service in running, I assume you should has symbol link to ~/frappe-bench/config/nginx.conf for nginx to work.

if all is fine, then you may need post the nginx log for error troubleshoot.

Lawes_Chan,

Thanks, yes, I’m lost :slight_smile: But I’m somewhat used to being lost so it’s ok. :wink:

I checked ~/frappe-bench/config and can confirm that the path to my ssl certificate information is included.

In my Nginx config however, I don’t see a symlink to this file anywhere…which basically answers my question about how Nginx is ‘aware’ of ERPNext. I guess it’s not :slight_smile:

Wait…yes, there is a symbolic link in sites-enabled and it does, in fact, point to

/home/myerpnext/frappe-bench/config/nginx.conf

Hmmm…something is off. Guess it’s time to check the Nginx logs.

Jason

P.S. Well, just did a quick check…I don’t see anything odd or helpful in the access.log or error.log for Nginx…hmmm

ok , how about supervisorctl status ouptut ?

Lawes_Chan,

Thanks…but I’m not sure I have the correct syntax. I tried

bench supervisorctl status

But got an error saying “No such command”

So, I tried simply

supervisorctl status

But nothing happened…I mean the command seemed to execute but there was no output…wait, do I need to include “output”…no, that doesn’t work.

Hmm, can you point me in the right direction for the correct command to use?

Thanks again for you ongoing support.

Jason

I think it should be sudo supervisorctl status nginx

Also maybe you can check the /etc/letsencrypt/live/ to see if your certs path/name are all correctly referred to (in the site_config.json, common_site_config.json, nginx.conf)
You can also use the command sudo certbot certificates.

rahy,

Thanks, but that command gives me an “ERROR (no such process)” message.

Regarding the certs name and path, I have checked them and they all seem to be correct. Also,

sudo certbot certificates

Displays information for the certificates I have with their paths so I guess everything is ok there.

Oddly, however, supervisor seems to be either not running or incorrectly setup maybe…

Jason

Hi JLH,

sorry for my lazy

here is the sample output

or from the info now, I guess it may be:

  • multitenant config issue
  • or mariadb db connection issue
  • or bench update issue

for multitenant , em … I have not setup this feature yet , so no rich support can provide

for mariadb, can check any access log issue

for bench update, if major file(s) has changed, it would better to issue follow command as well:
bench build
bench clear-cache
bench clear-website-cache

Regards,
Lawes

Lawes_Chan,

Thanks again. Let’s see, I stumbled onto this post:

And noticed that I have the same problem (maybe it’s a problem?) in that there is no supervisor.conf file in home/myerpnext/frappe-bench/config

So I made a symbolic link as explained in the post above and then resetup supervisor.

But now, when I run supervisorctl status I still get nothing.

Am I supposed to be running it inside the frappe directory or inside the ERPNext directory? Or can it be run from anywhere…which is what I was assuming.

Jason

then you require to generate one and link it up through supervisor service, since I using Fedora it may different than yours , just for your reference only.

image

and supervisor service can’t execute directly through root in Fedora, I not sure how about on ubuntu or Debian, here is my control for your reference in /etc/group

image

this can allow me to use systemctl to manage supervisor service

oh not enough, I still require to take supervisor pid to correct permission in supervisor.conf files
like this:
image

Lawes_Chan,

Thanks again so much. :slight_smile:

So, I have the following:

  1. A symbolic link in etc/supervisor/conf.d that points to frappe-bench.conf

  2. The frappe-bench.conf file is in /home/myerpnext/frappe-bench/config/supervisor.conf

  3. I then ran:

sudo bench setup supervisor
sudo supervisorctl reread
sudo supervisorctl update

sudo supervisorctl stop all
sudo supervisorctl start all

Maybe I should restart Nginx after that? Oh, wait, I just remembered that I tried all of this earlier (including the following)

sudo ln -s /home/myerpnext/frappe-bench/config/nginx.conf /etc/nginx/conf.d/frappe-bench.conf

When I add that symbolic link (above) Nginx won’t restart and the logs tell me there is a

“duplicate upstream frappe-bench-frappe in /etc/nginx/conf.d/frappe-bench.conf:1”

So I delete the symbolic link so I can get Nginx back up and running so it will serve the other apps that are actively being used by a few people.

I’ve somehow got things all messed up :frowning:

Jason

if you delete the link … it seems nginx can’t locate the erpnext conf file, it won’t work I think.

for duplicate upstream … it seems miss config for your other web apps config file.

you may need check the conflict issue.

ps. if you can shutdown your web apps for a moment, can it be test like:

  • keep the symbol link to erpnext
  • remove / relocate out the other web app nginx conf

restart nginx service, it should allow only erpnext config to execute, and see can the website bring up first

Lawes_Chan,

Wait! I made some progress! :slight_smile: Just a tiny bit.

Instead of putting the symbolic link in conf.d I put it in sites-enabled like this:

sudo ln -s /home/myerpnext/frappe-bench/config/nginx.conf /etc/nginx/sites-enabled/frappe-bench.conf

And now I am back to the “Sorry! We will be back soon” message. Not where I want to be but it feels like progress :slight_smile:

Jason

P.S. I guess now I have to figure out why supervisorctl is not running…

What Linux are you using?
If I’m not mistaken the extension of frappe-bench for the supervisor in CentOS is .ini. And for Ubuntu it is .conf

I use CentOS:

sudo ln -s `pwd`/config/supervisor.conf /etc/supervisord.d/frappe-bench.ini

and

sudo ln -s `pwd`/config/nginx.conf /etc/nginx/conf.d/frappe-bench.conf

rahy,

Thanks, I’m using Ubuntu 20.04. The extension is .conf it seems.

But I’m not clear on the path you have. Where is the ‘config’ directory? I guess that is in frappe-bench right?

So in that directory (home/myerpnext/frappe-bench/config) I have the conf file “supervisor.conf”

And in /etc/supervisor/conf.d/ I have a symbolic link titled “frappe-bench.conf” that points to the file in the /home/myerpnext/frappe-bench/config file.

I guess that is the correct configuration?

Jason

rahy, lawes_chan,

Thank you so much for all of your support! I finally figured it all out. Somehow my symbolic link to the frappe-bench.conf file in the supervisor directory had been deleted. I messed a few other things up along the way but finally managed to get them all repaired last night.

Then, this morning I was trying to figure out why supervisor was not running and I noticed I had copied pasted the symbolic link creation command but did not correct some information in the path! Oh no! The title of my ERPNext instance is part of the path.

So, I had a symbolic link pointing to something that didn’t exist. :frowning:

I fixed the link and then ran the following commands and finally I have everything running again. :slight_smile:

sudo bench setup supervisor
sudo supervisorctl reread
sudo supervisorctl update

sudo supervisorctl stop all
sudo supervisorctl start all

Whew! I don’t know why this happened just because the power went out. Hopefully it won’t happen again or, if it does, hopefully I’ll remember how to fix it.

Thanks again

Jason

Good to hear you have solved the problem.
I mostly don’t use the name frappe-bench for the installation I did. So your mistake happened to me several times. Forget to change the name of the bench when pasting the command :smiley:

rahy,

Thanks :slight_smile: I’ve just realized that by solving my ERPNext problem, somehow I introduced a new problem. My three other applications running through Nginx are now inaccessible. If I remove the config for ERPNext those sites are available but with the ERPNext config they are inaccessible.

I guess I need to adjust something in that ERPNet config…not sure what though. Any ideas?

Jason

I’m not the expert for nginx or computer for that matter :slight_smile:

Now that you have resolved the supervisor issue, I think you should place the nginx back to the conf.d and see if that resolve the other issues.

Try kill the processes on port 8000, 11000, 12000, 13000.
You can use the following commands

sudo lsof -t -i tcp:8000 -s tcp:listen | sudo xargs kill
sudo lsof -t -i tcp:11000-s tcp:listen | sudo xargs kill
sudo lsof -t -i tcp:12000-s tcp:listen | sudo xargs kill
sudo lsof -t -i tcp:13000-s tcp:listen | sudo xargs kill

Then do:
sudo bench restart

1 Like