First time setup using Docker, API definition is loaded, but not showing in dashboard

tyk-dashboard_1          | time="Jan 12 15:49:53" level=info msg="Using /opt/tyk-dashboard/tyk_analytics.conf for configurat
ion" 
tyk-dashboard_1          | time="Jan 12 15:49:53" level=info msg="Creating new Redis connection pool" 
tyk-dashboard_1          | time="Jan 12 15:49:54" level=info msg="Creating new Redis connection pool" 
tyk-dashboard_1          | time="Jan 12 15:49:54" level=info msg="Creating new Redis connection pool" 
tyk-dashboard_1          | time="Jan 12 15:49:54" level=info msg="Creating new Redis connection pool" 
tyk-dashboard_1          | time="Jan 12 15:49:54" level=info msg="Adding available nodes..." 
tyk-dashboard_1          | time="Jan 12 15:49:54" level=info msg="Tyk Analytics Dashboard v1.3.1.1" 
tyk-dashboard_1          | time="Jan 12 15:49:54" level=info msg="Copyright Martin Buhr 2016" 
tyk-dashboard_1          | time="Jan 12 15:49:54" level=info msg="https://www.tyk.io" 
tyk-dashboard_1          | time="Jan 12 15:49:54" level=info msg="Listening on port: 3000" 
tyk-dashboard_1          | time="Jan 12 15:49:54" level=info msg="Loading routes..." 
tyk-dashboard_1          | time="Jan 12 15:49:54" level=info msg="Registering nodes..." 
tyk-dashboard_1          | time="Jan 12 15:49:54" level=info msg="Adding available nodes..." 
tyk-dashboard_1          | time="Jan 12 15:49:54" level=info msg="Creating new Redis connection pool" 
tyk-dashboard_1          | time="Jan 12 15:49:54" level=info msg="Socket server started" 
tyk-dashboard_1          | time="Jan 12 15:49:54" level=info msg="--> Standard listener (http) for UI notifications" 
tyk-dashboard_1          | time="Jan 12 15:49:54" level=info msg="--> Standard listener (http) for dashboard and API" 
tyk-dashboard_1          | time="Jan 12 15:49:54" level=info msg="Starting zeroconf heartbeat" 
tyk-dashboard_1          | time="Jan 12 15:49:54" level=info msg="Starting notification handler for gateway cluster" 
tyk-pump_1               | time="Jan 12 15:49:53" level=info msg="## Tyk Analytics Pump, v0.4.1.1 ##" 
tyk-pump_1               | time="Jan 12 15:49:53" level=info msg="-- No max batch size set, defaulting to 10MB" 
tyk-pump_1               | time="Jan 12 15:49:53" level=info msg="-- No max document size set, defaulting to 10MB" 
tyk-pump_1               | time="Jan 12 15:49:53" level=info msg="Init Pump: MongoDB Pump" 
tyk-pump_1               | time="Jan 12 15:49:53" level=info msg="-- No max batch size set, defaulting to 10MB" 
tyk-pump_1               | time="Jan 12 15:49:53" level=info msg="-- No max document size set, defaulting to 10MB" 
tyk-pump_1               | time="Jan 12 15:49:53" level=info msg="Init Uptime Pump: MongoDB Pump" 
tyk-pump_1               | time="Jan 12 15:49:53" level=info msg="Starting purge loop @2(s)" 
tyk-gateway_1            | time="Jan 12 15:49:54" level=info msg="Connection dropped, connecting.." 
tyk-gateway_1            | time="Jan 12 15:49:54" level=info msg="PIDFile location set to: /var/run/tyk-gateway.pid" 
tyk-gateway_1            | time="Jan 12 15:49:54" level=error msg="Instrumentation is enabled, but no connectionstring set f
or statsd" 
tyk-gateway_1            | time="Jan 12 15:49:54" level=info msg="Initialising Tyk REST API Endpoints" 
tyk-gateway_1            | time="Jan 12 15:49:54" level=info msg="--> Standard listener (http)" 
tyk-gateway_1            | time="Jan 12 15:49:54" level=info msg="Setting up Server" 
tyk-gateway_1            | time="Jan 12 15:49:54" level=info msg="Initialising distributed rate limiter" 
tyk-gateway_1            | time="Jan 12 15:49:54" level=info msg="Starting Poller" 
tyk-gateway_1            | time="Jan 12 15:49:54" level=info msg="Starting gateway rate imiter notifications..." 
tyk-gateway_1            | time="Jan 12 15:49:54" level=info msg="Loading API Specification from /opt/tyk-gateway/apps/gocag
ne-api.json" 
tyk-gateway_1            | time="Jan 12 15:49:54" level=info msg="Detected 1 APIs" 
tyk-gateway_1            | time="Jan 12 15:49:54" level=info msg="Loading API configurations." 
tyk-gateway_1            | time="Jan 12 15:49:54" level=info msg="Tracking hostname" api_name=gocagne domain="(no host)" 
tyk-gateway_1            | time="Jan 12 15:49:54" level=info msg="Loading API" api_name=gocagne 
tyk-gateway_1            | time="Jan 12 15:49:54" level=info msg="Checking security policy: Token" api_name=gocagne 
tyk-pump_1               | time="Jan 12 15:49:55" level=warning msg="Connection dropped, connecting.." 
tyk-pump_1               | time="Jan 12 15:49:55" level=warning msg="Connection dropped, connecting.." 
tyk-gateway_1            | time="Jan 12 15:49:55" level=info msg="Processed and listening on: /gocagne/{rest:.*}" 
tyk-gateway_1            | time="Jan 12 15:49:55" level=info msg="Loading uptime tests..." 
tyk-gateway_1            | time="Jan 12 15:49:55" level=info msg="Initialised API Definitions" 
tyk-gateway_1            | time="Jan 12 15:49:55" level=info msg="Loading policies" 
tyk-gateway_1            | time="Jan 12 15:49:55" level=info msg="Gateway started (v2.3.1.2)" 
tyk-gateway_1            | time="Jan 12 15:49:55" level=info msg="--> Listening on address: (open interface)" 
tyk-gateway_1            | time="Jan 12 15:49:55" level=info msg="--> Listening on port: 8080" 
tyk-gateway_1            | time="Jan 12 15:49:55" level=info msg="--> PID: 7" 
tyk-dashboard_1          | time="Jan 12 15:55:55" level=warning msg="User pasword is empty! Please reset!" 
tyk-dashboard_1          | time="Jan 12 15:55:55" level=info msg="New user session created" 
tyk-dashboard_1          | time="Jan 12 15:55:58" level=warning msg="Login opened from: 172.23.0.1:56108" 
tyk-dashboard_1          | time="Jan 12 15:56:00" level=warning msg="Successful login ([email protected]) from: 172.23.0.1:56112" 
tyk-dashboard_1          | time="Jan 12 15:56:00" level=info msg="Aggregates disabled" 
tyk-dashboard_1          | time="Jan 12 15:56:01" level=info msg="Aggregates disabled" 
tyk-dashboard_1          | time="Jan 12 15:56:01" level=info msg="Aggregates disabled" 
tyk-dashboard_1          | time="Jan 12 15:56:07" level=info msg="Aggregates disabled" 
tyk-dashboard_1          | time="Jan 12 15:56:07" level=info msg="Aggregates disabled" 
tyk-dashboard_1          | time="Jan 12 15:56:18" level=info msg="Aggregates disabled" 
tyk-dashboard_1          | time="Jan 12 15:56:18" level=info msg="Aggregates disabled" 
tyk-dashboard_1          | time="Jan 12 15:56:19" level=info msg="Aggregates disabled" 
tyk-dashboard_1          | time="Jan 12 15:56:19" level=info msg="Aggregates disabled" 
tyk-dashboard_1          | time="Jan 12 15:56:24" level=error msg="TIB: Request failed: Get /api/profiles: unsupported protocol scheme \"\"" 
tyk-dashboard_1          | time="Jan 12 15:56:41" level=error msg="TIB: Request failed: Get /api/profiles: unsupported protocol scheme \"\"" 

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": false,
    "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": "file",
      "policy_connection_string": "http://tyk_dashboard:3000"
    },
    "hash_keys": true,
    "close_connections": true,
    "allow_insecure_configs": true,
    "coprocess_options": {
      "enable_coprocess": false,
      "coprocess_grpc_server": ""
    },
    "enable_bundle_downloader": true,
    "bundle_base_url": "",
    "global_session_lifetime": 100,
    "force_global_session_lifetime": false,
    "max_idle_connections_per_host": 100
}

The name of my API is “gocagne”.

Is there anything else I need to do to get this API to show up in the dashboard so I can issue an API key?

I’m assuming that because I’m not using the “db configuration mode” and instead am using static files, the tyk_pump process isn’t pumping the api definition to the dashboard or something?

The dashboard only manages APIs created in the dashboard, not file based. File-based mode is the community edition, this means it’s headless and there is no GUI.

Interesting. It seems kind of weird to me that there would be a difference between file-based configuration and db-based configuration. Do they behave differently at all?

And basically I can’t use the dashboard if I’m going to use file-based mode?

They don’t - the same config objects are used.

DB backed is for use with dashboard, That’s the purpose of the setting. The dashboard won’t manage synchronised file state in gateways, that would be reallly error prone once you have more than one.

Fair enough, thanks for the help!

I dropped the dashboard (and with it, mongo and tyk_pump) in the development environment and am just using the gateway.

Thanks for the info.

1 Like

You can still use the pump, just use one of the other back ends like elasticsearch and then you can still collect analytics and visualise them elsewhere (like grafana or something similar)

In fact if you drop pump you need to make sure to stop collecting data (enable_analytics=false) otherwise redis might blow up :slight_smile:

I think I’m having the same issue.
Creating API via dashboard did not work, so created api via command line. that worked.
but now Dashboard is not seeing the very same api :confused:

strange thing is, it does appear to use the shared/same db/locations as creating a duplicate-named api via command line (while one exists of the same name in dashboard) will not be allowed.

i just installed latest everything out of the box on centOs

Why is this issue spread across three topics?? It’s been answered elsewhere.

one issue rolled into another along the way. thats why. isues evolved.
FYI for anyone coming across, docker instance or RHEL/CentOs, for us, the reason why dashboard was not reflecting what the gateway was successfully configured with (api gateway configuration manually) is because gateway was not told about the existence of the tyk-dashboard.

use_db_app_configs”:true # needed to be set to true with the below stanza…
,
“db_app_conf_options”: {
“connection_string”: “http://127.0.0.1:3000”,
“node_is_segmented”: false,
“tags”: []
},

The gateway was configured in CE mode - this is headless, the community edition does not use the dashboard, since the dashboard is not open source, it often gets confused :slight_smile: