ERPNext drops sometimes and suddenly it goes up

Sometimes my erpnext drop and I don’t know why.

Y check the frappe log file. and it has this

[DEBUG] 2020-10-29 14:22:50,418 | /home/erpnext/frappe-bench/apps/frappe/frappe/utils/scheduler.py:
    Site: [site].com
    Queued events for site [site].com

Can someone give me a hand to try to fix this problem?

Someone?

May we know if this is a new installation or was it working ok and then this started happening? It may help to say the version of ERPNext and the hosting environment.

Have you tried bench enable-scheduler?

Hi, @smino. Yes is a new installation. Its ERPNext V12. I have not tried enable-scheduler. Can I see the scheduler status before run that command? only to check if it is running. Is there a command?

when I run this command:
/home/erpnext/frappe-bench/config$ bench doctor

I got this

-----Checking scheduler status-----
Workers online: 4
-----None Jobs-----

Workers Online shouldn’t be 0?

I’m sorry I can’t say how many jobs should be running or how to list them. The instance I have has 3.

When ERPNext drops, what happens? Does the browser display a message and is the browser on the host machine or a workstation somewhere on the network ?

the browser is on my machine, the erpnext is on a aws server. The message is this:
image

PD: the screenshot was taken from another website, because in this moment erpnext is up.

It looks like a network problem, not something in ERPNext. If this happens often, I might try connecting to the ip address directly instead of the hostname and see if it happens.

@josmeldiaz21 could be fail2ban is blocking your ip, if erpnext is cutting off for some time and comes back on its own

I typed the ip, and it doesn’t work either.

Can you ssh into the host?

If so, then run the “top” command to see how much time and resources are being chewed up by “fail2ban” task. Sometimes this causes the system to be unavailable if there is a problem in how it is configured.

BKM

AWS has something called CloudWatch . Maybe that could catch something? Looks like its free in its basic form.

This is the top return.
I had to wait untill the app went down.
image

I found the fail2ban.log It seems like the fail2ban is banning me. Why this is happening.

2020-11-05 14:50:21,738 fail2ban.actions        [1621]: NOTICE  [nginx-proxy] Ban 186.33.89.76
2020-11-05 14:50:27,964 fail2ban.filter         [1621]: INFO    [nginx-proxy] Found 186.33.89.76
2020-11-05 14:50:28,099 fail2ban.filter         [1621]: INFO    [nginx-proxy] Found 186.33.89.76
2020-11-05 15:00:22,697 fail2ban.actions        [1621]: NOTICE  [nginx-proxy] Unban 186.33.89.76
2020-11-05 15:01:08,142 fail2ban.filter         [1621]: INFO    [nginx-proxy] Found 186.33.89.76
2020-11-05 15:01:32,350 fail2ban.filter         [1621]: INFO    [nginx-proxy] Found 186.33.89.76

PD: I’m making tests with the API. would it be the problem?

Yes, most likely. I am not a wizard with fail2ban, but I have been bitten by it’s rules in the past. I had to pay a network security guy to figure it out for me and make the needed changes to the rules.

BKM

The default fail2ban rules are quite strict. Multiple client errors (404’s or disconnects) may actually trigger a temporary ban. The best is to whitelist the public IP from where you want to access your ERPnext instance:

hey josmel
the fail2ban is there to block any fishy connection to the server, I faced the same on AWS disable Fail2ban service if you are new to Linux this will fix it 4 u

regards

Thanks for the response man.! I will

Thanks @dirkvdl16 I can see. Thank you so much for the response. That’s a headache.