Start ERPNext with Debian

Hello!

I just installed ERPNext on debian 9 and I want to make it to start automatically when Debian is booting but i’m not sure how to do this.

I have tried with an .sh file but didn’t work.

By default it should start when Debian is booting.

As Nginx and Mariadb and other services start on boot with systemd. You don’t really need any .sh to make it start on boot.

Hello,

You have one option that, you can write command to navigate to the setup folder and then run command bench start from Startup Application. Please check and confirm.
Thank you.

For me is not starting with debian… how can i check if all my configurations are good?

Maybe you need to check if the services are running on the boot.

Please share output of sudo journalctl please use code Preformatted Code while posting the output here or use pastebin.com

Also try to follow PratikM’s idea of starting the bench manually from the bench directory.

cd /frappe-bench
bench start share the output for this also.

Sorry , but let me know if I am wrong but you are trying to start setup on system restart, right?

Here is the output: ERPNEXT - Pastebin.com

I don’t think i have such a folder… or i don’t know where to find it

Yes…

Here is the output of bench start : bench_start_log - Pastebin.com

Hello!

Im not sure how to do that. Can you guide me please? :smiley:

This looks incomplete though.

are you working on server or local setup ?

It is all i’ve got

I am working on a server

I cannot understand the situation here.

There must be something wrong.
Please check the status of the following services.
sudo systemctl status mariadb
sudo systemctl status nginx
sudo systemctl status redis

Please use 1 reply for everything.

bench@erp:~$ sudo systemctl status mariadb
Output:

● mariadb.service - MariaDB 10.2.31 database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset:
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf
   Active: active (running) since Wed 2020-02-05 12:39:20 EET; 1h 6min ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 773 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCC
  Process: 768 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START
  Process: 555 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR=
  Process: 543 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_
  Process: 530 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run
 Main PID: 626 (mysqld)
   Status: "Taking your SQL requests now..."
    Tasks: 33 (limit: 4915)
   Memory: 314.2M
      CPU: 11.879s
   CGroup: /system.slice/mariadb.service
           └─626 /usr/sbin/mysqld --basedir=/usr

Feb 05 12:39:19 erp mysqld[626]: 2020-02-05 12:39:19 140620182058752 [Note] Inno
Feb 05 12:39:19 erp mysqld[626]: 2020-02-05 12:39:19 140620790572224 [Note] Plug
Feb 05 12:39:19 erp mysqld[626]: 2020-02-05 12:39:19 140620790572224 [Note] Serv
lines 1-23...skipping...
● mariadb.service - MariaDB 10.2.31 database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf
   Active: active (running) since Wed 2020-02-05 12:39:20 EET; 1h 6min ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 773 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS)
  Process: 768 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 555 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exite
  Process: 543 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 530 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
 Main PID: 626 (mysqld)
   Status: "Taking your SQL requests now..."
    Tasks: 33 (limit: 4915)
   Memory: 314.2M
      CPU: 11.879s
   CGroup: /system.slice/mariadb.service
           └─626 /usr/sbin/mysqld --basedir=/usr

Feb 05 12:39:19 erp mysqld[626]: 2020-02-05 12:39:19 140620182058752 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
Feb 05 12:39:19 erp mysqld[626]: 2020-02-05 12:39:19 140620790572224 [Note] Plugin 'FEEDBACK' is disabled.
Feb 05 12:39:19 erp mysqld[626]: 2020-02-05 12:39:19 140620790572224 [Note] Server socket created on IP: '::'.
Feb 05 12:39:19 erp mysqld[626]: 2020-02-05 12:39:19 140620790572224 [Note] Reading of all Master_info entries succeeded
Feb 05 12:39:19 erp mysqld[626]: 2020-02-05 12:39:19 140620790572224 [Note] Added new Master_info '' to hash table
Feb 05 12:39:19 erp mysqld[626]: 2020-02-05 12:39:19 140620790572224 [Note] /usr/sbin/mysqld: ready for connections.
Feb 05 12:39:19 erp mysqld[626]: Version: '10.2.31-MariaDB-10.2.31+maria~stretch'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
Feb 05 12:39:20 erp systemd[1]: Started MariaDB 10.2.31 database server.
Feb 05 12:39:25 erp mysqld[626]: 2020-02-05 12:39:25 140620182058752 [Note] InnoDB: Buffer pool(s) load completed at 200205 12:39:25
Feb 05 13:28:15 erp mysqld[626]: 2020-02-05 13:28:15 140620721522432 [Warning] Aborted connection 67 to db: '_22a64bda8a197560' user: '_22a64bda8a197560' host: 'localhost' (Got an error reading communication pa
~

bench@erp:~$ sudo systemctl status nginx

Output:

● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2020-02-05 12:39:07 EET; 1h 8min ago
     Docs: man:nginx(8)
  Process: 598 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
  Process: 533 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
 Main PID: 599 (nginx)
    Tasks: 5 (limit: 4915)
   Memory: 16.2M
      CPU: 4.084s
   CGroup: /system.slice/nginx.service
           ├─599 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
           ├─600 nginx: worker process
           ├─601 nginx: worker process
           ├─602 nginx: worker process
           └─603 nginx: worker process

Feb 05 12:39:06 erp systemd[1]: Starting A high performance web server and a reverse proxy server...
Feb 05 12:39:07 erp systemd[1]: Started A high performance web server and a reverse proxy server.

bench@erp:~$ sudo systemctl status redis
Output:

● redis-server.service - Advanced key-value store
   Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2020-02-05 12:39:07 EET; 1h 9min ago
     Docs: http://redis.io/documentation,
           man:redis-server(1)
  Process: 577 ExecStartPost=/bin/run-parts --verbose /etc/redis/redis-server.post-up.d (code=exited, status=0/SUCCESS)
  Process: 567 ExecStart=/usr/bin/redis-server /etc/redis/redis.conf (code=exited, status=0/SUCCESS)
  Process: 532 ExecStartPre=/bin/run-parts --verbose /etc/redis/redis-server.pre-up.d (code=exited, status=0/SUCCESS)
 Main PID: 576 (redis-server)
    Tasks: 3 (limit: 4915)
   Memory: 2.7M
      CPU: 6.310s
   CGroup: /system.slice/redis-server.service
           └─576 /usr/bin/redis-server 127.0.0.1:6379

Feb 05 12:39:06 erp systemd[1]: Starting Advanced key-value store...
Feb 05 12:39:06 erp run-parts[532]: run-parts: executing /etc/redis/redis-server.pre-up.d/00_example
Feb 05 12:39:07 erp run-parts[577]: run-parts: executing /etc/redis/redis-server.post-up.d/00_example
Feb 05 12:39:07 erp systemd[1]: Started Advanced key-value store.

Looks like the connection to databases is failing. Not sure why. and log is incomplete you need to scroll down more or expand the windows to see the complete log.
nginx and redis seems fine.

Can you explain the whole situation from the time you installed Frappe bench & erpnext ?

I installed everything following this tutorial: https://www.howtoforge.com/tutorial/how-to-install-erpnext-on-debian/

Everything is fine but the ERP does not start with Debian, so I always need to start it by command: bench start

This is the missing part of error:

(Got an error reading communication packets)