I am trying to connect to SQL Server 2008 on CentOS 5.8. I am using unixODBC 2.3.0 and SQL Server ODBC Driver (www.microsoft.com/en-us/download/details.aspx?id=28160).
When I try to test the connection by running:
isql -v mydsn username password
it givens me:
[S1T00][unixODBC][Microsoft][SQL Server Native Client 11.0]Login timeout expired
[08001][unixODBC][Microsoft][SQL Server Native Client 11.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.
[08001][unixODBC][Microsoft][SQL Server Native Client 11.0]TCP Provider: Error code 0x2726
[ISQL]ERROR: Could not SQLConnect
The port is open, the server is accessible.
I was trying to diagnose the problem further, but got stuck here:
strace -e trace=network isql -v mydsn username password
socket(PF_FILE, SOCK_STREAM, 0) = 3
connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"...}, 110) = -1 ENOENT (No such file or directory)
socket(PF_FILE, SOCK_STREAM, 0) = 3
connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"...}, 110) = -1 ENOENT (No such file or directory)
socket(PF_FILE, SOCK_STREAM, 0) = 3
connect(3, {sa_family=AF_FILE, path="/var/run/setrans/.setrans-unix"...}, 110) = 0
sendmsg(3, {msg_name(0)=NULL, msg_iov(5)=[{"\1\0\0\0", 4}, {"\1\0\0\0", 4}, {"\1\0\0\0", 4}, {"\0", 1}, {"\0", 1}], msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = 14
socket(PF_FILE, SOCK_STREAM, 0) = 4
connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"...}, 110) = -1 ENOENT (No such file or directory)
socket(PF_FILE, SOCK_STREAM, 0) = 4
connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"...}, 110) = -1 ENOENT (No such file or directory)
socket(PF_INET, 0x80001 /* SOCK_??? */, IPPROTO_TCP) = -1 EINVAL (Invalid argument)
socket(PF_INET, 0x80001 /* SOCK_??? */, IPPROTO_TCP) = -1 EINVAL (Invalid argument)
socket(PF_INET, 0x80001 /* SOCK_??? */, IPPROTO_TCP) = -1 EINVAL (Invalid argument)
socket(PF_INET, 0x80001 /* SOCK_??? */, IPPROTO_TCP) = -1 EINVAL (Invalid argument)
socket(PF_INET, 0x80001 /* SOCK_??? */, IPPROTO_TCP) = -1 EINVAL (Invalid argument)
socket(PF_INET, 0x80001 /* SOCK_??? */, IPPROTO_TCP) = -1 EINVAL (Invalid argument)
socket(PF_INET, 0x80001 /* SOCK_??? */, IPPROTO_TCP) = -1 EINVAL (Invalid argument)
socket(PF_INET, 0x80001 /* SOCK_??? */, IPPROTO_TCP) = -1 EINVAL (Invalid argument)
socket(PF_INET, 0x80001 /* SOCK_??? */, IPPROTO_TCP) = -1 EINVAL (Invalid argument)
socket(PF_INET, 0x80001 /* SOCK_??? */, IPPROTO_TCP) = -1 EINVAL (Invalid argument)
socket(PF_INET, 0x80001 /* SOCK_??? */, IPPROTO_TCP) = -1 EINVAL (Invalid argument)
socket(PF_INET, 0x80001 /* SOCK_??? */, IPPROTO_TCP) = -1 EINVAL (Invalid argument)
socket(PF_INET, 0x80001 /* SOCK_??? */, IPPROTO_TCP) = -1 EINVAL (Invalid argument)
socket(PF_INET, 0x80001 /* SOCK_??? */, IPPROTO_TCP) = -1 EINVAL (Invalid argument)
socket(PF_INET, 0x80001 /* SOCK_??? */, IPPROTO_TCP) = -1 EINVAL (Invalid argument)
socket(PF_INET, 0x80001 /* SOCK_??? */, IPPROTO_TCP) = -1 EINVAL (Invalid argument)
socket(PF_INET, 0x80001 /* SOCK_??? */, IPPROTO_TCP) = -1 EINVAL (Invalid argument)
socket(PF_INET, 0x80001 /* SOCK_??? */, IPPROTO_TCP) = -1 EINVAL (Invalid argument)
Apparently, there is something wrong going on with the establishment of connection.
Can anyone help me? Please let me know if you need any other info.
Thanks
One 'gotcha' when working with linux and odbc connecting to Microsoft's SQL Server while using Microsoft's linux driver, is the string in odbc.ini for the server must contain the port as well.
Server = [protocol:]server[,port]
as per http://msdn.microsoft.com/en-us/library/hh568455.aspx
This is a different convention than most other setups that use the port = <portnumber> convention. If that is not configured, you will see a 'Could not SQLConnect' error.
Also ensure that the correct odbc files are being used.
odbcinst -j
will show configured sources and their locations.
Another gotcha you might encounter later, is the driver for SQL Server ignores user and password information in odbc.ini if it is in plain text, so make sure your application handles that.
To debug the issue try the following steps:
telnet <1433>
Go to SQL server network configuration
TCP/IP settings
right click and open Properties
switch to the Network Properties tab
under IPAll properties set the dynamic ports to blank and port to 1433
Restart the SQL service
You can open the odbc trace and use tcpdump to catch the network package. I think the odbc trace will give a help.
The problem was that I was using EL6 driver with EL5. After installing the correct version, everything worked. Thanks any way for everyone's responses.
Related
I can connect to SQL servers using iSQL but when I tested mysql server it throws Segmentation fault error. Same issue with tsql. Mysql Server version is 5.7. Tested with 2 different MySQL server (5.7 though).
root#client001~: isql -v DB01
Segmentation fault (core dumped)
cat /etc/odbc.ini
[DB01]
Driver = FreeTDS
Server = 10.10.10.10
Port = 3306
TDS Version = 7.2
cat /etc/odbcinst.ini
[FreeTDS]
Description=v0.63 with protocol v8.0
Driver=/usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
Setup=/usr/lib/x86_64-linux-gnu/odbc/libtdsS.so
strace isql -v DB01 username password
lines_above_this are just reading odbc.ini
brk(0xa68000) = 0xa68000
read(4, "", 4096) = 0
close(4) = 0
brk(0xa65000) = 0xa65000
brk(0xa48000) = 0xa48000
brk(0xa47000) = 0xa47000
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 4
setsockopt(4, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0
setsockopt(4, SOL_TCP, TCP_NODELAY, [1], 4) = 0
ioctl(4, FIONBIO, [1]) = 0
connect(4, {sa_family=AF_INET, sin_port=htons(3306), sin_addr=inet_addr("10.10.10.10")}, 16) = -1 EINPROGRESS (Operation now in progress)
poll([{fd=4, events=POLLOUT}], 1, 90000000) = 1 ([{fd=4, revents=POLLOUT}])
getsockopt(4, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
poll([{fd=4, events=POLLOUT}], 1, -1) = 1 ([{fd=4, revents=POLLOUT}])
sendto(4, "\2\0\2\0\0\0\0\0CLIENT_SERVER001\0\0\0\0\0\0\0\0\0\0"..., 512, MSG_NOSIGNAL|MSG_MORE, NULL, 0) = 512
poll([{fd=4, events=POLLOUT}], 1, -1) = 1 ([{fd=4, revents=POLLOUT}])
sendto(4, "\2\1\0L\0\0\0\0\0\0\0\0\0\0\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0utf"..., 76, MSG_NOSIGNAL, NULL, 0) = 76
poll([{fd=4, events=POLLIN}], 1, -1) = 1 ([{fd=4, revents=POLLIN}])
recvfrom(4, "[\0\0\0\n5.7", 8, MSG_NOSIGNAL, NULL, NULL) = 8
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV (core dumped) +++
Segmentation fault (core dumped)
Figured it out.
Had to download ODBC lib 5.2.7 then copy it to libs dir and create a new entry in odbcinst.ini and odbc.ini (or add line Driver to odbc.ini) .
wget https://cdn.mysql.com/archives/mysql-connector-odbc-5.2/mysql-connector-odbc-5.2.7-linux-debian6.0-x86-64bit.tar.gz
Extract and copy mysql-connector-odbc-5.2.7-linux-debian6.0-x86-64bit/lib/libmyodbc5*.so to /usr/lib/x86_64-linux-gnu/odbc/
cat /etc/odbcinst.ini
[FreeTDS]
Description=v0.63 with protocol v8.0
Driver=/usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
Setup=/usr/lib/x86_64-linux-gnu/odbc/libtdsS.so
[MySQL_ODBC]
Driver=/usr/lib/x86_64-linux-gnu/odbc/libmyodbc5w.so
cat /etc/odbc.ini
[DB01]
Driver = MySQL_ODBC
Server = 10.10.10.10
Port = 3306
TDS Version = 7.2
Even after editing the appropriate ext-xdebug.ini (/usr/local/etc/php/7.1/conf.d/ext-xdebug.ini), PhpStorm still does not reflect what is seen withphpinfo().
PHP version: 7.1.16
PHP CLI: /usr/local/Cellar/php#7.1/7.1.16/bin/php PHP CGI: /usr/local/Cellar/php#7.1/7.1.16/bin/php-cgi
Loaded Configuration File: /usr/local/etc/php/7.1/php.ini
Additional .ini files parsed: /usr/local/etc/php/7.1/conf.d/ext-imagick.ini /usr/local/etc/php/7.1/conf.d/ext-opcache.ini /usr/local/etc/php/7.1/conf.d/ext-xdebug.ini
Debugger extension: Xdebug 2.6.0
Loaded extensions: bcmath, bz2, calendar, Core, ctype, curl, date, dba, dom, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, imagick, intl, json, ldap, libxml, mbstring, mcrypt, mysqli, mysqlnd, odbc, openssl, pcntl, pcre, PDO, pdo_dblib, pdo_mysql, PDO_ODBC, pdo_pgsql, pdo_sqlite, pgsql, Phar, phpdbg_webhelper, posix, pspell, readline, Reflection, session, shmop, SimpleXML, soap, sockets, SPL, sqlite3, standard, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xdebug, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend OPcache, zip, zlib
Configuration options:
allow_url_fopen
1
allow_url_include
arg_separator.input
&
arg_separator.output
&
assert.active
1
assert.bail
0
assert.callback
assert.exception
0
assert.quiet_eval
0
assert.warning
1
auto_append_file
auto_detect_line_endings
0
auto_globals_jit
1
auto_prepend_file
bcmath.scale
0
browscap
cli.pager
cli.prompt
\b \>
curl.cainfo
date.default_latitude
31.7667
date.default_longitude
35.2333
date.sunrise_zenith
90.583333
date.sunset_zenith
90.583333
date.timezone
dba.default_handler
flatfile
default_charset
UTF-8
default_mimetype
text/html
default_socket_timeout
60
disable_classes
disable_functions
display_errors
1
display_startup_errors
1
doc_root
docref_ext
docref_root
enable_dl
enable_post_data_reading
1
error_append_string
error_log
error_prepend_string
error_reporting
32767
exif.decode_jis_intel
JIS
exif.decode_jis_motorola
JIS
exif.decode_unicode_intel
UCS-2LE
exif.decode_unicode_motorola
UCS-2BE
exif.encode_jis
exif.encode_unicode
ISO-8859-15
expose_php
1
extension_dir
/usr/local/Cellar/php#7.1/7.1.16/lib/php/20160303
file_uploads
1
filter.default
unsafe_raw
filter.default_flags
from
gd.jpeg_ignore_warning
1
hard_timeout
2
highlight.comment
#FF8000
highlight.default
#0000BB
highlight.html
#000000
highlight.keyword
#007700
highlight.string
#DD0000
html_errors
0
iconv.input_encoding
iconv.internal_encoding
iconv.output_encoding
ignore_repeated_errors
ignore_repeated_source
ignore_user_abort
0
imagick.locale_fix
0
imagick.progress_monitor
0
imagick.skip_version_check
0
implicit_flush
1
include_path
.:/usr/local/Cellar/php#7.1/7.1.16/share/pear
input_encoding
internal_encoding
intl.default_locale
intl.error_level
0
intl.use_exceptions
0
ldap.max_links
-1
log_errors
1
log_errors_max_len
1024
mail.add_x_header
1
mail.force_extra_parameters
mail.log
max_execution_time
0
max_file_uploads
20
max_input_nesting_level
64
max_input_time
-1
max_input_vars
1000
mbstring.detect_order
mbstring.encoding_translation
0
mbstring.func_overload
0
mbstring.http_input
mbstring.http_output
mbstring.http_output_conv_mimetypes
^(text/|application/xhtml\+xml)
mbstring.internal_encoding
mbstring.language
neutral
mbstring.strict_detection
0
mbstring.substitute_character
mcrypt.algorithms_dir
mcrypt.modes_dir
memory_limit
512M
mysqli.allow_local_infile
1
mysqli.allow_persistent
1
mysqli.default_host
mysqli.default_port
3306
mysqli.default_pw
mysqli.default_socket
/tmp/mysql.sock
mysqli.default_user
mysqli.max_links
-1
mysqli.max_persistent
-1
mysqli.reconnect
mysqli.rollback_on_cached_plink
0
mysqlnd.collect_memory_statistics
1
mysqlnd.collect_statistics
1
mysqlnd.debug
mysqlnd.fetch_data_copy
0
mysqlnd.log_mask
0
mysqlnd.mempool_default_size
16000
mysqlnd.net_cmd_buffer_size
4096
mysqlnd.net_read_buffer_size
32768
mysqlnd.net_read_timeout
31536000
mysqlnd.sha256_server_public_key
mysqlnd.trace_alloc
odbc.allow_persistent
1
odbc.check_persistent
1
odbc.default_cursortype
3
odbc.default_db
odbc.default_pw
odbc.default_user
odbc.defaultbinmode
1
odbc.defaultlrl
4096
odbc.max_links
-1
odbc.max_persistent
-1
opcache.blacklist_filename
opcache.consistency_checks
0
opcache.dups_fix
0
opcache.enable
1
opcache.enable_cli
0
opcache.enable_file_override
0
opcache.error_log
opcache.fast_shutdown
0
opcache.file_cache
opcache.file_cache_consistency_checks
1
opcache.file_cache_only
0
opcache.file_update_protection
2
opcache.force_restart_timeout
180
opcache.huge_code_pages
0
opcache.inherited_hack
1
opcache.interned_strings_buffer
8
opcache.lockfile_path
/tmp
opcache.log_verbosity_level
1
opcache.max_accelerated_files
10000
opcache.max_file_size
0
opcache.max_wasted_percentage
5
opcache.memory_consumption
128
opcache.opt_debug_level
0
opcache.optimization_level
0x7FFFBFFF
opcache.preferred_memory_model
opcache.protect_memory
0
opcache.restrict_api
opcache.revalidate_freq
2
opcache.revalidate_path
0
opcache.save_comments
1
opcache.use_cwd
1
opcache.validate_permission
0
opcache.validate_root
0
opcache.validate_timestamps
1
open_basedir
openssl.cafile
openssl.capath
output_buffering
0
output_encoding
output_handler
pcre.backtrack_limit
1000000
pcre.jit
1
pcre.recursion_limit
100000
pdo_mysql.default_socket
/tmp/mysql.sock
pgsql.allow_persistent
1
pgsql.auto_reset_persistent
pgsql.ignore_notice
0
pgsql.log_notice
0
pgsql.max_links
-1
pgsql.max_persistent
-1
phar.cache_list
phar.readonly
1
phar.require_hash
1
phpdbg.auth
phpdbg.path
post_max_size
8M
precision
14
realpath_cache_size
4096K
realpath_cache_ttl
120
register_argc_argv
1
report_memleaks
1
report_zend_debug
0
request_order
GP
sendmail_from
sendmail_path
/usr/sbin/sendmail -t -i
serialize_precision
-1
session.auto_start
0
session.cache_expire
180
session.cache_limiter
nocache
session.cookie_domain
session.cookie_httponly
session.cookie_lifetime
0
session.cookie_path
/
session.cookie_secure
session.gc_divisor
1000
session.gc_maxlifetime
1440
session.gc_probability
1
session.lazy_write
1
session.name
PHPSESSID
session.referer_check
session.save_handler
files
session.save_path
session.serialize_handler
php
session.sid_bits_per_character
5
session.sid_length
26
session.trans_sid_hosts
session.trans_sid_tags
a=href,area=href,frame=src,form=
session.upload_progress.cleanup
1
session.upload_progress.enabled
1
session.upload_progress.freq
1%
session.upload_progress.min_freq
1
session.upload_progress.name
PHP_SESSION_UPLOAD_PROGRESS
session.upload_progress.prefix
upload_progress_
session.use_cookies
1
session.use_only_cookies
1
session.use_strict_mode
0
session.use_trans_sid
0
short_open_tag
SMTP
localhost
smtp_port
25
soap.wsdl_cache
1
soap.wsdl_cache_dir
/tmp
soap.wsdl_cache_enabled
1
soap.wsdl_cache_limit
5
soap.wsdl_cache_ttl
86400
sql.safe_mode
sqlite3.extension_dir
sys_temp_dir
track_errors
1
unserialize_callback_func
upload_max_filesize
2M
upload_tmp_dir
url_rewriter.hosts
url_rewriter.tags
form=
user_agent
user_dir
user_ini.cache_ttl
300
user_ini.filename
.user.ini
variables_order
GPCS
xdebug.auto_trace
0
xdebug.cli_color
0
xdebug.collect_assignments
0
xdebug.collect_includes
1
xdebug.collect_params
0
xdebug.collect_return
0
xdebug.collect_vars
0
xdebug.coverage_enable
1
xdebug.default_enable
1
xdebug.dump.COOKIE
xdebug.dump.ENV
xdebug.dump.FILES
xdebug.dump.GET
xdebug.dump.POST
xdebug.dump.REQUEST
xdebug.dump.SERVER
xdebug.dump.SESSION
xdebug.dump_globals
1
xdebug.dump_once
1
xdebug.dump_undefined
0
xdebug.extended_info
1
xdebug.file_link_format
xdebug.filename_format
xdebug.force_display_errors
0
xdebug.force_error_reporting
0
xdebug.gc_stats_enable
0
xdebug.gc_stats_output_dir
/var/tmp/
xdebug.gc_stats_output_name
gcstats.%p
xdebug.halt_level
0
xdebug.idekey
xdebug.max_nesting_level
256
xdebug.max_stack_frames
-1
xdebug.overload_var_dump
2
xdebug.profiler_aggregate
0
xdebug.profiler_append
0
xdebug.profiler_enable
0
xdebug.profiler_enable_trigger
0
xdebug.profiler_enable_trigger_value
xdebug.profiler_output_dir
/var/tmp/
xdebug.profiler_output_name
cachegrind.out.%p
xdebug.remote_addr_header
xdebug.remote_autostart
0
xdebug.remote_connect_back
0
xdebug.remote_cookie_expire_time
3600
xdebug.remote_enable
0
xdebug.remote_handler
dbgp
xdebug.remote_host
localhost
xdebug.remote_log
xdebug.remote_mode
req
xdebug.remote_port
9000
xdebug.remote_timeout
200
xdebug.scream
0
xdebug.show_error_trace
0
xdebug.show_exception_trace
0
xdebug.show_local_vars
0
xdebug.show_mem_delta
0
xdebug.trace_enable_trigger
0
xdebug.trace_enable_trigger_value
xdebug.trace_format
0
xdebug.trace_options
0
xdebug.trace_output_dir
/var/tmp/
xdebug.trace_output_name
trace.%c
xdebug.var_display_max_children
128
xdebug.var_display_max_data
512
xdebug.var_display_max_depth
3
xmlrpc_error_number
0
xmlrpc_errors
0
zend.assertions
1
zend.detect_unicode
1
zend.enable_gc
1
zend.multibyte
0
zend.script_encoding
zend.signal_check
0
zlib.output_compression
zlib.output_compression_level
-1
zlib.output_handler
Full xdebug phpinfo()
Second half of xdebug phpinfo
Log closed at 2018-04-05 15:47:08
Log opened at 2018-04-05 15:49:27
I: Connecting to configured address/port: localhost:9000.
W: Creating socket for 'localhost:9000', poll success, but error: Operation now in progress (19).
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///Users/namehere/PhpstormProjects/arc/web/index.php" language="PHP" xdebug:language_version="7.1.13" protocol_version="1.0" appid="17035" idekey="17743"><engine version="2.6.0"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2018 by Derick Rethans]]></copyright></init>
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" status="stopping" reason="ok"></response>
Log closed at 2018-04-05 15:49:29
Log opened at 2018-04-05 15:49:31
I: Connecting to configured address/port: localhost:9000.
W: Creating socket for 'localhost:9000', poll success, but error: Operation now in progress (19).
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///Users/namehere/PhpstormProjects/arc/web/index.php" language="PHP" xdebug:language_version="7.1.13" protocol_version="1.0" appid="17035" idekey="17743"><engine version="2.6.0"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2018 by Derick Rethans]]></copyright></init>
Log opened at 2018-04-05 15:49:31
I: Connecting to configured address/port: localhost:9000.
W: Creating socket for 'localhost:9000', poll success, but error: Operation now in progress (19).
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///Users/namehere/PhpstormProjects/arc/web/index.php" language="PHP" xdebug:language_version="7.1.13" protocol_version="1.0" appid="17036" idekey="17743"><engine version="2.6.0"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2018 by Derick Rethans]]></copyright></init>
Log opened at 2018-04-05 15:49:32
I: Connecting to configured address/port: localhost:9000.
W: Creating socket for 'localhost:9000', poll success, but error: Operation now in progress (19).
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///Users/namehere/PhpstormProjects/arc/web/index.php" language="PHP" xdebug:language_version="7.1.13" protocol_version="1.0" appid="17040" idekey="17743"><engine version="2.6.0"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2018 by Derick Rethans]]></copyright></init>
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" status="stopping" reason="ok"></response>
Log closed at 2018-04-05 15:49:33
Log opened at 2018-04-05 15:49:33
I: Connecting to configured address/port: localhost:9000.
W: Creating socket for 'localhost:9000', poll success, but error: Operation now in progress (19).
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///Users/namehere/PhpstormProjects/arc/web/index.php" language="PHP" xdebug:language_version="7.1.13" protocol_version="1.0" appid="17035" idekey="17743"><engine version="2.6.0"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2018 by Derick Rethans]]></copyright></init>
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" status="stopping" reason="ok"></response>
Log closed at 2018-04-05 15:49:33
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" status="stopping" reason="ok"></response>
Log closed at 2018-04-05 15:49:33
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" status="stopping" reason="ok"></response>
Log closed at 2018-04-05 15:49:34
Log opened at 2018-04-05 15:49:34
Log opened at 2018-04-05 15:49:34
I: Connecting to configured address/port: localhost:9000.
W: Creating socket for 'localhost:9000', poll success, but error: Operation now in progress (19).
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///Users/namehere/PhpstormProjects/arc/web/index.php" language="PHP" xdebug:language_version="7.1.13" protocol_version="1.0" appid="17036" idekey="17743"><engine version="2.6.0"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2018 by Derick Rethans]]></copyright></init>
I: Connecting to configured address/port: localhost:9000.
W: Creating socket for 'localhost:9000', poll success, but error: Operation now in progress (19).
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///Users/namehere/PhpstormProjects/arc/web/index.php" language="PHP" xdebug:language_version="7.1.13" protocol_version="1.0" appid="17035" idekey="17743"><engine version="2.6.0"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2018 by Derick Rethans]]></copyright></init>
Log opened at 2018-04-05 15:49:34
I: Connecting to configured address/port: localhost:9000.
W: Creating socket for 'localhost:9000', poll success, but error: Operation now in progress (19).
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///Users/namehere/PhpstormProjects/arc/web/index.php" language="PHP" xdebug:language_version="7.1.13" protocol_version="1.0" appid="17040" idekey="17743"><engine version="2.6.0"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2018 by Derick Rethans]]></copyright></init>
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" status="stopping" reason="ok"></response>
Log closed at 2018-04-05 15:49:34
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" status="stopping" reason="ok"></response>
Log closed at 2018-04-05 15:49:34
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" status="stopping" reason="ok"></response>
Log closed at 2018-04-05 15:49:34
Log opened at 2018-04-05 15:49:48
I: Connecting to configured address/port: 127.0.0.1:9000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///Users/namehere/PhpstormProjects/arc/bin/console" language="PHP" xdebug:language_version="7.1.13" protocol_version="1.0" appid="17042" idekey="16246"><engine version="2.6.0"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2018 by Derick Rethans]]></copyright></init>
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" status="stopping" reason="ok"></response>
Log closed at 2018-04-05 15:49:49
Log opened at 2018-04-05 15:54:32
I: Connecting to configured address/port: localhost:9000.
W: Creating socket for 'localhost:9000', poll success, but error: Operation now in progress (19).
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///Users/namehere/PhpstormProjects/arc/web/index.php" language="PHP" xdebug:language_version="7.1.13" protocol_version="1.0" appid="17035" idekey="17743"><engine version="2.6.0"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2018 by Derick Rethans]]></copyright></init>
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" status="stopping" reason="ok"></response>
Log closed at 2018-04-05 15:54:32
I had the same issue and spent about 2 hours without success.
I am putting the solution mentioned by #LazyOne from the comments here to the top(thanks!)
Stop the PHP-FPM or change port to different than 9000!
P.S. My PHPStorm shows xdebug.remote_enable=0 also but debugging started to work!
I am trying to connect to mysql with JDBC.
I generated keys as follows on my Windows 10:
winpty openssl pkcs12 -export -inkey ssl_cert/client-key.pem -in ssl_cert/client-cert.pem -out client.packet
keytool -importkeystore -deststorepass <password> -destkeypass <password> -destkeystore mysqldb.jks -srckeystore client.packet -srcstoretype PKCS12 -srcstorepass <password> -alias 1
keytool -importcert -alias mysqlCA -trustcacerts -file ssl_cert/ca.pem -keystore mysqldb.jks
My JDBC code looks like this :
System.setProperty("javax.net.ssl.trustStore", "ks-production-mysqldb.jks");
System.setProperty("javax.net.ssl.trustStorePassword", "<password> ");
System.setProperty("javax.net.ssl.trustStoreType", "JKS");
System.setProperty("javax.net.ssl.keyStore", "mysqldb.jks");
System.setProperty("javax.net.ssl.keyStorePassword", "<password> ");
System.setProperty("javax.net.ssl.keyStoreType", "JKS");
String dbURL = "jdbc:mysql://localhost:1234/sb?"
+ "verifyServerCertificate=true&useSSL=true&requireSSL=true";
conn = DriverManager.getConnection(dbURL, dbUser, dbPass);
I am getting following error :
Caused by: javax.net.ssl.SSLException: Unsupported record version
Unknown-0.0 at
sun.security.ssl.InputRecord.checkRecordVersion(InputRecord.java:552)
at sun.security.ssl.InputRecord.readV3Record(InputRecord.java:565)
at sun.security.ssl.InputRecord.read(InputRecord.java:529) at
sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983) at
sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385)
at
sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
at
sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)
at
org.mariadb.jdbc.internal.mysql.MySQLProtocol.connect(MySQLProtocol.java:444)
... 7 more
I googled for this and found out that it may be due to difference in SSL protocol between server and java, which they say must have been solved java 7 or greater.
But still I am getting error ? What am I missing?
Port forwarding before connection to localhost:1234:
try {
JSch jsch = new JSch();
jsch.addIdentity(privateKey);
logger.info("Establishing connection to " + sshHost + " by user " + sshUser);
session = jsch.getSession(sshUser, sshHost, 22);
java.util.Properties config = new java.util.Properties();
config.put("StrictHostKeyChecking", "no");
session.setConfig(config);
session.connect();
int assignedPort = session.setPortForwardingL(localPort, remoteHost, remotePort);
logger.info("assigned Port = " + assignedPort);
} catch (JSchException e) {
e.printStackTrace();
throw new RuntimeException(e);
}
return session;
openssl command output :
$ openssl s_client -connect localhost:1234
CONNECTED(00000003)
140108247099296:error:140790E5:SSL routines:ssl23_write:ssl handshake failure:s23_lib.c:177:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 289 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
Protocol : TLSv1.2
Cipher : 0000
Session-ID:
Session-ID-ctx:
Master-Key:
Key-Arg : None
Krb5 Principal: None
PSK identity: None
PSK identity hint: None
Start Time: 1519473350
Timeout : 300 (sec)
Verify return code: 0 (ok)
---
There is no solution posted, so for anyone who is facing this issue:
We use MariaDB and have been facing this issue, after trying all things, upgrading mariaDB java client driver version to latest solved the problem. Hope it helps.
Upgrade to JDK 8 at least u181. It works for me for a ReST connection showing the same error.
As other answers adviced I upgraded Java from 1.8.0_121 to 1.8.0_362 and the error changed but I still had an SSL error.
I had to add ?useSSL=false&requireSSL=false to the jdbc URL to disable SSL.
I'm currently attempting to run a MIPS binary using qemu. My host system in Arch linux. As of right now, I've cd'd into the root directory of the firmware where the binary I'm trying to run exists. I've also copied the qemu-mips binary from my host system into the firmware's root directory.
While in the firmware's root directory I was running this command:
sudo chroot . ./qemu-mips bin/busybox
Yet I'm receiving this error:
chroot: failed to run command ‘./qemu-mips’: No such file or directory
This is strange, considering I just copied the qemu-mips binary to the firmware's root directory where I'm currently sitting. Most of the guides I read describing how to do this say to use qemu-mips-static, however even after installing all available qemu tools, that binary does not exist on my system. Is there something glaring that I'm missing? Thank you.
execve("/usr/sbin/chroot", ["chroot", ".", "./qemu-mips", "bin/busybox"], 0x7fffc0804f98 /* 16 vars */) = 0
brk(NULL) = 0x5653dd4e7000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=124268, ...}) = 0
mmap(NULL, 124268, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f209819a000
close(3) = 0
openat(AT_FDCWD, "/usr/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\20\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=2069912, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f2098198000
mmap(NULL, 3897584, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f2097bdd000
mprotect(0x7f2097d8b000, 2097152, PROT_NONE) = 0
mmap(0x7f2097f8b000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1ae000) = 0x7f2097f8b000
mmap(0x7f2097f91000, 14576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f2097f91000
close(3) = 0
arch_prctl(ARCH_SET_FS, 0x7f2098199500) = 0
mprotect(0x7f2097f8b000, 16384, PROT_READ) = 0
mprotect(0x5653dcd5b000, 4096, PROT_READ) = 0
mprotect(0x7f20981b9000, 4096, PROT_READ) = 0
munmap(0x7f209819a000, 124268) = 0
brk(NULL) = 0x5653dd4e7000
brk(0x5653dd508000) = 0x5653dd508000
open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=1682192, ...}) = 0
mmap(NULL, 1682192, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f2097ffd000
close(3) = 0
getcwd("/home/user/firmware/kkeps-root", 4096) = 46
chroot(".") = 0
chdir("/") = 0
execve("./qemu-mips", ["./qemu-mips", "bin/busybox"], 0x7ffec746eba0 /* 16 vars */) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/charset.alias", O_RDONLY|O_NOFOLLOW) = -1 ENOENT (No such file or directory)
write(2, "chroot: ", 8chroot: ) = 8
write(2, "failed to run command \342\200\230./qemu-"..., 39failed to run command ‘./qemu-mips’) = 39
open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, ": No such file or directory", 27: No such file or directory) = 27
write(2, "\n", 1
) = 1
close(1) = 0
close(2) = 0
exit_group(127) = ?
+++ exited with 127 +++
So it appears there are a few things that aren't being found, one of them being /etc/ld.so.preload. I'm not 100% sure what to do about this situation. I'm guessing this has to do with the fact that I am not using the static binary.
EDIT: Fixed by installing qemu-user-static from the AUR.
As you've figured out, this is because you weren't using the statically linked binary. It's not actually strictly necessary to use the static QEMU binary inside a chroot, it's just that for the static binary you need only copy that one file into the chroot, whereas if you use the dynamically linked QEMU you also need to copy in the host dynamic linker and all the host libraries that QEMU links against -- and that can run into problems if the host and the guest want to use the same pathname for dynamic libraries.
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.