ERPNext Conference 2019* ERPNext.com Blog

Getting Internal Server Error in browser


#1

I am getting “Internal Server Error” while opening erpnext site in browser.
erpnext is running fine in supervisor
Mysql service is also active(running) with this line
“/etc/init.d/mysql: WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz”
in log.

Thanks…


#2

There seems to be a permissions error on your mysql conf file - that will not allow the required mysql optimisations (eg. barracuda etc) to be loaded, so the system might not recognise the DB


#3

There is no my.cnf file in mysql folder though… where can I find my.cnf file?


#4

It could be

  • /etc/mysql/my.cnf
  • /etc/my.cnf
  • ~/.my.cnf
  • /var/lib/mysql/my.cnf

you can try this…

which mysqld

which will produce, for example: /usr/sbin/mysqld

Then

/usr/sbin/mysqld --verbose --help | grep -A 1 “Default options”

which should show the possible options for the file’s location


#5

I have tried these locations
/etc/mysql/my.cnf
/etc/my.cnf
~/.my.cnf
/var/lib/mysql/my.cnf

but could not find my.cnf file…
Though there is mysqld file in /usr/sbin but thats not a config file.
And for /usr/sbin/mysqld --verbose --help | grep -A 1 “Default options” command here is result

grep: options”: No such file or directory
2019-06-17 18:59:01 0 [Warning] Could not increase number of max_open_files to more than 1024 (request: 4186)
2019-06-17 18:59:01 0 [Warning] Changed limits: max_open_files: 1024 max_connections: 151 (was 151) table_cache: 421 (was 2000)
2019-06-17 18:59:01 0 [Note] Plugin ‘FEEDBACK’ is disabled.
2019-06-17 18:59:01 0 [Warning] Could not open mysql.plugin table. Some options may be missing from the help text


#6

This is /etc/mysql folder


#7

Inside conf.d folder…


#8

what is the content of the settings.cnf file


#9

This content in settings.cnf:

[mysqld]

GENERAL

user = mysql
default-storage-engine = InnoDB
socket = /var/lib/mysql/mysql.sock
pid-file = /var/lib/mysql/mysql.pid

MyISAM

key-buffer-size = 32M
myisam-recover = FORCE,BACKUP

SAFETY

max-allowed-packet = 256M
max-connect-errors = 1000000
innodb = FORCE

DATA STORAGE

datadir = /var/lib/mysql/

BINARY LOGGING

log-bin = /var/lib/mysql/mysql-bin
expire-logs-days = 14
sync-binlog = 1

REPLICATION

server-id = 1

CACHES AND LIMITS

tmp-table-size = 32M
max-heap-table-size = 32M
query-cache-type = 0
query-cache-size = 0
max-connections = 500
thread-cache-size = 50
open-files-limit = 65535
table-definition-cache = 4096
table-open-cache = 10240

INNODB

innodb-flush-method = O_DIRECT
innodb-log-files-in-group = 2
innodb-log-file-size = 512M
innodb-flush-log-at-trx-commit = 1
innodb-file-per-table = 1
innodb-buffer-pool-size = 5324M
innodb-file-format = barracuda
innodb-large-prefix = 1
collation-server = utf8mb4_unicode_ci
character-set-server = utf8mb4
character-set-client-handshake = FALSE
max_allowed_packet = 256M

LOGGING

log-error = /var/lib/mysql/mysql-error.log
log-queries-not-using-indexes = 0
slow-query-log = 1
slow-query-log-file = /var/lib/mysql/mysql-slow.log

[mysql]
default-character-set = utf8mb4

[mysqldump]
max_allowed_packet=256M

BEGIN ANSIBLE MANAGED BLOCK

Import all .cnf files from configuration directory

!includedir /etc/mysql/mariadb.conf.d/

END ANSIBLE MANAGED BLOCK


#10

That all looks OK.
The original line indicates an error in the mysql server. Maybe the file
/etc/init.d/mysql
has an error or is not recognising the .cnf files


#11

What should I do?
If all configuration is in settings.cnf then why it looks for my.cnf which doest not exist?


#12

I have removed mysql/mariadb completely, and then reinstalled it…
Now problem solved.
Btw thanks @trentmu for your time…