Tyk gateway unable to bring up

I got below error when bring up tyk-gateway, and I have tried on different environment, it still not work and got the same error. Anyone know what is indicate?

tyk_gateway_1    | panic: runtime error: invalid memory address or nil pointer dereference
tyk_gateway_1    | [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x42cfbb]
tyk_gateway_1    | 
tyk_gateway_1    | goroutine 536 [running]:
tyk_gateway_1    | panic(0xccaae0, 0xc420010070)
tyk_gateway_1    | 	/usr/local/go/src/runtime/panic.go:500 +0x1a1
tyk_gateway_1    | main.processSpec(0xc420598aa0, 0xc4203e0230, 0x5, 0xc421340c00, 0xc421340c20, 0xc421340c40, 0xc421329c20, 0xc421329c80, 0xc4203e0230, 0xc420240ee8)
tyk_gateway_1    | 	/src/github.com/TykTechnologies/tyk/api_loader.go:149 +0x5bb
tyk_gateway_1    | main.loadApps.func1(0xc421334c80, 0xc42007f690, 0xc421340c00, 0xc421340c20, 0xc421340c40, 0xc421329c20, 0xc421329c80, 0xc421329ce0, 0xc420598aa0, 0x5, ...)
tyk_gateway_1    | 	/src/github.com/TykTechnologies/tyk/api_loader.go:646 +0x10a
tyk_gateway_1    | created by main.loadApps
tyk_gateway_1    | 	/src/github.com/TykTechnologies/tyk/api_loader.go:649 +0x4eb
demo_tyk_gateway_1 exited with code 2

Hi, is this a Tyk Pro setup?

Can you share the API definition you’re using?


Thanks for your response.

Yes, it is Pro setup.

It is not even go to API definition setup, the error comes when starting up the gateway service.
Please see the tyk.conf,

    "listen_port": 8080,
    "secret": "352d20ee67be67f6340b4c0605b044b7",
    "node_secret": "352d20ee67be67f6340b4c0605b044b7",
    "template_path": "/opt/tyk-gateway/templates",
    "tyk_js_path": "/opt/tyk-gateway/js/tyk.js",
    "middleware_path": "/opt/tyk-gateway/middleware",
    "use_db_app_configs": true,
    "db_app_conf_options": {
        "connection_string": "http://tyk_dashboard:3000",
        "node_is_segmented": false,
        "tags": ["test2"]
    "app_path": "/opt/tyk-gateway/apps/",
    "storage": {
        "type": "redis",
        "host": "redis",
        "port": 6379,
        "username": "",
        "password": "",
        "database": 0,
        "optimisation_max_idle": 100
    "enable_analytics": true,
    "analytics_config": {
        "type": "mongo",
        "csv_dir": "/tmp",
        "mongo_url": "",
        "mongo_db_name": "",
        "mongo_collection": "",
        "purge_delay": -1,
        "ignored_ips": []
    "health_check": {
        "enable_health_checks": true,
        "health_check_value_timeouts": 60
    "optimisations_use_async_session_write": true,
    "enable_non_transactional_rate_limiter": true,
    "enable_sentinel_rate_limiter": false,
    "allow_master_keys": false,
    "policies": {
        "policy_source": "service",
        "policy_connection_string": "http://tyk_dashboard:3000",
        "policy_record_name": "tyk_policies"
    "hash_keys": true,
    "close_connections": true,
    "allow_insecure_configs": true,
     "coprocess_options": {
        "enable_coprocess": false,
        "coprocess_grpc_server": ""
    "enable_jsvm": true,
    "enable_bundle_downloader": true,
    "bundle_base_url": "",
    "global_session_lifetime": 100,
    "force_global_session_lifetime": false,
    "max_idle_connections_per_host": 100

What version are you running?

It is 2.3.7 , and it is from the latest docker images.

We fixed this very issue in 2.3.8: Gateway may panic when loading duplicate APIs on stable · Issue #938 · TykTechnologies/tyk · GitHub

Please update to the latest version.

@mvdan Please update the latest tag build on docker hub. The current version is v2.3.7 under latest tag.

I see - we’ll fix that, thanks!