Failed to register node: Authorization Failed

Hi all,

I am doing a fresh installation of Tyk on premise, but my Tyk-gateway seems to be having problems registering with Tyk-dashboard. Below are the logs I managed to capture:

May 30 09:18:23 APIManagement tyk[2700]: time=“May 30 09:18:23” level=error msg=“Failed to register node, retrying in 5s”
May 30 09:18:23 APIManagement tyk[2700]: time=“May 30 09:18:23” level=error msg=" --> Response was: {“Status”:“Error”,“Message”:“Authorization failed (Secret missing)”,“Meta”:null}\n"
^XMay 30 09:18:28 APIManagement tyk[2700]: time=“May 30 09:18:28” level=error msg=“Failed to register node, retrying in 5s”
May 30 09:18:28 APIManagement tyk[2700]: time=“May 30 09:18:28” level=error msg=" --> Response was: {“Status”:“Error”,“Message”:“Authorization failed (Secret missing)”,“Meta”:null}\n"

I have made sure of these conditions:

  1. A valid Tyk-dashboard license entered in tyk_dashboard.conf
  2. secret in tyk-gateway/tyk.conf
  3. shared_node_secret in tyk-dashboard/tyk_dashboard.conf is the same as above

Can anyone help what other things I need to configure? Thanks!

Hi, can you share your full tyk.conf and tyk_analytics.conf?

Yes, sure. I cannot attach the files here so I’ll just copy and paste the contents below:

tyk.conf:
{
“listen_port”: 8080,
“secret”: “352d20ee67be67f6340b4c0605b044b7”,
“template_path”: “/opt/tyk-gateway/templates”,
“tyk_js_path”: “/opt/tyk-gateway/js/tyk.js”,
“use_db_app_configs”: true,
“app_path”: “/opt/tyk-gateway/apps”,
“middleware_path”: “/opt/tyk-gateway/middleware”,
“storage”: {
“type”: “redis”,
“host”: “10.130.59.12”,
“port”: 6379,
“username”: “”,
“password”: “”,
“database”: 0,
“optimisation_max_idle”: 2000,
“optimisation_max_active”: 4000
},
“enable_analytics”: true,
“analytics_config”: {
“type”: “csv”,
“pool_size”: 100,
“csv_dir”: “/tmp”,
“mongo_url”: “”,
“mongo_db_name”: “”,
“mongo_collection”: “”,
“purge_delay”: -1,
“ignored_ips”: [],
“normalise_urls”: {
“enabled”: true,
“normalise_uuids”: true,
“normalise_numbers”: true,
“custom_patterns”: []
}
},
“health_check”: {
“enable_health_checks”: false,
“health_check_value_timeouts”: 60
},
“optimisations_use_async_session_write”: true,
“allow_master_keys”: false,
“policies”: {
“policy_source”: “file”,
“policy_record_name”: “policies”
},
“hash_keys”: true,
“suppress_redis_signal_reload”: false,
“close_connections”: true,
“enable_non_transactional_rate_limiter”: true,
“enable_sentinel_rate_limiter”: false,
“local_session_cache”: {
“disable_cached_session_state”: false
},
“uptime_tests”: {
“disable”: false,
“config”: {
“enable_uptime_analytics”: false,
“failure_trigger_sample_size”: 2,
“time_wait”: 10,
“checker_pool_size”: 50
}
},
“http_server_options”: {
“enable_websockets”: true
},
“hostname”: “”,
“enable_custom_domains”: true,
“enable_jsvm”: true,
“oauth_redirect_uri_separator”: “;”,
“coprocess_options”: {
“enable_coprocess”: false,
“coprocess_grpc_server”: “”
},
“pid_file_location”: “./tyk-gateway.pid”,
“allow_insecure_configs”: true,
“public_key_path”: “”,
“close_idle_connections”: false,
“allow_remote_config”: false,
“enable_bundle_downloader”: true,
“bundle_base_url”: “”,
“global_session_lifetime”: 100,
“force_global_session_lifetime”: false,
“max_idle_connections_per_host”: 100
}

========================================================================

tyk_analytics.conf
{
“listen_port”: 3000,
“tyk_api_config”: {
“Host”: “http://localhost”,
“Port”: “8080”,
“Secret”: “352d20ee67be67f6340b4c0605b044b7”
},
“mongo_url”: “mongodb://10.130.59.12/tyk_analytics”,
“page_size”: 10,
“admin_secret”: “12345”,
“shared_node_secret”: “352d20ee67be67f6340b4c0605b044b7”,
“redis_port”: 6379,
“redis_host”: “10.130.59.12”,
“redis_password”: “”,
“enable_cluster”: false,
“force_api_defaults”: false,
“notify_on_change”: true,
“license_key”: “<license_key_here>”,
“redis_database”: 0,
“redis_hosts”: null,
“hash_keys”: true,
“email_backend”: {
“enable_email_notifications”: false,
“code”: “”,
“settings”: null,
“default_from_email”: “”,
“default_from_name”: “”
},
“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”: “apimanagement.teammalaysia.tmrnd.com.my”,
“override_hostname”: “api.teammalaysia.tmrnd.com.my”,
“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
}

Thank you!

Found it!

In tyk-gateway/tyk.conf

“node_secret”: “352d20ee67be67f6340b4c0605b044b7”,

was missing. I added this line to the config file and the gateway was able to register to tyk-dashboard.

Now I am not sure if the line was missing from the beginning or I accidentally deleted it, but I am pretty sure I didn’t touch the config file after installing Tyk. To be tested on a fresh install again.

Thanks everyone!

1 Like