After installation of TYk on rhel 7.1 and tyk-dashboard.service is not started

After running the tyk-dashboard.service and i have checked status of service shown below.

tyk-dashboard.service - Tyk API Dashboard
Loaded: loaded (/usr/lib/systemd/system/tyk-dashboard.service; disabled)
Active: failed (Result: start-limit) since Thu 2017-06-22 01:37:11 EDT; 2min 51s ago
Process: 2166 ExecStart=/opt/tyk-dashboard//tyk-analytics --conf=/opt/tyk-dashboard/tyk_analytics.conf (code=exited, status=2)
Main PID: 2166 (code=exited, status=2)
CGroup: /system.slice/tyk-dashboard.service

Jun 22 01:37:11 admin.server.in tyk-analytics[2166]: main.main()
Jun 22 01:37:11 admin.server.in tyk-analytics[2166]: /src/github.com/TykTechnologies/tyk-analytics/Main.go:986 +0xbd4
Jun 22 01:37:11 admin.server.in systemd[1]: tyk-dashboard.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Jun 22 01:37:11 admin.server.in systemd[1]: Unit tyk-dashboard.service entered failed state.
Jun 22 01:37:11 admin.server.in systemd[1]: tyk-dashboard.service holdoff time over, scheduling restart.
Jun 22 01:37:11 admin.server.in systemd[1]: Stopping Tyk API Dashboard…
Jun 22 01:37:11 admin.server.in systemd[1]: Starting Tyk API Dashboard…
Jun 22 01:37:11 admin.server.in systemd[1]: tyk-dashboard.service start request repeated too quickly, refusing to start.
Jun 22 01:37:11 admin.server.in systemd[1]: Failed to start Tyk API Dashboard.
Jun 22 01:37:11 admin.server.in systemd[1]: Unit tyk-dashboard.service entered failed state.

Can you share the actual logs from the dashboard? It looks like a panic.

Hi Martin,

[root@admin ~]# systemctl restart tyk-gateway.service
[root@admin ~]# journalctl -xn
– Logs begin at Thu 2017-06-22 02:17:03 EDT, end at Thu 2017-06-22 02:26:31 EDT. –
Jun 22 02:26:26 admin.server.in tyk-analytics[480]: time=“Jun 22 02:26:26” level=info msg=“Creating new Redis connection pool”
Jun 22 02:26:26 admin.server.in tyk-analytics[480]: time=“Jun 22 02:26:26” level=error msg=“Redis disconnected or error received, attempting to
Jun 22 02:26:26 admin.server.in tyk-analytics[480]: time=“Jun 22 02:26:26” level=error msg=“Redis disconnected or error received, attempting to
Jun 22 02:26:26 admin.server.in tyk-analytics[480]: time=“Jun 22 02:26:26” level=error msg=“Connection to Redis failed, reconnect in 10s” err=”
Jun 22 02:26:27 admin.server.in tyk-analytics[480]: time=“Jun 22 02:26:27” level=error msg=“Could not send notification”
Jun 22 02:26:27 admin.server.in tyk-analytics[480]: time=“Jun 22 02:26:27” level=error msg=”"
Jun 22 02:26:29 admin.server.in tyk-analytics[480]: time=“Jun 22 02:26:29” level=error msg=“Could not send notification”
Jun 22 02:26:29 admin.server.in tyk-analytics[480]: time=“Jun 22 02:26:29” level=error msg=""
Jun 22 02:26:31 admin.server.in tyk-analytics[480]: time=“Jun 22 02:26:31” level=error msg=“Could not send notification”
Jun 22 02:26:31 admin.server.in tyk-analytics[480]: time=“Jun 22 02:26:31” level=error msg=""

Hi Martin,

It also shown below log on tyk-gateway.stderr file .

[root@admin log]# tail -f tyk-gateway.stderr
panic(0xcb0460, 0xc4203f3090)
/usr/local/go/src/runtime/panic.go:500 +0x1a1
html/template.Must(0x0, 0x12ab5e0, 0xc4203f3090, 0x12ab5e0)
/usr/local/go/src/html/template/template.go:340 +0x66
main.setupGlobals()
/src/github.com/TykTechnologies/tyk/main.go:139 +0x3f0
main.initialiseSystem(0xc420402390)
/src/github.com/TykTechnologies/tyk/main.go:912 +0x6d8
main.main()
/src/github.com/TykTechnologies/tyk/main.go:1096 +0x112

Ok, looks like you are missing some templates - or you haven’t set the home set correctly in the tyk_analytics.conf

Where is the dashboard installed?

Can you share your tyk_analytics.conf?

Thanks,
Martin

Ok i am not able to upload text file ,So i have mentioned on body.

{
“listen_port”: 3000,
“tyk_api_config”: {
“Host”: “http://localhost”,
“Port”: “8080”,
“Secret”: “352d20ee67be67f6340b4c0605b044b7”
},
“mongo_url”: “mongodb://127.0.0.1/tyk_analytics”,
“mongo_use_ssl”: false,
“mongo_ssl_insecure_skip_verify”: false,
“page_size”: 10,
“admin_secret”: “12345”,
“shared_node_secret”: “352d20ee67be67f6340b4c0605b044b7”,
“redis_port”: 6379,
“redis_host”: “localhost”,
“redis_password”: “”,
“enable_cluster”: false,
“force_api_defaults”: false,
“notify_on_change”: true,
“license_key”: “Here MY license Key”,
“redis_database”: 0,
“redis_hosts”: null,
“hash_keys”: true,
“email_backend”: {
“enable_email_notifications”: false,
“code”: “”,
“settings”: null,
“default_from_email”: “”,
“default_from_name”: “”,
“dashboard_hostname”: “”
},
“hide_listen_path”: false,
“sentry_code”: “”,
“sentry_js_code”: “”,
“use_sentry”: false,
“enable_master_keys”: false,
“enable_duplicate_slugs”: true,
“show_org_id”: true,
“host_config”: {
“enable_host_names”: true,
“disable_org_slug_prefix”: true,
“hostname”: “admin.server.in”,
“override_hostname”: “admin.server.in”,
“portal_domains”: {},
“portal_root_path”: “/portal”,
“generate_secure_paths”: false,
“secure_cookies”: false,
“use_strict_hostmatch”: false
},
“http_server_options”: {
“use_ssl”: false,
“certificates”: [
{
“domain_name”: “”,
“cert_file”: “”,
“key_file”: “”
}
],
“min_version”: 0
},
“security”: {
“login_failure_username_limit”: 0,
“login_failure_ip_limit”: 0,
“login_failure_expiration”: 0,
“audit_log_path”: “”
},
“ui”: {
“languages”: {
“Chinese”: “cn”,
“English”: “en”,
“Korean”: “ko”
},
“hide_help”: false,
“default_lang”: “en”,
“login_page”: {},
“nav”: {},
“uptime”: {},
“portal_section”: null,
“designer”: {},
“dont_show_admin_sockets”: false,
“dont_allow_license_management”: false,
“dont_allow_license_management_view”: false
},
“home_dir”: “/opt/tyk-dashboard”,
“identity_broker”: {
“enabled”: false,
“host”: {
“connection_string”: “http://localhost:3010”,
“secret”: “934893845123491238192381486djfhr87234827348”
}
},
“tagging_options”: {
“tag_all_apis_by_org”: false
},
“use_sharded_analytics”: false,
“enable_aggregate_lookups”: true,
“enable_analytics_cache”: false,
“aggregate_lookup_cutoff”: “01/07/2016”,
“maintenance_mode”: false,
“allow_explicit_policy_id”: false,
“private_key_path”: “”,
“node_schema_path”: “”,
“oauth_redirect_uri_separator”: “;”,
“statsd_connection_string”: “”,
“statsd_prefix”: “”,
“disable_parallel_sessions”: false,
“dashboard_session_lifetime”: 0
}

Is this where the gateway is installed?

Yes exactly home dir /opt/tyk-dashboard

I have three dir on home dir /opt

tyk-dashboard
tyk-gateway
tyk-pump

And what version are you running of the dashboard?

I am using tyk-dashboard-1.3.6-1.i386.rpm

Panic happens on the Gateway level, when it tries to load error templates. So you need to check your tyk.conf template_path variable. Its content should look like https://github.com/TykTechnologies/tyk/tree/release-2.3/templates

Please explain what can i do from this link. Please explain

I have checked templates . There are four files
breaker_webhook.json
default_webhook.json
error.json
monitor_template.json

Any solution for these issue which i have shared .

Can yu share your tyk.conf file?

{
“listen_port”: 3000,
“tyk_api_config”: {
“Host”: “http://localhost”,
“Port”: “8080”,
“Secret”: “352d20ee67be67f6340b4c0605b044b7”
},
“mongo_url”: “mongodb://127.0.0.1/tyk_analytics”,
“mongo_use_ssl”: false,
“mongo_ssl_insecure_skip_verify”: false,
“page_size”: 10,
“admin_secret”: “12345”,
“shared_node_secret”: “352d20ee67be67f6340b4c0605b044b7”,
“redis_port”: 6379,
“redis_host”: “localhost”,
“redis_password”: “”,
“enable_cluster”: false,
“force_api_defaults”: false,
“notify_on_change”: true,
“license_key”: “Here MY license Key”,
“redis_database”: 0,
“redis_hosts”: null,
“hash_keys”: true,
“email_backend”: {
“enable_email_notifications”: false,
“code”: “”,
“settings”: null,
“default_from_email”: “”,
“default_from_name”: “”,
“dashboard_hostname”: “”
},
“hide_listen_path”: false,
“sentry_code”: “”,
“sentry_js_code”: “”,
“use_sentry”: false,
“enable_master_keys”: false,
“enable_duplicate_slugs”: true,
“show_org_id”: true,
“host_config”: {
“enable_host_names”: true,
“disable_org_slug_prefix”: true,
“hostname”: “admin.server.in”,
“override_hostname”: “admin.server.in”,
“portal_domains”: {},
“portal_root_path”: “/portal”,
“generate_secure_paths”: false,
“secure_cookies”: false,
“use_strict_hostmatch”: false
},
“http_server_options”: {
“use_ssl”: false,
“certificates”: [
{
“domain_name”: “”,
“cert_file”: “”,
“key_file”: “”
}
],
“min_version”: 0
},
“security”: {
“login_failure_username_limit”: 0,
“login_failure_ip_limit”: 0,
“login_failure_expiration”: 0,
“audit_log_path”: “”
},
“ui”: {
“languages”: {
“Chinese”: “cn”,
“English”: “en”,
“Korean”: “ko”
},
“hide_help”: false,
“default_lang”: “en”,
“login_page”: {},
“nav”: {},
“uptime”: {},
“portal_section”: null,
“designer”: {},
“dont_show_admin_sockets”: false,
“dont_allow_license_management”: false,
“dont_allow_license_management_view”: false
},
“home_dir”: “/opt/tyk-dashboard”,
“identity_broker”: {
“enabled”: false,
“host”: {
“connection_string”: “http://localhost:3010”,
“secret”: “934893845123491238192381486djfhr87234827348”
}
},
“tagging_options”: {
“tag_all_apis_by_org”: false
},
“use_sharded_analytics”: false,
“enable_aggregate_lookups”: true,
“enable_analytics_cache”: false,
“aggregate_lookup_cutoff”: “01/07/2016”,
“maintenance_mode”: false,
“allow_explicit_policy_id”: false,
“private_key_path”: “”,
“node_schema_path”: “”,
“oauth_redirect_uri_separator”: “;”,
“statsd_connection_string”: “”,
“statsd_prefix”: “”,
“disable_parallel_sessions”: false,
“dashboard_session_lifetime”: 0
}

You shared Dashboard configuration file tyk_analytics.conf, but instead we need to check tyk.conf of the Gateway (which is actually panic).

Thank you!

Hi leon

My tyk.conf file is mentioned below.

{
“listen_address”: “”,
“listen_port”: 8080,
“secret”: “352d20ee67be67f6340b4c0605b044b7”,
“template_path”: “/etc/tyk/templates”,
“tyk_js_path”: “/etc/tyk/js/tyk.js”,
“use_db_app_configs”: false,
“app_path”: “/etc/tyk/apps”,
“middleware_path”: “/etc/tyk/middleware”,
“storage”: {
“type”: “redis”,
“host”: “localhost”,
“port”: 6379,
“username”: “”,
“password”: “”,
“database”: 0,
“optimisation_max_idle”: 500
},
“enable_analytics”: false,
“analytics_config”: {
“type”: “csv”,
“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,
“allow_master_keys”: false,
“policies”: {
“policy_source”: “mongo”,
“policy_record_name”: “tyk_policies”
},
“hash_keys”: true,
“suppress_redis_signal_reload”: false
}

Hi leon and martin can you give any solution as soon as possible.