Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error log #5137

Closed
luo985 opened this issue Oct 18, 2019 · 3 comments · Fixed by Kong/lua-resty-healthcheck#37
Closed

error log #5137

luo985 opened this issue Oct 18, 2019 · 3 comments · Fixed by Kong/lua-resty-healthcheck#37
Labels

Comments

@luo985
Copy link
Contributor

luo985 commented Oct 18, 2019

2019/10/16 14:59:50 [error] 130838#0: *40080263274 failed to run log_by_lua*: /usr/local/openresty/lualib/resty/lock.lua:153: API disabled in the context of log_by_lua*
stack traceback:
	[C]: in function 'sleep'
	/usr/local/openresty/lualib/resty/lock.lua:153: in function 'lock'
	/usr/local/share/lua/5.1/resty/healthcheck.lua:436: in function 'report_http_status'
	/usr/local/share/lua/5.1/kong/runloop/balancer.lua:298: in function 'report_http_status'
	/usr/local/share/lua/5.1/kong/runloop/handler.lua:1494: in function 'after'
	/usr/local/share/lua/5.1/kong/init.lua:776: in function 'log'
	log_by_lua(nginx.conf:144):2: in main chunk while logging request, client: 218.4.201.174, server: kong, request: "POST /v1/json_logs HTTP/1.1", upstream: "http://10.33.8.183:7011/v1/json_logs", host: "rlogger.sdp.101.com", referrer: **"https://ndim.101.com/?lng=zh-CN"**

i found some error log, is this a issue?

  • Kong version (1.3.0)
@bungle
Copy link
Member

bungle commented Oct 22, 2019

This seems to be related to #5135.

@locao
Copy link
Contributor

locao commented Nov 12, 2019

@luo985, can you share more details about this configuration so we can reproduce the issue?

@locao locao added the pending author feedback Waiting for the issue author to get back to a maintainer with findings, more details, etc... label Nov 12, 2019
@luo985
Copy link
Contributor Author

luo985 commented Nov 15, 2019

@locao, i'm not sure what caused the problem.

my config:

#------------------------------------------------------------------------------
# GENERAL
#------------------------------------------------------------------------------

prefix = /usr/local/kong/
log_level = notice
proxy_access_log = /data/logs/kong/access.log
proxy_error_log = /data/logs/kong/error.log
admin_access_log = /data/logs/kong/admin_access.log
admin_error_log = /data/logs/kong/admin_error.log 
plugins = bundled,nd-unity-domain,nd-header-route,nd-server-hmac,nd-host,nd-redirect,nd-proxy,apig-request-transformer
anonymous_reports = off
router_consistency = eventual

#------------------------------------------------------------------------------
# NGINX
#------------------------------------------------------------------------------

admin_listen = 127.0.0.1:8001, 127.0.0.1:8444 ssl
#admin_listen = 0.0.0.0:8001, 0.0.0.0:8444 ssl
nginx_user = nobody nobody
nginx_worker_processes = auto
nginx_daemon = on
mem_cache_size = 128m
ssl_cipher_suite = modern
#ssl_ciphers = 
#ssl_cert =                      
#ssl_cert_key =                 
#client_ssl = off
#client_ssl_cert = 
#client_ssl_cert_key =
#admin_ssl_cert =    
#admin_ssl_cert_key = 
nginx_http_upstream_keepalive = 60 
#headers = server_tokens, latency_tokens
#trusted_ips =
real_ip_header = X-Real-IP
#real_ip_recursive = off
client_max_body_size = 128m
client_body_buffer_size = 256k
error_default_type = text/plain 

#------------------------------------------------------------------------------
# DNS RESOLVER
#------------------------------------------------------------------------------

#dns_resolver =
#dns_hostsfile = /etc/hosts
#dns_order = LAST,SRV,A,CNAME
#dns_valid_ttl =  
#dns_stale_ttl = 4 
#dns_not_found_ttl = 30 
#dns_error_ttl = 1 
#dns_no_sync = off

#------------------------------------------------------------------------------
# DEVELOPMENT & MISCELLANEOUS
#------------------------------------------------------------------------------

#lua_ssl_trusted_certificate =   
#lua_ssl_verify_depth = 1

#lua_package_path = ./?.lua;./?/init.lua;
#lua_package_cpath = 
lua_socket_pool_size = 30

#------------------------------------------------------------------------------
# HTTP CUSTOM CONF
#------------------------------------------------------------------------------
nginx_http_gzip = on
nginx_http_gzip_proxied = any
nginx_http_gzip_vary = on
nginx_http_gzip_min_length = 1024
nginx_http_gzip_types = text/plain application/x-javascript text/css text/javascript text/xml application/javascript  application/atom+xml   application/rss+xml application/json application/xhtml+xml application/vnd.apple.mpegurl  image/svg+xml
nginx_http_sendfile = on
nginx_http_server_names_hash_bucket_size = 1024
nginx_http_client_header_timeout = 3m
nginx_http_client_body_timeout = 3m
nginx_http_send_timeout = 3m
nginx_http_client_header_buffer_size = 12k
nginx_http_large_client_header_buffers = 4 12k

nginx_http_proxy_buffer_size = 512k
nginx_http_proxy_buffers = 8 512k
nginx_http_proxy_busy_buffers_size = 512k
nginx_http_proxy_temp_file_write_size = 512k
nginx_http_proxy_ignore_client_abort = on
nginx_http_proxy_temp_path = /dev/shm/proxy_temp_dir
nginx_http_proxy_buffer_size = 512k

nginx_http_server_tokens = off


#------------------------------------------------------------------------------
# proxy
#------------------------------------------------------------------------------
proxy_listen = 0.0.0.0:80, 0.0.0.0:443 ssl
stream_listen = off

#------------------------------------------------------------------------------
# DATASTORE
#------------------------------------------------------------------------------
database = postgres
pg_host = *******
pg_port = *******
pg_user = *******
pg_password = *******
pg_database = *******
pg_timeout = 10000
#pg_ssl = off
#pg_ssl_verify = off

#------------------------------------------------------------------------------
# DATASTORE CACHE
#------------------------------------------------------------------------------
db_update_frequency = 5
db_update_propagation = 0
db_cache_ttl = 0
#db_resurrect_ttl = 30

upstream config:

{
	"healthchecks": {
		"active": {
			"unhealthy": {
				"http_statuses": [
					429,
					404,
					500,
					501,
					502,
					503,
					504,
					505
				],
				"tcp_failures": 0,
				"timeouts": 0,
				"http_failures": 0,
				"interval": 5
			},
			"type": "http",
			"http_path": "/%24waf/ping",
			"timeout": 10,
			"healthy": {
				"successes": 1,
				"interval": 0,
				"http_statuses": [
					200,
					201,
					202,
					203,
					204,
					205,
					206,
					207,
					208,
					226,
					300,
					301,
					302,
					303,
					304,
					305,
					306,
					307,
					308,
					400,
					401,
					403,
					404,
					500
				]
			},
			"https_sni": null,
			"https_verify_certificate": false,
			"concurrency": 10
		},
		"passive": {
			"unhealthy": {
				"http_failures": 0,
				"http_statuses": [
					429,
					500,
					503
				],
				"tcp_failures": 5,
				"timeouts": 0
			},
			"healthy": {
				"http_statuses": [
					200,
					201,
					202,
					203,
					204,
					205,
					206,
					207,
					208,
					226,
					300,
					301,
					302,
					303,
					304,
					305,
					306,
					307,
					308,
					400,
					401,
					403,
					404,
					500
				],
				"successes": 1
			},
			"type": "tcp"
		}
	},
	"slots": 100
}

do you need any other information?

@locao locao removed the pending author feedback Waiting for the issue author to get back to a maintainer with findings, more details, etc... label Nov 19, 2019
locao added a commit to Kong/lua-resty-healthcheck that referenced this issue Nov 22, 2019
When ngx.sleep API is not available (e.g. in the log phase) it's not possible to
lock using lua-resty-lock and functions that must run protected were failing.

This change adds a retry method that starts a new light thread that has access
to ngx.sleep and will succeed to lock.

Fix Kong/kong#5137
locao added a commit to Kong/lua-resty-healthcheck that referenced this issue Dec 13, 2019
When ngx.sleep API is not available (e.g. in the log phase) it's not possible to
lock using lua-resty-lock and functions that must run protected were failing.

This change adds retry methods that start new light threads that have access
to ngx.sleep and will succeed to lock.

Fix Kong/kong#5137
hishamhm pushed a commit to Kong/lua-resty-healthcheck that referenced this issue Dec 13, 2019
When ngx.sleep API is not available (e.g. in the log phase) it's not possible to
lock using lua-resty-lock and functions that must run protected were failing.

This change adds retry methods that start new light threads that have access
to ngx.sleep and will succeed to lock.

Fix Kong/kong#5137
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants