Kong / kong

🦍 The Cloud-Native API Gateway and AI Gateway.
https://konghq.com/install/#kong-community
Apache License 2.0
39.04k stars 4.79k forks source link

api_helpers.lua:310 receive_message: failed to get type: timeout #6137

Closed lsaint closed 1 year ago

lsaint commented 4 years ago

kong version 2.0

All get request are going well, but write access such as DELETE/POST get the errors like this:

020/07/21 03:11:03 [error] 48#0: *19045 [kong] api_helpers.lua:310 receive_message: failed to get type: timeout, client: 10.40.0.110, server: kong_admin, request: "POST /consumers/ HTTP/1.1", host: "kong-kong-admin.kong.svc.cluster.local:8444"
10.40.0.110 - - [21/Jul/2020:03:11:03 +0000] "POST /consumers/ HTTP/1.1" 500 42 "-" "curl/7.67.0"

I looked it up and no one seems to have had the same problem.

Any suggests? appreciate.

hbagdi commented 4 years ago

It seems like you are using Kong inside Kubernetes. It is most likely that you are using Kong's Ingress Controller which by default uses Kong in DB-less mode. In DB-less mode, one cannot perform any insert, update or delete operation to Kong on a per-entity basis. You have to post the the entire declarative configuration file for this.

What is your motivation for making the Admin API call?

zffocussss commented 4 years ago

@hbagdi I am co-worker of @lsaint .We are using helm 2 to deploy kong ingress controller in AKS.

lsaint commented 4 years ago

It seems like you are using Kong inside Kubernetes. It is most likely that you are using Kong's Ingress Controller which by default uses Kong in DB-less mode. In DB-less mode, one cannot perform any insert, update or delete operation to Kong on a per-entity basis. You have to post the the entire declarative configuration file for this.

What is your motivation for making the Admin API call?

Right, we are using Kong inside Kubernetes. It's weird. It act like DB-less mode what you said, but we did use a postgres db. We making the Admin API call because it's part of our CI/CD, something like CREATE/DLETE Route/Service things need to be done in deploy procedure.

This is our db-related config:

...
       "pg_host": "pgsql-postgresql",
        "go_plugins_dir": "off",
        "db_update_frequency": 5,
        "dns_error_ttl": 1,
        "nginx_optimizations": true,
        "nginx_http_upstream_keepalive_timeout": "60s",
        "pg_timeout": 5000,
        "nginx_http_upstream_keepalive_requests": "100",
        "database": "postgres",                  <----------------------
        "nginx_upstream_keepalive": "60",
        "nginx_worker_processes": "1",
        "nginx_http_status_directives": {},
        "lua_package_path": "/opt/?.lua;;",
        "router_update_frequency": 1,
        "upstream_keepalive": 60,
        "pg_max_concurrent_queries": 0,
....

And refer to Kong Document:

Read-Only Admin API Since the only way to configure entities is via declarative configuration, the endpoints for CRUD operations on entities are effectively read-only in the Admin API when running Kong in DB-less mode. GET operations for inspecting entities work as usual, but attempts to POST, PATCH PUT or DELETE in endpoints such as /services or /plugins will return HTTP 405 Not Allowed.

If we are running in db-less mode, the response should be 405, but we got a 500 response.

$ curl -i -X POST http://localhost:8444/consumers/ -d "username=Ethan" HTTP/1.1 500 Internal Server Error Date: Wed, 22 Jul 2020 03:04:43 GMT Content-Type: application/json; charset=utf-8 Connection: keep-alive Access-Control-Allow-Origin: * Server: kong/2.0.4 Content-Length: 42 X-Kong-Admin-Latency: 5003

{"message":"An unexpected error occurred"}

log:

020/07/21 03:11:03 [error] 48#0: *19045 [kong] api_helpers.lua:310 receive_message: failed to get type: timeout, client: 10.40.0.110, server: kong_admin, request: "POST /consumers/ HTTP/1.1", host: "kong-kong-admin.kong.svc.cluster.local:8444"
10.40.0.110 - - [21/Jul/2020:03:11:03 +0000] "POST /consumers/ HTTP/1.1" 500 42 "-" "curl/7.67.0"
hbagdi commented 4 years ago

Could you please share the entire configuration of Kong as well as k8s deployment manifest?

lsaint commented 4 years ago

Could you please share the entire configuration of Kong as well as k8s deployment manifest?

Sure.

Kong config:


{
    "plugins": {
        "enabled_in_cluster": [
            "request-size-limiting",
            "kong-plugin-url-regex-rewriter",
            "response-transformer",
            "key-auth"
        ],
        "available_on_server": {
            "correlation-id": true,
            "pre-function": true,
            "cors": true,
            "ldap-auth": true,
            "loggly": true,
            "hmac-auth": true,
            "zipkin": true,
            "request-size-limiting": true,
            "azure-functions": true,
            "request-transformer": true,
            "oauth2": true,
            "response-transformer": true,
            "kong-plugin-url-regex-rewriter": true,
            "ip-restriction": true,
            "statsd": true,
            "jwt": true,
            "proxy-cache": true,
            "basic-auth": true,
            "key-auth": true,
            "http-log": true,
            "datadog": true,
            "tcp-log": true,
            "rate-limiting": true,
            "post-function": true,
            "prometheus": true,
            "acl": true,
            "syslog": true,
            "file-log": true,
            "acme": true,
            "udp-log": true,
            "response-ratelimiting": true,
            "aws-lambda": true,
            "session": true,
            "bot-detection": true,
            "request-termination": true
        }
    },
    "tagline": "Welcome to kong",
    "configuration": {
        "plugins": [
            "bundled",
            "kong-plugin-url-regex-rewriter"
        ],
        "admin_listen": [
            "0.0.0.0:8444"
        ],
        "lua_ssl_verify_depth": 1,
        "prefix": "/kong_prefix",
        "nginx_conf": "/kong_prefix/nginx.conf",
        "cassandra_username": "kong",
        "nginx_events_directives": [
            {
                "value": "auto",
                "name": "worker_connections"
            },
            {
                "value": "on",
                "name": "multi_accept"
            }
        ],
        "dns_resolver": {},
        "nginx_upstream_keepalive_requests": "100",
        "nginx_http_upstream_directives": [
            {
                "value": "100",
                "name": "keepalive_requests"
            },
            {
                "value": "60s",
                "name": "keepalive_timeout"
            },
            {
                "value": "60",
                "name": "keepalive"
            }
        ],
        "nginx_main_daemon": "off",
        "stream_proxy_ssl_enabled": false,
        "nginx_acc_logs": "/kong_prefix/logs/access.log",
        "pg_semaphore_timeout": 60000,
        "proxy_listen": [
            "0.0.0.0:8000",
            "0.0.0.0:8443 ssl"
        ],
        "client_ssl_cert_default": "/kong_prefix/ssl/kong-default.crt",
        "go_pluginserver_exe": "/usr/local/bin/go-pluginserver",
        "dns_no_sync": false,
        "db_update_propagation": 0,
        "stream_listen": [
            "off"
        ],
        "nginx_err_logs": "/kong_prefix/logs/error.log",
        "cassandra_port": 9042,
        "headers": [
            "server_tokens",
            "latency_tokens"
        ],
        "nginx_http_client_max_body_size": "0",
        "status_listen": [
            "off"
        ],
        "nginx_status_directives": {},
        "cluster_control_plane": "127.0.0.1:8005",
        "nginx_http_ssl_prefer_server_ciphers": "off",
        "pg_database": "kong",
        "lua_package_cpath": "",
        "admin_acc_logs": "/kong_prefix/logs/admin_access.log",
        "cassandra_refresh_frequency": 60,
        "nginx_pid": "/kong_prefix/pids/nginx.pid",
        "nginx_main_worker_rlimit_nofile": "auto",
        "cassandra_contact_points": [
            "127.0.0.1"
        ],
        "proxy_listeners": [
            {
                "listener": "0.0.0.0:8000",
                "proxy_protocol": false,
                "reuseport": false,
                "backlog=%d+": false,
                "deferred": false,
                "ssl": false,
                "ip": "0.0.0.0",
                "port": 8000,
                "http2": false,
                "bind": false
            },
            {
                "listener": "0.0.0.0:8443 ssl",
                "proxy_protocol": false,
                "reuseport": false,
                "backlog=%d+": false,
                "deferred": false,
                "ssl": true,
                "ip": "0.0.0.0",
                "port": 8443,
                "http2": false,
                "bind": false
            }
        ],
        "db_cache_warmup_entities": [
            "services",
            "plugins"
        ],
        "enabled_headers": {
            "latency_tokens": true,
            "X-Kong-Response-Latency": true,
            "Server": true,
            "X-Kong-Admin-Latency": true,
            "X-Kong-Upstream-Status": false,
            "Via": true,
            "X-Kong-Proxy-Latency": true,
            "server_tokens": true,
            "X-Kong-Upstream-Latency": true
        },
        "nginx_http_ssl_protocols": "TLSv1.2 TLSv1.3",
        "db_cache_ttl": 0,
        "nginx_events_multi_accept": "on",
        "admin_ssl_cert_default": "/kong_prefix/ssl/admin-kong-default.crt",
        "pg_ssl": false,
        "status_access_log": "off",
        "cluster_listeners": [
            {
                "listener": "0.0.0.0:8005",
                "proxy_protocol": false,
                "reuseport": false,
                "backlog=%d+": false,
                "deferred": false,
                "ssl": false,
                "ip": "0.0.0.0",
                "port": 8005,
                "http2": false,
                "bind": false
            }
        ],
        "kong_env": "/kong_prefix/.kong_env",
        "cassandra_schema_consensus_timeout": 10000,
        "log_level": "debug",
        "admin_ssl_cert_key_default": "/kong_prefix/ssl/admin-kong-default.key",
        "real_ip_recursive": "off",
        "proxy_error_log": "/dev/stderr",
        "nginx_main_worker_processes": "1",
        "router_consistency": "strict",
        "pg_port": 5432,
        "cassandra_keyspace": "kong",
        "ssl_cert_default": "/kong_prefix/ssl/kong-default.crt",
        "nginx_http_ssl_session_timeout": "1d",
        "error_default_type": "text/plain",
        "role": "traditional",
        "admin_ssl_enabled": false,
        "trusted_ips": {},
        "nginx_events_worker_connections": "auto",
        "nginx_supstream_directives": {},
        "ssl_cert_key": "/kong_prefix/ssl/kong-default.key",
        "pg_user": "kong",
        "pg_password": "******",
        "ssl_ciphers": "******",
        "nginx_admin_directives": {},
        "nginx_upstream_keepalive_timeout": "60s",
        "nginx_http_directives": [
            {
                "value": "0",
                "name": "client_max_body_size"
            },
            {
                "value": "off",
                "name": "ssl_prefer_server_ciphers"
            },
            {
                "value": "8k",
                "name": "client_body_buffer_size"
            },
            {
                "value": "TLSv1.2 TLSv1.3",
                "name": "ssl_protocols"
            },
            {
                "value": "on",
                "name": "ssl_session_tickets"
            },
            {
                "value": "1d",
                "name": "ssl_session_timeout"
            },
            {
                "value": "/kong/servers.conf",
                "name": "include"
            },
            {
                "value": "prometheus_metrics 5m",
                "name": "lua_shared_dict"
            }
        ],
        "pg_host": "pgsql-postgresql",
        "nginx_kong_stream_conf": "/kong_prefix/nginx-kong-stream.conf",
        "ssl_cert_csr_default": "/kong_prefix/ssl/kong-default.csr",
        "go_plugins_dir": "off",
        "db_update_frequency": 5,
        "dns_order": [
            "LAST",
            "SRV",
            "A",
            "CNAME"
        ],
        "dns_error_ttl": 1,
        "nginx_optimizations": true,
        "nginx_http_upstream_keepalive_timeout": "60s",
        "pg_timeout": 5000,
        "nginx_http_upstream_keepalive_requests": "100",
        "database": "postgres",
        "nginx_upstream_keepalive": "60",
        "nginx_worker_processes": "1",
        "nginx_http_status_directives": {},
        "lua_package_path": "/opt/?.lua;;",
        "router_update_frequency": 1,
        "upstream_keepalive": 60,
        "pg_max_concurrent_queries": 0,
        "proxy_ssl_enabled": true,
        "nginx_http_upstream_keepalive": "60",
        "lua_socket_pool_size": 30,
        "proxy_access_log": "/dev/stdout",
        "loaded_plugins": {
            "correlation-id": true,
            "pre-function": true,
            "cors": true,
            "ldap-auth": true,
            "loggly": true,
            "hmac-auth": true,
            "zipkin": true,
            "request-size-limiting": true,
            "azure-functions": true,
            "request-transformer": true,
            "oauth2": true,
            "response-transformer": true,
            "kong-plugin-url-regex-rewriter": true,
            "syslog": true,
            "statsd": true,
            "jwt": true,
            "proxy-cache": true,
            "basic-auth": true,
            "key-auth": true,
            "http-log": true,
            "datadog": true,
            "tcp-log": true,
            "acme": true,
            "post-function": true,
            "bot-detection": true,
            "acl": true,
            "session": true,
            "ip-restriction": true,
            "file-log": true,
            "udp-log": true,
            "response-ratelimiting": true,
            "aws-lambda": true,
            "rate-limiting": true,
            "prometheus": true,
            "request-termination": true
        },
        "db_resurrect_ttl": 30,
        "ssl_cert_key_default": "/kong_prefix/ssl/kong-default.key",
        "cassandra_consistency": "ONE",
        "client_max_body_size": "0",
        "admin_error_log": "/dev/stderr",
        "nginx_main_directives": [
            {
                "value": "off",
                "name": "daemon"
            },
            {
                "value": "auto",
                "name": "worker_rlimit_nofile"
            },
            {
                "value": "1",
                "name": "worker_processes"
            }
        ],
        "dns_not_found_ttl": 30,
        "nginx_http_ssl_session_tickets": "on",
        "cassandra_data_centers": [
            "dc1:2",
            "dc2:3"
        ],
        "dns_stale_ttl": 4,
        "cassandra_repl_strategy": "SimpleStrategy",
        "status_error_log": "logs/status_error.log",
        "nginx_http_client_body_buffer_size": "8k",
        "kic": false,
        "cassandra_lb_policy": "RequestRoundRobin",
        "nginx_kong_conf": "/kong_prefix/nginx-kong.conf",
        "real_ip_header": "X-Real-IP",
        "dns_hostsfile": "/etc/hosts",
        "admin_listeners": [
            {
                "listener": "0.0.0.0:8444",
                "proxy_protocol": false,
                "reuseport": false,
                "backlog=%d+": false,
                "deferred": false,
                "ssl": false,
                "ip": "0.0.0.0",
                "port": 8444,
                "http2": false,
                "bind": false
            }
        ],
        "client_ssl_cert_key_default": "/kong_prefix/ssl/kong-default.key",
        "ssl_cert": "/kong_prefix/ssl/kong-default.crt",
        "nginx_proxy_real_ip_recursive": "off",
        "admin_access_log": "/dev/stdout",
        "cassandra_ssl_verify": false,
        "client_ssl": false,
        "cluster_listen": [
            "0.0.0.0:8005"
        ],
        "ssl_cipher_suite": "intermediate",
        "cassandra_repl_factor": 1,
        "nginx_proxy_directives": [
            {
                "value": "X-Real-IP",
                "name": "real_ip_header"
            },
            {
                "value": "off",
                "name": "real_ip_recursive"
            }
        ],
        "nginx_daemon": "off",
        "anonymous_reports": true,
        "nginx_sproxy_directives": {},
        "cassandra_timeout": 5000,
        "pg_ssl_verify": false,
        "status_listeners": {},
        "client_body_buffer_size": "8k",
        "nginx_upstream_directives": [
            {
                "value": "100",
                "name": "keepalive_requests"
            },
            {
                "value": "60s",
                "name": "keepalive_timeout"
            },
            {
                "value": "60",
                "name": "keepalive"
            }
        ],
        "nginx_http_include": "/kong/servers.conf",
        "stream_listeners": {},
        "nginx_proxy_real_ip_header": "X-Real-IP",
        "nginx_stream_directives": [
            {
                "value": "stream_prometheus_metrics 5m",
                "name": "lua_shared_dict"
            }
        ],
        "cassandra_ssl": false,
        "mem_cache_size": "128m"
    },
    "version": "2.0.4",
    "node_id": "d2a7603b-c9bd-4701-9869-9ddb338a02f3",
    "lua_version": "LuaJIT 2.1.0-beta3",
    "prng_seeds": {
        "pid: 23": 411241112426,
        "pid: 1": 200225212175
    },
    "timers": {
        "pending": 9,
        "running": 0
    },
    "hostname": "kong-kong-6bb597d7d4-44rp2"
}

k8s deployment manifest:

Name:                   kong-kong
Namespace:              kong
CreationTimestamp:      Sat, 30 May 2020 11:59:29 +0800
Labels:                 app.kubernetes.io/component=app
                        app.kubernetes.io/instance=kong
                        app.kubernetes.io/managed-by=Tiller
                        app.kubernetes.io/name=kong
                        app.kubernetes.io/version=1.4
                        helm.sh/chart=kong-1.0.1
Annotations:            deployment.kubernetes.io/revision: 3
Selector:               app.kubernetes.io/component=app,app.kubernetes.io/instance=kong,app.kubernetes.io/name=kong
Replicas:               2 desired | 2 updated | 2 total | 2 available | 0 unavailable
StrategyType:           RollingUpdate
MinReadySeconds:        0
RollingUpdateStrategy:  25% max unavailable, 25% max surge
Pod Template:
  Labels:           app.kubernetes.io/component=app
                    app.kubernetes.io/instance=kong
                    app.kubernetes.io/managed-by=Tiller
                    app.kubernetes.io/name=kong
                    app.kubernetes.io/version=1.4
                    helm.sh/chart=kong-1.0.1
  Service Account:  kong-kong
  Init Containers:
   wait-for-db:
    Image:      myprodimages.azurecr.io/kong:prod-master-loglevel-debug-b0bbc82
    Port:       <none>
    Host Port:  <none>
    Command:
      /bin/sh
      -c
      until kong start; do echo 'waiting for db'; sleep 1; done; kong stop
    Environment:
      KONG_LUA_PACKAGE_PATH:        /opt/?.lua;;
      KONG_PLUGINS:                 bundled,kong-plugin-url-regex-rewriter
      KONG_ADMIN_ACCESS_LOG:        /dev/stdout
      KONG_ADMIN_ERROR_LOG:         /dev/stderr
      KONG_ADMIN_GUI_ACCESS_LOG:    /dev/stdout
      KONG_ADMIN_GUI_ERROR_LOG:     /dev/stderr
      KONG_DATABASE:                postgres
      KONG_ENV:                     prod
      KONG_LOG_LEVEL:               debug
      KONG_NGINX_WORKER_PROCESSES:  1
      KONG_PG_HOST:                 pgsql-postgresql
      KONG_PG_PASSWORD:             kong
      KONG_PG_PORT:                 5432
      KONG_PORTAL_API_ACCESS_LOG:   /dev/stdout
      KONG_PORTAL_API_ERROR_LOG:    /dev/stderr
      KONG_PREFIX:                  /kong_prefix/
      KONG_PROXY_ACCESS_LOG:        /dev/stdout
      KONG_PROXY_ERROR_LOG:         /dev/stderr
    Mounts:
      /kong from custom-nginx-template-volume (rw)
      /kong_prefix/ from kong-kong-prefix-dir (rw)
      /opt/kong/plugins/kong-plugin-url-regex-rewriter from kong-plugin-kong-plugin-url-regex-rewriter (ro)
      /tmp from kong-kong-tmp (rw)
  Containers:
   ingress-controller:
    Image:      kong-docker-kubernetes-ingress-controller.bintray.io/kong-ingress-controller:0.7.0
    Port:       <none>
    Host Port:  <none>
    Args:
      /kong-ingress-controller
      --publish-service=kong/kong-kong-proxy
      --ingress-class=kong
      --election-id=kong-ingress-controller-leader-kong
      --kong-url=http://localhost:8444
    Liveness:   http-get http://:10254/healthz delay=5s timeout=5s period=10s #success=1 #failure=3
    Readiness:  http-get http://:10254/healthz delay=5s timeout=5s period=10s #success=1 #failure=3
    Environment:
      POD_NAME:        (v1:metadata.name)
      POD_NAMESPACE:   (v1:metadata.namespace)
    Mounts:           <none>
   proxy:
    Image:       myprodimages.azurecr.io/kong:prod-master-loglevel-debug-b0bbc82
    Ports:       8444/TCP, 8000/TCP, 8443/TCP, 9542/TCP
    Host Ports:  0/TCP, 0/TCP, 0/TCP, 0/TCP
    Liveness:    http-get http://:metrics/status delay=5s timeout=5s period=10s #success=1 #failure=3
    Readiness:   http-get http://:metrics/status delay=5s timeout=5s period=10s #success=1 #failure=3
    Environment:
      KONG_LUA_PACKAGE_PATH:        /opt/?.lua;;
      KONG_ADMIN_LISTEN:            0.0.0.0:8444
      KONG_PROXY_LISTEN:            0.0.0.0:8000,0.0.0.0:8443 ssl
      KONG_NGINX_DAEMON:            off
      KONG_NGINX_HTTP_INCLUDE:      /kong/servers.conf
      KONG_PLUGINS:                 bundled,kong-plugin-url-regex-rewriter
      KONG_ADMIN_ACCESS_LOG:        /dev/stdout
      KONG_ADMIN_ERROR_LOG:         /dev/stderr
      KONG_ADMIN_GUI_ACCESS_LOG:    /dev/stdout
      KONG_ADMIN_GUI_ERROR_LOG:     /dev/stderr
      KONG_DATABASE:                postgres
      KONG_ENV:                     prod
      KONG_LOG_LEVEL:               debug
      KONG_NGINX_WORKER_PROCESSES:  1
      KONG_PG_HOST:                 pgsql-postgresql
      KONG_PG_PASSWORD:             kong
      KONG_PG_PORT:                 5432
      KONG_PORTAL_API_ACCESS_LOG:   /dev/stdout
      KONG_PORTAL_API_ERROR_LOG:    /dev/stderr
      KONG_PREFIX:                  /kong_prefix/
      KONG_PROXY_ACCESS_LOG:        /dev/stdout
      KONG_PROXY_ERROR_LOG:         /dev/stderr
    Mounts:
      /kong from custom-nginx-template-volume (rw)
      /kong_prefix/ from kong-kong-prefix-dir (rw)
      /opt/kong/plugins/kong-plugin-url-regex-rewriter from kong-plugin-kong-plugin-url-regex-rewriter (ro)
      /tmp from kong-kong-tmp (rw)
  Volumes:
   kong-kong-prefix-dir:
    Type:       EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:     
    SizeLimit:  <unset>
   kong-kong-tmp:
    Type:       EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:     
    SizeLimit:  <unset>
   kong-plugin-kong-plugin-url-regex-rewriter:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      url-regex-rewriter
    Optional:  false
   custom-nginx-template-volume:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      kong-kong-default-custom-server-blocks
    Optional:  false
Conditions:
  Type           Status  Reason
  ----           ------  ------
  Available      True    MinimumReplicasAvailable
  Progressing    True    NewReplicaSetAvailable
OldReplicaSets:  kong-kong-6bb597d7d4 (2/2 replicas created)
NewReplicaSet:   <none>
Events:          <none>
zffocussss commented 4 years ago

@hbagdi we have some trace in kong logs.It may be some bad configuration cause that error.

2020/07/23 06:23:57 [warn] 1#0: load balancing method redefined in /kong_prefix/nginx.conf:80
nginx: [warn] load balancing method redefined in /kong_prefix/nginx.conf:80
2020/07/23 06:23:57 [warn] 1#0: [lua] init.lua:401: init(): database has pending migrations:
core: 008_150_to_200
nginx: [warn] [lua] init.lua:401: init(): database has pending migrations:
core: 008_150_to_200

after I issued kong migrations finish -vv inside kong

Error:
/usr/local/share/lua/5.1/kong/cmd/utils/migrations.lua:161: [PostgreSQL error] failed to insert cluster lock: receive_message: failed to get type: timeout
stack traceback:
    [C]: in function 'error'
    /usr/local/share/lua/5.1/kong/cmd/utils/migrations.lua:161: in function 'finish'
    /usr/local/share/lua/5.1/kong/cmd/migrations.lua:179: in function 'cmd_exec'
    /usr/local/share/lua/5.1/kong/cmd/init.lua:88: in function </usr/local/share/lua/5.1/kong/cmd/init.lua:88>
    [C]: in function 'xpcall'
    /usr/local/share/lua/5.1/kong/cmd/init.lua:88: in function </usr/local/share/lua/5.1/kong/cmd/init.lua:45>
    /usr/local/bin/kong:9: in function 'file_gen'
    init_worker_by_lua:48: in function <init_worker_by_lua:46>
    [C]: in function 'xpcall'
    init_worker_by_lua:55: in function <init_worker_by_lua:53>

can you please tell me how to check the bad points of my configuration?

zffocussss commented 4 years ago

apparently,we have pending migration..but it failed when I tried to do it.

/ $ kong migrations list
Executed migrations:
                 core: 000_base, 003_100_to_110, 004_110_to_120, 005_120_to_130, 006_130_to_140, 007_140_to_150
            hmac-auth: 000_base_hmac_auth, 002_130_to_140
               oauth2: 000_base_oauth2, 003_130_to_140
                  jwt: 000_base_jwt, 002_130_to_140
           basic-auth: 000_base_basic_auth, 002_130_to_140
             key-auth: 000_base_key_auth, 002_130_to_140
        rate-limiting: 000_base_rate_limiting, 003_10_to_112
                  acl: 000_base_acl, 002_130_to_140
                 acme: 000_base_acme
response-ratelimiting: 000_base_response_rate_limiting
              session: 000_base_session

Pending migrations:
core: 008_150_to_200

Run 'kong migrations finish' when ready
zffocussss commented 4 years ago

I just checked the pqsql.there are many waiting info

UID         PID   PPID  C STIME TTY          TIME CMD
1001          1      0  0 Jul06 ?        00:02:26 /opt/bitnami/postgresql/bin/postgres -D /bitnami/postgresql/data --config-file=/opt/bitnami/postgr
1001        190      1  0 Jul06 ?        00:00:00 postgres: checkpointer
1001        191      1  0 Jul06 ?        00:00:16 postgres: background writer
1001        192      1  0 Jul06 ?        00:00:16 postgres: walwriter
1001        193      1  0 Jul06 ?        00:00:10 postgres: autovacuum launcher
1001        194      1  0 Jul06 ?        00:01:05 postgres: stats collector
1001        195      1  0 Jul06 ?        00:00:00 postgres: logical replication launcher
1001        196      1  0 Jul06 ?        00:00:00 postgres: kong kong 127.0.0.1(35044) idle
1001     112359      1  0 06:23 ?        00:00:00 postgres: kong kong 10.30.0.175(46844) DELETE waiting for 0/5257420
1001     112409      1  0 06:23 ?        00:00:00 postgres: kong kong 10.30.0.53(38408) DELETE waiting for 0/52575E8
1001     112456      1  0 06:24 ?        00:00:00 postgres: kong kong 10.30.0.175(47424) DELETE waiting for 0/52574B8
1001     112457      1  0 06:24 ?        00:00:00 postgres: kong kong 10.30.0.175(47468) DELETE waiting for 0/5257550
1001     112471      1  0 06:24 ?        00:00:00 postgres: kong kong 10.30.0.175(47520) DELETE waiting for 0/5257680
1001     112472      1  0 06:24 ?        00:00:00 postgres: kong kong 10.30.0.53(38928) DELETE waiting for 0/5257760
1001     112486      1  0 06:24 ?        00:00:00 postgres: kong kong 10.30.0.175(47604) DELETE waiting for 0/52577F8
1001     112493      1  0 06:24 ?        00:00:00 postgres: kong kong 10.30.0.53(39132) DELETE waiting for 0/5257890
1001     112500      1  0 06:24 ?        00:00:00 postgres: kong kong 10.30.0.175(47716) DELETE waiting for 0/5257928
1001     112508      1  0 06:25 ?        00:00:02 postgres: kong kong 10.30.0.53(39260) idle
1001     112518      1  0 06:25 ?        00:00:00 postgres: kong kong 10.30.0.175(47820) DELETE waiting
1001     113296      1  0 06:34 ?        00:00:00 postgres: kong kong 10.30.0.53(45970) COMMIT waiting for 0/52584B0
1001     113636      1  0 06:39 ?        00:00:00 postgres: kong kong 10.30.0.53(48700) INSERT waiting
1001     114719      1  0 06:52 ?        00:00:00 postgres: kong kong 10.30.0.53(57358) INSERT waiting
1001     114825      1  0 06:54 ?        00:00:00 postgres: kong kong 10.30.0.53(58260) INSERT waiting
1001     115815      1  0 07:06 ?        00:00:00 postgres: kong kong 10.30.0.53(37950) INSERT waiting
1001     120464      1  0 08:03 ?        00:00:00 postgres: kong kong 10.30.0.53(48156) INSERT waiting
1001     122154      1  0 08:24 ?        00:00:00 postgres: kong kong 10.30.0.175(40304) idle
1001     127834      1  0 09:34 ?        00:00:00 postgres: kong kong 10.30.0.53(53684) INSERT waiting
1001     128736      1  0 09:45 ?        00:00:00 postgres: kong kong 10.30.0.53(33178) INSERT waiting
1001     129889      0  0 09:59 pts/0    00:00:00 bash
1001     129997 129889  0 10:01 pts/0    00:00:00 ps -ef
I have no name!@pgsql-postgresql-master-0:/$ date
bungle commented 3 years ago

This might be related with: https://github.com/Kong/kubernetes-ingress-controller/issues/860

bungle commented 3 years ago

The error seems to originate from: https://github.com/leafo/pgmoon/blob/e14ba4c7857f357392586565cd81dd475496bac7/pgmoon/init.moon#L486

zffocussss commented 3 years ago

the postgresql is locked.when tring to delete services using API

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.