ERROR: duplicate key value violates unique constraint "plugins_cache_key_key"

Hi,
I am having issues upgrading kong from 0.11 -->1.5.xxx , can some one help here.

root@gi2s7xdfwkon006:/home/arun.patcha$ /usr/local/bin/kong migrations finish --vv
2022/03/30 14:42:09 [verbose] Kong: 1.5.1
2022/03/30 14:42:09 [debug] ngx_lua: 10015
2022/03/30 14:42:09 [debug] nginx: 1015008
2022/03/30 14:42:09 [debug] Lua: LuaJIT 2.1.0-beta3
2022/03/30 14:42:09 [verbose] reading config file at /etc/kong/kong.conf
2022/03/30 14:42:09 [debug] reading environment variables
2022/03/30 14:42:09 [debug] admin_access_log = “logs/admin_access.log”
2022/03/30 14:42:09 [debug] admin_error_log = “logs/error.log”
2022/03/30 14:42:09 [debug] admin_listen = {“127.0.0.1:8001”,“127.0.0.1:8444 http2 ssl”}
2022/03/30 14:42:09 [debug] anonymous_reports = true
2022/03/30 14:42:09 [debug] cassandra_consistency = “ONE”
2022/03/30 14:42:09 [debug] cassandra_contact_points = {“127.0.0.1”}
2022/03/30 14:42:09 [debug] cassandra_data_centers = {“dc1:2”,“dc2:3”}
2022/03/30 14:42:09 [debug] cassandra_keyspace = “kong”
2022/03/30 14:42:09 [debug] cassandra_lb_policy = “RequestRoundRobin”
2022/03/30 14:42:09 [debug] cassandra_port = 9042
2022/03/30 14:42:09 [debug] cassandra_refresh_frequency = 60
2022/03/30 14:42:09 [debug] cassandra_repl_factor = 1
2022/03/30 14:42:09 [debug] cassandra_repl_strategy = “SimpleStrategy”
2022/03/30 14:42:09 [debug] cassandra_schema_consensus_timeout = 10000
2022/03/30 14:42:09 [debug] cassandra_ssl = false
2022/03/30 14:42:09 [debug] cassandra_ssl_verify = false
2022/03/30 14:42:09 [debug] cassandra_timeout = 5000
2022/03/30 14:42:09 [debug] cassandra_username = “kong”
2022/03/30 14:42:09 [debug] client_body_buffer_size = “32k”
2022/03/30 14:42:09 [debug] client_max_body_size = “0”
2022/03/30 14:42:09 [debug] client_ssl = false
2022/03/30 14:42:09 [debug] database = “postgres”
2022/03/30 14:42:09 [debug] db_cache_ttl = 0
2022/03/30 14:42:09 [debug] db_cache_warmup_entities = {“services”,“plugins”}
2022/03/30 14:42:09 [debug] db_resurrect_ttl = 30
2022/03/30 14:42:09 [debug] db_update_frequency = 5
2022/03/30 14:42:09 [debug] db_update_propagation = 0
2022/03/30 14:42:09 [debug] dns_error_ttl = 1
2022/03/30 14:42:09 [debug] dns_hostsfile = “/etc/hosts”
2022/03/30 14:42:09 [debug] dns_no_sync = false
2022/03/30 14:42:09 [debug] dns_not_found_ttl = 30
2022/03/30 14:42:09 [debug] dns_order = {“LAST”,“SRV”,“A”,“CNAME”}
2022/03/30 14:42:09 [debug] dns_resolver = {}
2022/03/30 14:42:09 [debug] dns_stale_ttl = 4
2022/03/30 14:42:09 [debug] error_default_type = “text/plain”
2022/03/30 14:42:09 [debug] headers = {“server_tokens”,“latency_tokens”}
2022/03/30 14:42:09 [debug] log_level = “notice”
2022/03/30 14:42:09 [debug] lua_package_cpath = “”
2022/03/30 14:42:09 [debug] lua_package_path = “./?.lua;./?/init.lua;”
2022/03/30 14:42:09 [debug] lua_socket_pool_size = 30
2022/03/30 14:42:09 [debug] lua_ssl_verify_depth = 1
2022/03/30 14:42:09 [debug] mem_cache_size = “128m”
2022/03/30 14:42:09 [debug] nginx_admin_directives = {}
2022/03/30 14:42:09 [debug] nginx_daemon = “on”
2022/03/30 14:42:09 [debug] nginx_http_directives = {{value=“TLSv1.1 TLSv1.2 TLSv1.3”,name=“ssl_protocols”}}
2022/03/30 14:42:09 [debug] nginx_http_ssl_protocols = “TLSv1.1 TLSv1.2 TLSv1.3”
2022/03/30 14:42:09 [debug] nginx_http_status_directives = {}
2022/03/30 14:42:09 [debug] nginx_http_upstream_directives = {{value=“60s”,name=“keepalive_timeout”},{value=“100”,name=“keepalive_requests”},{value=“60”,name=“keepalive”}}
2022/03/30 14:42:09 [debug] nginx_http_upstream_keepalive = “60”
2022/03/30 14:42:09 [debug] nginx_http_upstream_keepalive_requests = “100”
2022/03/30 14:42:09 [debug] nginx_http_upstream_keepalive_timeout = “60s”
2022/03/30 14:42:09 [debug] nginx_optimizations = true
2022/03/30 14:42:09 [debug] nginx_proxy_directives = {}
2022/03/30 14:42:09 [debug] nginx_sproxy_directives = {}
2022/03/30 14:42:09 [debug] nginx_stream_directives = {}
2022/03/30 14:42:09 [debug] nginx_user = “nobody nobody”
2022/03/30 14:42:09 [debug] nginx_worker_processes = “auto”
2022/03/30 14:42:09 [debug] origins = {}
2022/03/30 14:42:09 [debug] pg_database = “kongoss”
2022/03/30 14:42:09 [debug] pg_host = “dsk001”
2022/03/30 14:42:09 [debug] pg_max_concurrent_queries = 0
2022/03/30 14:42:09 [debug] pg_password = “******”
2022/03/30 14:42:09 [debug] pg_port = 5432
2022/03/30 14:42:09 [debug] pg_semaphore_timeout = 60000
2022/03/30 14:42:09 [debug] pg_ssl = false
2022/03/30 14:42:09 [debug] pg_ssl_verify = false
2022/03/30 14:42:09 [debug] pg_timeout = 5000
2022/03/30 14:42:09 [debug] pg_user = “kongoss”
2022/03/30 14:42:09 [debug] plugins = {“ip-restriction”,“jwt”,“cors”,“basic-auth”,“key-auth”,“rate-limiting”,“http-log”,“acl”,“bot-detection”,“tcp-log”,“response-ratelimiting”,“ldap-auth”,“oauth2”}
2022/03/30 14:42:09 [debug] prefix = “/usr/local/kong/”
2022/03/30 14:42:09 [debug] proxy_access_log = “logs/access.log”
2022/03/30 14:42:09 [debug] proxy_error_log = “logs/error.log”
2022/03/30 14:42:09 [debug] proxy_listen = {“0.0.0.0:8000”,“0.0.0.0:8443 http2 ssl”}
2022/03/30 14:42:09 [debug] real_ip_header = “X-Forwarded-For”
2022/03/30 14:42:09 [debug] real_ip_recursive = “off”
2022/03/30 14:42:09 [debug] router_consistency = “strict”
2022/03/30 14:42:09 [debug] router_update_frequency = 1
2022/03/30 14:42:09 [debug] service_mesh = false
2022/03/30 14:42:09 [debug] ssl_cipher_suite = “modern”
2022/03/30 14:42:09 [debug] ssl_ciphers = “ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256”
2022/03/30 14:42:09 [debug] status_access_log = “off”
2022/03/30 14:42:09 [debug] status_error_log = “logs/status_error.log”
2022/03/30 14:42:09 [debug] status_listen = {“off”}
2022/03/30 14:42:09 [debug] stream_listen = {“off”}
2022/03/30 14:42:09 [debug] trusted_ips = {“0.0.0.0/0”,"::/0"}
2022/03/30 14:42:09 [debug] upstream_keepalive = 60
2022/03/30 14:42:09 [verbose] prefix in use: /usr/local/kong
2022/03/30 14:42:09 [debug] loading subsystems migrations…
2022/03/30 14:42:09 [verbose] retrieving database schema state…
2022/03/30 14:42:09 [verbose] schema state retrieved
2022/03/30 14:42:09 [debug] loading subsystems migrations…
2022/03/30 14:42:09 [verbose] retrieving database schema state…
2022/03/30 14:42:09 [verbose] schema state retrieved
2022/03/30 14:42:09 [debug] pending migrations to finish:
core: 001_14_to_15, 002_15_to_1, 005_120_to_130
acl: 001_14_to_15
rate-limiting: 001_14_to_15, 002_15_to_10
response-ratelimiting: 001_14_to_15, 002_15_to_10
oauth2: 001_14_to_15, 002_15_to_10
2022/03/30 14:42:09 [info] migrating core on database ‘kongoss’…
2022/03/30 14:42:09 [debug] running migration: 001_14_to_15
Error:
/usr/local/share/lua/5.1/kong/cmd/utils/migrations.lua:233: [PostgreSQL error] cluster_mutex callback threw an error: /usr/local/share/lua/5.1/kong/cmd/utils/migrations.lua:214: [PostgreSQL error] failed to run migration ‘001_14_to_15’ teardown: …l/share/lua/5.1/kong/db/migrations/core/001_14_to_15.lua:285: ERROR: duplicate key value violates unique constraint “plugins_cache_key_key”
Key (cache_key)=(plugins:http-log:ae58b407-05de-4cc4-9d91-da72dae4831a:::slight_smile: already exists.
stack traceback:
[C]: in function ‘assert’
…l/share/lua/5.1/kong/db/migrations/core/001_14_to_15.lua:285: in function <…l/share/lua/5.1/kong/db/migrations/core/001_14_to_15.lua:264>
[C]: in function ‘xpcall’
/usr/local/share/lua/5.1/kong/db/init.lua:565: in function ‘run_migrations’
/usr/local/share/lua/5.1/kong/cmd/utils/migrations.lua:214: in function </usr/local/share/lua/5.1/kong/cmd/utils/migrations.lua:198>
[C]: in function ‘xpcall’
/usr/local/share/lua/5.1/kong/db/init.lua:358: in function </usr/local/share/lua/5.1/kong/db/init.lua:308>
[C]: in function ‘pcall’
/usr/local/share/lua/5.1/kong/concurrency.lua:45: in function ‘cluster_mutex’
/usr/local/share/lua/5.1/kong/cmd/utils/migrations.lua:198: in function ‘finish’
/usr/local/share/lua/5.1/kong/cmd/migrations.lua:216: in function ‘cmd_exec’
/usr/local/share/lua/5.1/kong/cmd/init.lua:87: in function </usr/local/share/lua/5.1/kong/cmd/init.lua:87>
[C]: in function ‘xpcall’
/usr/local/share/lua/5.1/kong/cmd/init.lua:87: in function </usr/local/share/lua/5.1/kong/cmd/init.lua:44>
/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>
stack traceback:
[C]: in function ‘assert’
/usr/local/share/lua/5.1/kong/cmd/utils/migrations.lua:214: in function </usr/local/share/lua/5.1/kong/cmd/utils/migrations.lua:198>
[C]: in function ‘xpcall’
/usr/local/share/lua/5.1/kong/db/init.lua:358: in function </usr/local/share/lua/5.1/kong/db/init.lua:308>
[C]: in function ‘pcall’
/usr/local/share/lua/5.1/kong/concurrency.lua:45: in function ‘cluster_mutex’
/usr/local/share/lua/5.1/kong/cmd/utils/migrations.lua:198: in function ‘finish’
/usr/local/share/lua/5.1/kong/cmd/migrations.lua:216: in function ‘cmd_exec’
/usr/local/share/lua/5.1/kong/cmd/init.lua:87: in function </usr/local/share/lua/5.1/kong/cmd/init.lua:87>
[C]: in function ‘xpcall’
/usr/local/share/lua/5.1/kong/cmd/init.lua:87: in function </usr/local/share/lua/5.1/kong/cmd/init.lua:44>
/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>
stack traceback:
[C]: in function ‘error’
/usr/local/share/lua/5.1/kong/cmd/utils/migrations.lua:233: in function ‘finish’
/usr/local/share/lua/5.1/kong/cmd/migrations.lua:216: in function ‘cmd_exec’
/usr/local/share/lua/5.1/kong/cmd/init.lua:87: in function </usr/local/share/lua/5.1/kong/cmd/init.lua:87>
[C]: in function ‘xpcall’
/usr/local/share/lua/5.1/kong/cmd/init.lua:87: in function </usr/local/share/lua/5.1/kong/cmd/init.lua:44>
/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>