Mysql gets crashing in production :
I have 64 GB RAM with 6 core CPU.
my.cnf
\[mysqld\]
server-id=1
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
datadir = /var/lib/mysql
log-error = /var/log/mysql/error.log
lower-case-table-names=1
slow_query_log=1
log_bin_trust_function_creators=1
innodb_buffer_pool_size=40G
block_encryption_mode =aes-256-cbc
wait_timeout=600
interactive_timeout=600
log_timestamps=SYSTEM
max_connections=1000
max_allowed_packet=1073741824
binlog_expire_logs_seconds=1296000
innodb_print_all_deadlocks=ON
thread_cache_size=1001
group_concat_max_len=10000
log_output=TABLE,FILE
\###Loging...
log-bin-index=/var/lib/mysql/binlog/mysql-bin.index
log_bin = /var/lib/mysql/binlog/mysql-bin.log
\##audit logging
audit_log_file=/var/lib/mysql/auditlog/audit.log
\#audit_log_rotate_on_size=1024M
\#audit_log_rotations=30
audit_log_policy=QUERIES
audit_log_exclude_accounts=root#localhost
audit_log_format=JSON
Error log:
```
UTC - mysqld got signal 11 ;Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.Thread pointer: 0x7f0278bc96c0Attempting backtrace. You can use the following information to find outwhere mysqld died. If you see no messages after this, something wentterribly wrong...stack_bottom = 7f0dac192d10 thread_stack 0x46000/usr/sbin/mysqld(my_print_stacktrace(unsigned char const*, unsigned long)+0x3d) [0x560428bc449d]/usr/sbin/mysqld(handle_fatal_signal+0x2fb) [0x560427b6e22b]/lib/x86_64-linux-gnu/libpthread.so.0(+0x12980) [0x7f0e0c5dc980]/usr/sbin/mysqld(+0xf293ce) [0x560427a113ce]/usr/sbin/mysqld(+0xf295f2) [0x560427a115f2]/usr/sbin/mysqld(+0xf29623) [0x560427a11623]/usr/sbin/mysqld(JOIN::finalize_table_conditions()+0xeb) [0x560427a1787b]/usr/sbin/mysqld(JOIN::replace_index_subquery()+0x107) [0x560427a17d27]/usr/sbin/mysqld(JOIN::optimize()+0x2765) [0x560427a2b1b5]/usr/sbin/mysqld(SELECT_LEX::optimize(THD*)+0xb6) [0x560427a87c46]/usr/sbin/mysqld(SELECT_LEX_UNIT::optimize(THD*, TABLE*, bool)+0x7b) [0x560427af63eb]/usr/sbin/mysqld(SELECT_LEX::optimize(THD*)+0x115) [0x560427a87ca5]/usr/sbin/mysqld(SELECT_LEX_UNIT::optimize(THD*, TABLE*, bool)+0x7b) [0x560427af63eb]/usr/sbin/mysqld(TABLE_LIST::optimize_derived(THD*)+0x40) [0x560427ec9dd0]/usr/sbin/mysqld(JOIN::optimize()+0x46c) [0x560427a28ebc]/usr/sbin/mysqld(SELECT_LEX::optimize(THD*)+0xb6) [0x560427a87c46]/usr/sbin/mysqld(SELECT_LEX_UNIT::optimize(THD*, TABLE*, bool)+0x7b) [0x560427af63eb]/usr/sbin/mysqld(Sql_cmd_dml::execute_inner(THD*)+0x3d) [0x560427a8665d]/usr/sbin/mysqld(Sql_cmd_dml::execute(THD*)+0x598) [0x560427a906e8]/usr/sbin/mysqld(mysql_execute_command(THD*, bool)+0xaae) [0x560427a3346e]/usr/sbin/mysqld(sp_instr_stmt::exec_core(THD*, unsigned int*)+0x51) [0x5604279afe71]/usr/sbin/mysqld(sp_lex_instr::reset_lex_and_exec_core(THD*, unsigned int*, bool)+0x17b) [0x5604279b1d4b]/usr/sbin/mysqld(sp_lex_instr::validate_lex_and_execute_core(THD*, unsigned int*, bool)+0xde) [0x5604279b2cfe]/usr/sbin/mysqld(sp_instr_stmt::execute(THD*, unsigned int*)+0xc3) [0x5604279b4543]/usr/sbin/mysqld(sp_head::execute(THD*, bool)+0x3be) [0x5604279a90de]/usr/sbin/mysqld(sp_head::execute_procedure(THD*, mem_root_deque<Item*>)+0x7e3) [0x5604279ac423]/usr/sbin/mysqld(Sql_cmd_call::execute_inner(THD)+0x136) [0x560427ebf106]/usr/sbin/mysqld(Sql_cmd_dml::execute(THD*)+0x598) [0x560427a906e8]/usr/sbin/mysqld(mysql_execute_command(THD*, bool)+0xaae) [0x560427a3346e]/usr/sbin/mysqld(dispatch_sql_command(THD*, Parser_state*)+0x3f9) [0x560427a36d29]/usr/sbin/mysqld(dispatch_command(THD*, COM_DATA const*, enum_server_command)+0x15ed) [0x560427a3880d]/usr/sbin/mysqld(do_command(THD*)+0x1c4) [0x560427a39fe4]/usr/sbin/mysqld(+0x1077020) [0x560427b5f020]/usr/sbin/mysqld(+0x2640091) [0x560429128091]/lib/x86_64-linux-gnu/libpthread.so.0(+0x76db) [0x7f0e0c5d16db]/lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x7f0e0a7c371f]
Trying to get some variables.Some pointers may be invalid and cause the dump to abort.Query (7f0278518848): is an invalid pointerConnection ID (thread ID): 242364Status: NOT_KILLED ```
Mysql sql got crash Every alter day don't know what is the issue with this.
Related
I got this issue when working with mysql. Yesterday I cannot query the new records of table anymore (can query old record of previous days). Also, I cannot dump the backup data. When I get the log of MySQL, it show like that
022-08-18T08:10:18.911945Z 11 [Warning] [MY-013021] [InnoDB] A transaction id in a record of table `timesheet`.`app_timesheet_entries` is newer than the system-wide maximum.
2022-08-18T08:10:18.911965Z 11 [ERROR] [MY-013183] [InnoDB] Assertion failure: buf0buf.cc:3224:block->page.get_space() != nullptr thread 139904938870528
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
08:10:18 UTC - mysqld got signal 6 ;
Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
Thread pointer: 0x7f3da4000fc0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 7f3e282efd10 thread_stack 0x100000
/usr/sbin/mysqld(my_print_stacktrace(unsigned char const*, unsigned long)+0x41) [0x5625d5ef94c1]
/usr/sbin/mysqld(print_fatal_signal(int)+0x2fb) [0x5625d4d98fbb]
/usr/sbin/mysqld(my_server_abort()+0x76) [0x5625d4d99106]
/usr/sbin/mysqld(my_abort()+0xe) [0x5625d5ef34be]
/usr/sbin/mysqld(ut_dbg_assertion_failed(char const*, char const*, unsigned long)+0x349) [0x5625d6183f59]
/usr/sbin/mysqld(+0x25b4e28) [0x5625d61eae28]
/usr/sbin/mysqld(buf_page_init_for_read(dberr_t*, unsigned long, page_id_t const&, page_size_t const&, bool)+0x2b9) [0x5625d61f6059]
/usr/sbin/mysqld(buf_read_page_low(dberr_t*, bool, unsigned long, unsigned long, page_id_t const&, page_size_t const&, bool)+0x9e) [0x5625d622f19e]
/usr/sbin/mysqld(buf_read_page(page_id_t const&, page_size_t const&)+0x4a) [0x5625d622f8ea]
/usr/sbin/mysqld(Buf_fetch<Buf_fetch_normal>::read_page()+0x38) [0x5625d61eb4d8]
/usr/sbin/mysqld(Buf_fetch_normal::get(buf_block_t*&)+0x657) [0x5625d61f7017]
/usr/sbin/mysqld(Buf_fetch<Buf_fetch_normal>::single_page()+0x59) [0x5625d61f7109]
/usr/sbin/mysqld(buf_page_get_gen(page_id_t const&, page_size_t const&, unsigned long, buf_block_t*, Page_fetch, ut::Location, mtr_t*, bool)+0x233) [0x5625d61f8713]
/usr/sbin/mysqld(+0x251c049) [0x5625d6152049]
/usr/sbin/mysqld(trx_undo_prev_version_build(unsigned char const*, mtr_t*, unsigned char const*, dict_index_t const*, unsigned long*, mem_block_info_t*, unsigned char**, mem_block_info_t*, dtuple_t const**, unsigned long, lob::undo_vers_t*)+0x698) [0x5625d6152908]
/usr/sbin/mysqld(row_vers_build_for_consistent_read(unsigned char const*, mtr_t*, dict_index_t*, unsigned long**, ReadView*, mem_block_info_t**, mem_block_info_t*, unsigned char**, dtuple_t const**, lob::undo_vers_t*)+0x2ac) [0x5625d61036fc]
/usr/sbin/mysqld(row_search_mvcc(unsigned char*, page_cur_mode_t, row_prebuilt_t*, unsigned long, unsigned long)+0x2def) [0x5625d60eadaf]
/usr/sbin/mysqld(ha_innobase::general_fetch(unsigned char*, unsigned int, unsigned int)+0x1f8) [0x5625d5f55a88]
/usr/sbin/mysqld(handler::ha_index_next(unsigned char*)+0x25d) [0x5625d4eb43fd]
/usr/sbin/mysqld(IndexScanIterator<false>::Read()+0x55) [0x5625d5000b15]
/usr/sbin/mysqld(FilterIterator::Read()+0x18) [0x5625d516e5d8]
/usr/sbin/mysqld(Query_expression::ExecuteIteratorQuery(THD*)+0x376) [0x5625d4d021e6]
/usr/sbin/mysqld(Query_expression::execute(THD*)+0x33) [0x5625d4d02493]
/usr/sbin/mysqld(Sql_cmd_dml::execute(THD*)+0x186) [0x5625d4c8f8d6]
/usr/sbin/mysqld(mysql_execute_command(THD*, bool)+0xa00) [0x5625d4c2bc30]
/usr/sbin/mysqld(dispatch_sql_command(THD*, Parser_state*)+0x434) [0x5625d4c30a94]
/usr/sbin/mysqld(dispatch_command(THD*, COM_DATA const*, enum_server_command)+0x1d17) [0x5625d4c32cd7]
/usr/sbin/mysqld(do_command(THD*)+0x207) [0x5625d4c33fd7]
/usr/sbin/mysqld(+0x1153e48) [0x5625d4d89e48]
/usr/sbin/mysqld(+0x282ea4d) [0x5625d6464a4d]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x8609) [0x7f3e4333d609]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x43) [0x7f3e425a9163]
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7f3da421f720): is an invalid pointer
Connection ID (thread ID): 11
Status: NOT_KILLED
I'm appricate any help to let me know what is the root cause of it
Thanks
I got same error log in mysql8(version 8.0.30), Mysql keep crashing . So we set force_recovery=6 and export data of broken table (as many as we could) to a csv file,then drop table and create it and import data. After that Mysql is working fine till now.
I am trying to set up MySQL group replication. Only problem is, that when I try to start replication group, It starts with super_read_only.
Here the configurations in my.cnf file
[mysqld]
max_binlog_size = 4096
default_authentication_plugin = mysql_native_password
log_bin = mysql-bin-1.log
enforce_gtid_consistency = ON
gtid_mode = ON
log_slave_updates = ON
binlog_checksum = NONE
plugin-load-add = group_replication.so
plugin-load-add = mysql_clone.so
relay_log_recovery = ON
transaction_write_set_extraction = XXHASH64
loose_group_replication_start_on_boot = OFF
loose_group_replication_group_name = 74fe8890-679f-4e93-9169-a7edfbc1d427
loose_group_replication_group_seeds = mysql_cluster_mysql0_1:3306, mysql_cluster_mysql1_1:3306, mysql_cluster_mysql2_1:3306
loose_group_replication_single_primary_mode = ON
loose_group_replication_enforce_update_everywhere_checks = OFF
bind-address = 0.0.0.0
instances are run inside docker, that's why group seed addresses has these hostnames.
Also here the procedure for running master instance.
DELIMITER $$
USE `db`$$
DROP PROCEDURE IF EXISTS `set_as_master`$$
CREATE DEFINER=`root`#`%` PROCEDURE `set_as_master`()
BEGIN
SET ##GLOBAL.group_replication_bootstrap_group=1;
CREATE USER IF NOT EXISTS 'repl'#'%';
GRANT REPLICATION SLAVE ON *.* TO repl#'%';
FLUSH PRIVILEGES;
CHANGE MASTER TO MASTER_USER='root' FOR CHANNEL 'group_replication_recovery';
START GROUP_REPLICATION;
-- SELECT * FROM performance_schema.replication_group_members;
END$$
DELIMITER;
After running CALL start_as_master; in Sqlyog, process stucks on below lines.
'CHANGE MASTER TO FOR CHANNEL 'group_replication_recovery' executed'. Previous state master_host='', master_port= 3306, master_log_file='', master_log_pos= 4, master_bind=''. New state master_host='', master_port= 3306, master_log_file='', master_log_pos= 4, master_bind=''.
2021-03-03T21:47:55.934818Z 8 [System] [MY-013587] [Repl] Plugin group_replication reported: 'Plugin 'group_replication' is starting.'
2021-03-03T21:47:55.935929Z 9 [System] [MY-011565] [Repl] Plugin group_replication reported: 'Setting super_read_only=ON.'
Why does it run with super_read_only=ON?
Is there anything I miss during configuration or running script?
MySQL version is 8.0.23.
Try to run this then restart the replication
set global super_read_only=0;
Let me know if it works
From last 4 days we are facing frequent database crashes with mysql infobright engine, there is no recent changes on production environment and no updates.
Currently we are using the version 5.1.40.
Find the below dump, can any one help to figure out the issue.
170520 21:12:08 - mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.
key_buffer_size=1677721600
read_buffer_size=1048576
max_used_connections=75
max_threads=1000
threads_connected=54
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 3696548 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
thd: 0xc2a4bd000
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0x7fc0d0bede58 thread_stack 0x80000
/usr/local/infobright-4.7.1-x86_64/bin/mysqld() [0xaef849]
/usr/local/infobright-4.7.1-x86_64/bin/mysqld() [0x412e13]
/lib64/libpthread.so.0(+0xf7e0) [0x7fc0d48c77e0]
/usr/local/infobright-4.7.1-x86_64/bin/mysqld() [0xb10635]
/usr/local/infobright-4.7.1-x86_64/bin/mysqld() [0xb1f123]
/usr/local/infobright-4.7.1-x86_64/bin/mysqld() [0x9a9693]
/usr/local/infobright-4.7.1-x86_64/bin/mysqld() [0x76ae0c]
/usr/local/infobright-4.7.1-x86_64/bin/mysqld() [0x76b594]
/usr/local/infobright-4.7.1-x86_64/bin/mysqld() [0x767ab3]
/usr/local/infobright-4.7.1-x86_64/bin/mysqld() [0x7694ea]
/usr/local/infobright-4.7.1-x86_64/bin/mysqld() [0x72902b]
/usr/local/infobright-4.7.1-x86_64/bin/mysqld() [0x422325]
/usr/local/infobright-4.7.1-x86_64/bin/mysqld() [0x427573]
/usr/local/infobright-4.7.1-x86_64/bin/mysqld() [0x42b38c]
/usr/local/infobright-4.7.1-x86_64/bin/mysqld() [0x42c227]
/usr/local/infobright-4.7.1-x86_64/bin/mysqld() [0x42cb05]
/usr/local/infobright-4.7.1-x86_64/bin/mysqld() [0x41f06d]
/lib64/libpthread.so.0(+0x7aa1) [0x7fc0d48bfaa1]
/lib64/libc.so.6(clone+0x6d) [0x7fc0d460caad]
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0xc2da5e410 = SELECT DATE_FORMAT(DATETIME,'%Y%m%d') AS YEAR_MONTH_DAY_SK ,HOUR(DATETIME) AS HOUR_SK, IFNULL(DESTINATION,'0') AS DESTINATION, IFNULL(DATETIME,'1970-01-01 00:00:00') AS DATETIME, IFNULL(CLIENTID,'0') AS CLIENTID, IFNULL(GROUPID,'0') AS GROUPID, IFNULL(TEAMID,'0') AS TEAMID, IFNULL(SERVICEID,'0') AS SERVICEID, IFNULL(CHANNELID,'0') AS CHANNELID, IFNULL(STATUSID,'0') AS STATUSID, CASE REASONCODE WHEN '' THEN NULL WHEN NULL THEN NULL ELSE REASONCODE END AS REASONCODE, CASE REASONDESC WHEN '' THEN NULL WHEN NULL THEN NULL ELSE REASONDESC END AS REASONDESC, IFNULL(ACTIONTYPE1ID,'0') AS ACTIONTYPE1ID, CASE ACTIONTYPE1DESC WHEN '' THEN NULL WHEN NULL THEN NULL ELSE ACTIONTYPE1DESC END AS ACTIONTYPE1DESC, IFNULL(ACTIONTYPE2ID,'0') AS ACTIONTYPE2ID, CASE ACTIONTYPE2DESC WHEN '' THEN NULL WHEN NULL THEN NULL ELSE ACTIONTYPE2DESC END AS ACTIONTYPE2DESC, IFNULL(ATTACHMENT,'0') AS ATTACHMENT, CASE MIMETYPE WHEN '' THEN NULL WHEN NULL THEN NULL ELSE MIMETYPE END AS MIMETYPE, CASE VOICEFLOWNAME WH
thd->thread_id=35918
thd->killed=NOT_KILLED
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
170520 21:12:08 mysqld_safe Number of processes running now: 0
170520 21:12:08 mysqld_safe mysqld restarted
tcmalloc: large alloc 1365172224 bytes == 0x4518000 #
Loading configuration for Infobright instance ...
Option: AllowMySQLQueryPath, value: 1.
Option: AutoConfigure, value: 0.
Option: CacheFolder, value: /usr/local/infobright-4.7.1-x86_64/cache.
Option: ControlMessages, value: 0.
Option: IBEngineRevision, value: IEE_4.7.1_r30553_31737.
Option: InternalMessages, value: 0.
Option: InternalMessagesFlushPeriod, value: 60.
Option: KNFolder, value: BH_RSI_Repository.
Option: KNLevel, value: 99.
Option: LicenseCheckInterval, value: 0.
Option: LicenseExpireWarningDays, value: 0.
Option: LicenseFile, value: <unknown>.
Option: LicenseServerIPAddr, value: .
Option: LicenseServerType, value: .
Option: LicenseServerWarningNumber, value: .
Option: LoaderMainHeapSize, value: 800.
Option: PushDown, value: 1.
Option: ServerMainHeapSize, value: 48000.
Option: UseMySQLImportExportDefaults, value: 0.
Option: bherrLogLevel, value: 1.
Infobright instance configuration loaded.
tcmalloc: large alloc 40265318400 bytes == 0x687c8000 #
tcmalloc: large alloc 10066329600 bytes == 0x9cff48000 #
170520 21:12:09 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use
170520 21:12:09 [ERROR] Do you already have another mysqld server running on port: 5029 ?
170520 21:12:09 [ERROR] Aborting
170520 21:12:09 [Note] /usr/local/infobright-4.7.1-x86_64/bin/mysqld: Shutdown complete
170520 21:12:09 mysqld_safe mysqld from pid file /data/infobright/data/SH-UMP-CINFBRT2.pid ended
Recently upgraded to MySQL 5.7.12 on a Debian (Debian 3.2.78-1 x86_64 GNU/Linux) and have been running into the server hanging after every few hours. This is getting flooded in the syslog and mysql.log:
2016-06-13T18:05:20.261209Z 0 [ERROR] Error in accept: Bad file descriptor
MySQL info:
mysql Ver 14.14 Distrib 5.7.12-5, for debian-linux-gnu (x86_64) using 6.2
Pieces of my.cnf mysqld section that can guide some assistance on tweaking values:
[mysqld]
max_allowed_packet = 64M
thread_stack = 256K
thread_cache_size = 8
max_connections = 150
max_connect_errors = 10000
connect_timeout = 30
wait_timeout = 86400
table_open_cache = 2048
open_files_limit = 65535
query_cache_limit = 4M
query_cache_size = 128M
query_cache_type = 1
server-id = 1
log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
# * InnoDB
innodb_file_per_table
innodb_buffer_pool_instances=2
innodb_buffer_pool_size=2G
thread_pool_size = 24
We had the same issue on a Ubuntu 16.04 system with mysql 5.7.13 . We increased our max open files parameter in systemd like this:
/etc/systemd/system/mysql.service.d/10-ulimit.conf
[Service]
LimitNOFILE=1000000
So far the issue did not happen again. Maybe mysql needs somehow more file descriptors now.
I found the problem (or possibly one of the problems). Here is an extract from strace on mysqld:
...
socket(PF_INET6, SOCK_STREAM, IPPROTO_TCP) = 20
write(2, "2017-01-29T22:22:45.433033Z 0 [N"..., 72) = 72
setsockopt(20, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
setsockopt(20, SOL_IPV6, IPV6_V6ONLY, [0], 4) = 0
bind(20, {sa_family=AF_INET6, sin6_port=htons(3306), inet_pton(AF_INET6, "::", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = 0
listen(20, 70) = 0
fcntl(20, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(20, F_SETFL, O_RDWR|O_NONBLOCK) = 0
...
accept(20, {sa_family=AF_INET6, sin6_port=htons(58332), inet_pton(AF_INET6, "::ffff:127.0.0.1", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, [28]) = 37
rt_sigaction(SIGCHLD, {SIG_DFL, [CHLD], SA_RESTORER|SA_RESTART, 0x7f3ddeac84b0}, {SIG_DFL, [], 0}, 8) = 0
getpeername(37, {sa_family=AF_INET6, sin6_port=htons(58332), inet_pton(AF_INET6, "::ffff:127.0.0.1", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, [28]) = 0
getsockname(37, {sa_family=AF_INET6, sin6_port=htons(3306), inet_pton(AF_INET6, "::ffff:127.0.0.1", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, [28]) = 0
open("/etc/hosts.allow", O_RDONLY) = 38
fstat(38, {st_mode=S_IFREG|0644, st_size=589, ...}) = 0
read(38, "# /etc/hosts.allow: list of host"..., 4096) = 589
read(38, "", 4096) = 0
close(38) = 0
open("/etc/hosts.deny", O_RDONLY) = 38
fstat(38, {st_mode=S_IFREG|0644, st_size=704, ...}) = 0
read(38, "# /etc/hosts.deny: list of hosts"..., 4096) = 704
close(38) = 0
socket(PF_LOCAL, SOCK_DGRAM|SOCK_CLOEXEC, 0) = 38
connect(38, {sa_family=AF_LOCAL, sun_path="/dev/log"}, 110) = 0
sendto(38, "<36>Jan 29 14:23:08 mysqld[13052"..., 72, MSG_NOSIGNAL, NULL, 0) = 72
shutdown(20, SHUT_RDWR) = 0
close(20) = 0
poll([{fd=20, events=POLLIN}, {fd=22, events=POLLIN}], 2, -1) = 1 ([{fd=20, revents=POLLNVAL}])
accept(-1, 0x7ffe6ebd7160, 0x7ffe6ebd70fc) = -1 EBADF (Bad file descriptor)
write(2, "2017-01-29T22:23:08.109451Z 0 [E"..., 75) = 75
... rinse and repeat *REALLY* fast!
In locking down my system with tcp_wrappers I had inadvertently taken mysqld out of both hosts.allow and hosts.deny. It seems that after checking both hosts.allow and hosts.deny mysqld shuts down and closes the socket as you might expect. However it them immediately starts to poll the (now non-existent) socket for activity.
I just did another test where my tcp_wrappers was correctly configured. When I connect from an authorized host all is fine; however when I connected from a blocked address the same issue occurs. Based on this I recommend using other tools to secure mysqld and making your tcp_wrappers config more open than your firewall. That being said the bug should still be fixed!
This fix has yet to stand the test of time so, as usual, YMMV. Hope it helps anyway
Nick
Researched a bit and found following;
Present in MariaDB also
https://lists.launchpad.net/maria-discuss/msg03060.html
https://mariadb.atlassian.net/browse/MDEV-8995
Percona Server/Percona XtraDB Cluster
https://groups.google.com/forum/#!topic/percona-discussion/Tu0S2OvYqKA
Old bug from 2010/2012
https://bugs.mysql.com/bug.php?id=48929
http://lists.mysql.com/commits/96472
Some interesting information (should never happen)
https://lists.mysql.com/mysql/97275
[I work for Percona]
I have the same issue after upgrading to Percona Cluster 5.7.14-26.17-1.trusty.
The ulimit.conf suggestion doesn't help, and I've made sure that there are sufficient file handles, so far as I can tell, by editing /etc/security/limits.conf and /etc/sysctl.conf.
I can reproduce this easily by telnetting to post 3306 and then disconnecting; the server then goes into a spin logging this error.
A horrible workaround for this, which looks promising in my environment, is to avoid using TCP connections on port 3306, and use unix sockets instead.
You can proxy from port 3306 to the socket by changing the port number in /etc/mysql/my.cnf and then using socat
nohup socat TCP4-LISTEN:3306,fork UNIX-CONNECT:/var/run/mysqld/mysqld.sock&
If I then telnet in on port 3306 and disconnect, I can't provoke the problem. I intend to report back on how well this stands up over time.
FWIW, the code looks as though it expects this to happen sometimes:
for (uint retry= 0; retry < MAX_ACCEPT_RETRY; retry++)
{
socket_len_t length= sizeof(struct sockaddr_storage);
connect_sock= mysql_socket_accept(key_socket_client_connection, listen_sock,
(struct sockaddr *)(&cAddr), &length);
if (mysql_socket_getfd(connect_sock) != INVALID_SOCKET ||
(socket_errno != SOCKET_EINTR && socket_errno != SOCKET_EAGAIN))
break;
}
if (mysql_socket_getfd(connect_sock) == INVALID_SOCKET)
{
/*
accept(2) failed on the listening port, after many retries.
There is not much details to report about the client,
increment the server global status variable.
*/
connection_errors_accept++;
if ((m_error_count++ & 255) == 0) // This can happen often
sql_print_error("Error in accept: %s", strerror(errno));
if (socket_errno == SOCKET_ENFILE || socket_errno == SOCKET_EMFILE)
sleep(1); // Give other threads some time
return NULL;
}
I came here with the same error and none of the solutions worked BUT after some research on our end we found that it was apparmor that was denying our logging directory causing the bad file descriptors error message.
I have checked this similar issue here but it didnt work in my case.
I am trying to setup SonarQube Server locally on Windows OS[non English language] however i am getting this error on http://localhost:8000:
org.jruby.rack.RackInitializationException: ActiveRecord::JDBCError: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOT NULL) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin' at line 1: CREATE TABLE `schema_migrations` (`version` varchar NOT NULL) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin
from C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract_adapter.rb:227:in `log'
from C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/jdbc/adapter.rb:183:in `execute'
from C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/schema_statements.rb:109:in `create_table'
from C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/mysql/adapter.rb:252:in `create_table'
from C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/schema_statements.rb:371:in `initialize_schema_migrations_table'
from C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:441:in `initialize'
from C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:401:in `up'
from C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:383:in `migrate'
from C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/config/../lib/database_version.rb:62:in `upgrade_and_start'
from C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/config/../lib/database_version.rb:73:in `automatic_setup'
from C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/config/environment.rb:272:in `(root)'
from org/jruby/RubyKernel.java:1094:in `load'
from file:/C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails/environment2.rb:1:in `(root)'
from file:/C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails/environment2.rb:25:in `load_environment'
from file:/C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails_booter.rb:79:in `load_environment'
at org.jruby.rack.RackInitializationException.wrap(RackInitializationException.java:29)
at org.jruby.rack.RackApplicationFactoryDecorator.init(RackApplicationFactoryDecorator.java:98)
at org.jruby.rack.RackServletContextListener.contextInitialized(RackServletContextListener.java:50)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4720)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.jruby.exceptions.RaiseException: (StatementInvalid) ActiveRecord::JDBCError: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOT NULL) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin' at line 1: CREATE TABLE `schema_migrations` (`version` varchar NOT NULL) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin
at RUBY.log(C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract_adapter.rb:227)
at RUBY.execute(C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/jdbc/adapter.rb:183)
at RUBY.create_table(C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/schema_statements.rb:109)
at RUBY.create_table(C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/mysql/adapter.rb:252)
at RUBY.initialize_schema_migrations_table(C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/schema_statements.rb:371)
at RUBY.initialize(C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:441)
at RUBY.up(C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:401)
at RUBY.migrate(C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:383)
at RUBY.upgrade_and_start(C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/config/../lib/database_version.rb:62)
at RUBY.automatic_setup(C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/config/../lib/database_version.rb:73)
at RUBY.(root)(C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/config/environment.rb:272)
at org.jruby.RubyKernel.load(org/jruby/RubyKernel.java:1094)
at RUBY.(root)(file:/C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails/environment2.rb:1)
at RUBY.load_environment(file:/C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails/environment2.rb:25)
at RUBY.load_environment(file:/C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails_booter.rb:79)
Tried:
Checked User Priviledges and Database
Changed default
port no of Sonar in sonar.properties[sonar.web.port=8000] in
case another service is using it
Restarted sonar service
Wrote JDK path manually on wrapper.config(wrapper.java.command=C:\Program Files\Java\jdk1.8.0_60)
[none of the above worked]
Here are my configs sonar.properties:
# User credentials.
# Permissions to create tables, indices and triggers must be granted to JDBC user.
# The schema must be created first.
sonar.jdbc.username=sonar
sonar.jdbc.password=sonar
#----- Embedded Database (default)
# It does not accept connections from remote hosts, so the
# server and the analyzers must be executed on the same host.
#sonar.jdbc.url=jdbc:h2:tcp://localhost:9092/sonar
# H2 embedded database server listening port, defaults to 9092
#sonar.embeddedDatabase.port=9092
#----- MySQL 5.x
# Only InnoDB storage engine is supported (not myISAM).
# Only the bundled driver is supported.
sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance
# - If you need to set the schema, please refer to http://jira.codehaus.org/browse/SONAR-5000
#sonar.jdbc.url=jdbc:oracle:thin:#localhost/XE
#----- PostgreSQL 8.x/9.x
# If you don't use the schema named "public", please refer to http://jira.codehaus.org/browse/SONAR-5000
#sonar.jdbc.url=jdbc:postgresql://localhost/sonar
#...
#--------------------------------------------------------------------------------------------------
# WEB SERVER
# Web server is executed in a dedicated Java process. By default heap size is 768Mb.
# Use the following property to customize JVM options.
# Recommendations:
#
# The HotSpot Server VM is recommended. The property -server should be added if server mode
# is not enabled by default on your environment: http://docs.oracle.com/javase/7/docs/technotes/guides/vm/server-class.html
#
# Set min and max memory (respectively -Xms and -Xmx) to the same value to prevent heap
# from resizing at runtime.
#
#sonar.web.javaOpts=-Xmx768m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError
# Same as previous property, but allows to not repeat all other settings like -Xmx
#sonar.web.javaAdditionalOpts=
# Binding IP address. For servers with more than one IP address, this property specifies which
# address will be used for listening on the specified ports.
# By default, ports will be used on all IP addresses associated with the server.
#sonar.web.host=127.0.0.1
# Web context. When set, it must start with forward slash (for example /sonarqube).
# The default value is root context (empty value).
#sonar.web.context=/
# TCP port for incoming HTTP connections. Disabled when value is -1.
sonar.web.port=8000
Script used to create Sonar DB:
CREATE DATABASE sonar CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'sonar' IDENTIFIED BY 'sonar';
GRANT ALL ON sonar.* TO 'sonar'#'%' IDENTIFIED BY 'sonar';
GRANT ALL ON sonar.* TO 'sonar'#'localhost' IDENTIFIED BY 'sonar';
FLUSH PRIVILEGES;
here is full sonar.log:
--> Wrapper Started as Console
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
2015.09.28 09:49:27 INFO app[o.s.p.m.JavaProcessLauncher] Launch process[search]: C:\Program Files\Java\jre1.8.0_60\bin\java -Djava.awt.headless=true -Xmx1G -Xms256m -Xss256k -Djava.net.preferIPv4Stack=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -Djava.io.tmpdir=C:\Users\ss\Desktop\SonarQube\sonarqube-5.1.2\temp -cp ./lib/common/*;./lib/search/* org.sonar.search.SearchServer C:\Users\SS~1\AppData\Local\Temp\sq-process5996908890443263390properties
2015.09.28 09:49:28 INFO es[o.s.p.ProcessEntryPoint] Starting search
2015.09.28 09:49:28 INFO es[o.s.s.SearchServer] Starting Elasticsearch[sonarqube] on port 9001
2015.09.28 09:49:29 INFO es[o.elasticsearch.node] [sonar-1443422966104] version[1.4.4], pid[8044], build[c88f77f/2015-02-19T13:05:36Z]
2015.09.28 09:49:29 INFO es[o.elasticsearch.node] [sonar-1443422966104] initializing ...
2015.09.28 09:49:29 INFO es[o.e.plugins] [sonar-1443422966104] loaded [], sites []
2015.09.28 09:49:34 INFO es[o.elasticsearch.node] [sonar-1443422966104] initialized
2015.09.28 09:49:34 INFO es[o.elasticsearch.node] [sonar-1443422966104] starting ...
2015.09.28 09:49:36 INFO es[o.e.transport] [sonar-1443422966104] bound_address {inet[/0.0.0.0:9001]}, publish_address {inet[/192.168.1.103:9001]}
2015.09.28 09:49:36 INFO es[o.e.discovery] [sonar-1443422966104] sonarqube/JRwVvtz7Qb2Nfq2TD0uGeQ
2015.09.28 09:49:39 INFO es[o.e.cluster.service] [sonar-1443422966104] new_master [sonar-1443422966104][JRwVvtz7Qb2Nfq2TD0uGeQ][ss-pc][inet[/192.168.1.103:9001]]{rack_id=sonar-1443422966104}, reason: zen-disco-join (elected_as_master)
2015.09.28 09:49:39 INFO es[o.elasticsearch.node] [sonar-1443422966104] started
2015.09.28 09:49:40 INFO es[o.e.gateway] [sonar-1443422966104] recovered [1] indices into cluster_state
2015.09.28 09:49:40 INFO app[o.s.p.m.Monitor] Process[search] is up
2015.09.28 09:49:40 INFO app[o.s.p.m.JavaProcessLauncher] Launch process[web]: C:\Program Files\Java\jre1.8.0_60\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djruby.management.enabled=false -Djruby.compile.invokedynamic=false -Xmx768m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true -Djava.io.tmpdir=C:\Users\ss\Desktop\SonarQube\sonarqube-5.1.2\temp -cp ./lib/common/*;./lib/server/*;C:\Users\ss\Desktop\SonarQube\sonarqube-5.1.2\lib\jdbc\mysql\mysql-connector-java-5.1.34.jar org.sonar.server.app.WebServer C:\Users\SELAHA~1\AppData\Local\Temp\sq-process3295624311748506992properties
2015.09.28 09:49:42 INFO web[o.s.p.ProcessEntryPoint] Starting web
2015.09.28 09:49:42 INFO web[o.s.s.app.Webapp] Webapp directory: C:\Users\ss\Desktop\SonarQube\sonarqube-5.1.2\web
2015.09.28 09:49:43 INFO web[o.a.c.h.Http11NioProtocol] Initializing ProtocolHandler ["http-nio-0.0.0.0-9000"]
2015.09.28 09:49:43 INFO web[o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
2015.09.28 09:49:50 INFO web[o.e.plugins] [sonar-1443422966104] loaded [], sites []
2015.09.28 09:49:51 INFO web[o.s.s.p.ServerImpl] SonarQube Server / 5.1.2 / 2a52a7106b2bfbd659c591c2d6fc09ad0ab2db5c
2015.09.28 09:49:51 INFO web[o.s.c.p.Database] Create JDBC datasource for jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance
2015.09.28 09:49:54 INFO web[o.s.s.p.DefaultServerFileSystem] SonarQube home: C:\Users\ss\Desktop\SonarQube\sonarqube-5.1.2
2015.09.28 09:49:55 INFO web[o.s.s.p.ServerPluginJarsInstaller] Install plugins
2015.09.28 09:49:55 INFO web[o.s.s.p.ServerPluginJarsInstaller] Deploy plugin Core / 5.1.2 / 2a52a7106b2bfbd659c591c2d6fc09ad0ab2db5c
2015.09.28 09:49:55 INFO web[o.s.s.p.ServerPluginJarsInstaller] Deploy plugin Email notifications / 5.1.2 / 2a52a7106b2bfbd659c591c2d6fc09ad0ab2db5c
2015.09.28 09:49:55 INFO web[o.s.s.p.ServerPluginJarsInstaller] Deploy plugin Java / 3.0 / 65396a609ddface8b311a6a665aca92a7da694f1
2015.09.28 09:49:55 INFO web[o.s.s.p.ServerPluginJarsInstaller] Deploy plugin Git / 1.0 / 9ce9d330c313c296fab051317cc5ad4b26319e07
2015.09.28 09:49:55 INFO web[o.s.s.p.ServerPluginJarsInstaller] Deploy plugin English Pack / 5.1.2 / 2a52a7106b2bfbd659c591c2d6fc09ad0ab2db5c
2015.09.28 09:49:55 INFO web[o.s.s.p.ServerPluginJarsInstaller] Deploy plugin SVN / 1.0 / 213fc8a8b582ff530b12dd4a59a6512be1071234
2015.09.28 09:49:55 INFO web[o.s.s.p.RailsAppsDeployer] Deploy Ruby on Rails applications
2015.09.28 09:49:55 INFO web[jruby.rack] jruby 1.7.9 (ruby-1.8.7p370) 2013-12-06 87b108a on Java HotSpot(TM) 64-Bit Server VM 1.8.0_60-b27 [Windows 7-amd64]
2015.09.28 09:49:55 INFO web[jruby.rack] using a shared (threadsafe!) runtime
2015.09.28 09:50:14 INFO web[jruby.rack] An exception happened during JRuby-Rack startup
ActiveRecord::JDBCError: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOT NULL) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin' at line 1: CREATE TABLE `schema_migrations` (`version` varchar NOT NULL) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin
--- System
jruby 1.7.9 (ruby-1.8.7p370) 2013-12-06 87b108a on Java HotSpot(TM) 64-Bit Server VM 1.8.0_60-b27 [Windows 7-amd64]
Time: Mon Sep 28 09:50:14 +0300 2015
Server: Apache Tomcat/8.0.18
jruby.home: file:/C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-complete-1.7.9.jar!/META-INF/jruby.home
--- Context Init Parameters:
jruby.compat.version = 1.8
jruby.max.runtimes = 1
jruby.min.runtimes = 1
jruby.rack.logging = slf4j
process.index = 1
process.key = web
process.sharedDir = C:\Users\ss\Desktop\SonarQube\sonarqube-5.1.2\temp
process.terminationTimeout = 60000
public.root = /
rails.env = production
sonar.cluster.name = sonarqube
sonar.jdbc.driverPath = C:\Users\ss\Desktop\SonarQube\sonarqube-5.1.2\lib\jdbc\mysql\mysql-connector-java-5.1.34.jar
sonar.jdbc.maxActive = 50
sonar.jdbc.maxIdle = 5
sonar.jdbc.maxWait = 5000
sonar.jdbc.minEvictableIdleTimeMillis = 600000
sonar.jdbc.minIdle = 2
sonar.jdbc.password = sonar
sonar.jdbc.timeBetweenEvictionRunsMillis = 30000
sonar.jdbc.url = jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance
sonar.jdbc.username = sonar
sonar.node.name = sonar-1443422966104
sonar.path.data = C:\Users\ss\Desktop\SonarQube\sonarqube-5.1.2\data
sonar.path.home = C:\Users\ss\Desktop\SonarQube\sonarqube-5.1.2
sonar.path.logs = C:\Users\ss\Desktop\SonarQube\sonarqube-5.1.2\logs
sonar.path.temp = C:\Users\ss\Desktop\SonarQube\sonarqube-5.1.2\temp
sonar.path.web = C:\Users\ss\Desktop\SonarQube\sonarqube-5.1.2\web
sonar.search.javaAdditionalOpts =
sonar.search.javaOpts = -Xmx1G -Xms256m -Xss256k -Djava.net.preferIPv4Stack=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError
sonar.search.port = 9001
sonar.search.type = TRANSPORT
sonar.web.javaAdditionalOpts =
sonar.web.javaOpts = -Xmx768m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true
--- Backtrace
ActiveRecord::StatementInvalid: ActiveRecord::JDBCError: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOT NULL) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin' at line 1: CREATE TABLE `schema_migrations` (`version` varchar NOT NULL) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin
log at C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract_adapter.rb:227
execute at C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/jdbc/adapter.rb:183
create_table at C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/schema_statements.rb:109
create_table at C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/mysql/adapter.rb:252
initialize_schema_migrations_table at C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/schema_statements.rb:371
initialize at C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:441
up at C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:401
migrate at C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:383
upgrade_and_start at C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/config/../lib/database_version.rb:62
automatic_setup at C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/config/../lib/database_version.rb:73
(root) at C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/config/environment.rb:272
load at org/jruby/RubyKernel.java:1094
(root) at file:/C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails/environment2.rb:1
load_environment at file:/C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails/environment2.rb:25
load_environment at file:/C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails_booter.rb:79
--- RubyGems
Gem.dir: C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems
Gem.path:
C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems
Activated gems:
activesupport-2.3.15
activerecord-2.3.15
rack-1.1.6
actionpack-2.3.15
rails-2.3.15
color-tools-1.3.0
i18n-0.4.2
json-jruby-1.2.3-universal-java-1.6
activerecord-jdbc-adapter-1.1.3
fastercsv-1.4.0
--- Bundler
undefined method `bundle_path' for Bundler:Module
--- JRuby-Rack Config
compat_version = RUBY1_8
default_logger = org.jruby.rack.logging.StandardOutLogger#5a8f2e80
equals = <error: >
err = java.io.PrintStream#7e976a6c
filter_adds_html = true
filter_verifies_resource = false
ignore_environment = false
initial_memory_buffer_size =
initial_runtimes = 1
jms_connection_factory =
jms_jndi_properties =
logger = org.jruby.rack.logging.Slf4jLogger#55699f6e
logger_class_name = slf4j
logger_name = jruby.rack
maximum_memory_buffer_size =
maximum_runtimes = 1
num_initializer_threads =
out = java.io.PrintStream#4365d1bf
rackup =
rackup_path =
rewindable = true
runtime_arguments =
runtime_environment =
runtime_timeout_seconds =
serial_initialization = false
servlet_context = org.apache.catalina.core.ApplicationContextFacade#7a015703
throw_init_exception = false
2015.09.28 09:50:14 ERROR web[jruby.rack] initialization failed
org.jruby.rack.RackInitializationException: ActiveRecord::JDBCError: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOT NULL) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin' at line 1: CREATE TABLE `schema_migrations` (`version` varchar NOT NULL) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin
from C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract_adapter.rb:227:in `log'
from C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/jdbc/adapter.rb:183:in `execute'
from C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/schema_statements.rb:109:in `create_table'
from C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/mysql/adapter.rb:252:in `create_table'
from C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/schema_statements.rb:371:in `initialize_schema_migrations_table'
from C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:441:in `initialize'
from C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:401:in `up'
from C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:383:in `migrate'
from C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/config/../lib/database_version.rb:62:in `upgrade_and_start'
from C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/config/../lib/database_version.rb:73:in `automatic_setup'
from C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/config/environment.rb:272:in `(root)'
from org/jruby/RubyKernel.java:1094:in `load'
from file:/C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails/environment2.rb:1:in `(root)'
from file:/C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails/environment2.rb:25:in `load_environment'
from file:/C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails_booter.rb:79:in `load_environment'
at org.jruby.rack.RackInitializationException.wrap(RackInitializationException.java:29) ~[jruby-rack-1.1.13.2.jar:na]
at org.jruby.rack.RackApplicationFactoryDecorator.init(RackApplicationFactoryDecorator.java:98) ~[jruby-rack-1.1.13.2.jar:na]
at org.jruby.rack.RackServletContextListener.contextInitialized(RackServletContextListener.java:50) ~[jruby-rack-1.1.13.2.jar:na]
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4720) [tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154) [tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409) [tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399) [tomcat-embed-core-8.0.18.jar:8.0.18]
at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.8.0_60]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_60]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_60]
at java.lang.Thread.run(Unknown Source) [na:1.8.0_60]
Caused by: org.jruby.exceptions.RaiseException: (StatementInvalid) ActiveRecord::JDBCError: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOT NULL) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin' at line 1: CREATE TABLE `schema_migrations` (`version` varchar NOT NULL) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin
at RUBY.log(C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract_adapter.rb:227) ~[na:na]
at RUBY.execute(C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/jdbc/adapter.rb:183) ~[na:na]
at RUBY.create_table(C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/schema_statements.rb:109) ~[na:na]
at RUBY.create_table(C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/mysql/adapter.rb:252) ~[na:na]
at RUBY.initialize_schema_migrations_table(C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/schema_statements.rb:371) ~[na:na]
at RUBY.initialize(C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:441) ~[na:na]
at RUBY.up(C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:401) ~[na:na]
at RUBY.migrate(C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:383) ~[na:na]
at RUBY.upgrade_and_start(C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/config/../lib/database_version.rb:62) ~[na:na]
at RUBY.automatic_setup(C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/config/../lib/database_version.rb:73) ~[na:na]
at RUBY.(root)(C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/config/environment.rb:272) ~[na:na]
at org.jruby.RubyKernel.load(org/jruby/RubyKernel.java:1094) ~[jruby-complete-1.7.9.jar:na]
at RUBY.(root)(file:/C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails/environment2.rb:1) ~[na:na]
at RUBY.load_environment(file:/C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails/environment2.rb:25) ~[na:na]
at RUBY.load_environment(file:/C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails_booter.rb:79) ~[na:na]
2015.09.28 09:50:15 INFO web[o.a.c.h.Http11NioProtocol] Starting ProtocolHandler ["http-nio-0.0.0.0-9000"]
2015.09.28 09:50:15 INFO web[o.s.s.a.TomcatAccessLog] Web server is started
2015.09.28 09:50:15 INFO web[o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2015.09.28 09:50:15 INFO app[o.s.p.m.Monitor] Process[web] is up
What am i missing?[From the MySql Error seems that length of the varchar is missing]
The problem was on schema_migrationquery where VARCHAR had no length. I created that table manually with the following query:
CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin
and it solved that problem.
Note:
[After the problem is gone, it creates other required tables automatically when the server is launched, however this time you will face upgrading/migrating message. This means that when you will try to access the server(ex: localhost), it will redirect you to the maintenance page(localhost/maintenance). Change that to move to setup page(localhost/setup) and continue with upgrade]