Auth Token Authorization is getting failed

  1. API Test: This one I think I am able to get a response.
  2. API Dashboard: This is not working even after publishing the catalogue and its not loading at all.

Please help

You mean the developer portal?

The dashboard is the part that you log in to add new APis to manage, if yu got the test API running, then this is working.

Yes the developer portal where we used to set the domain. To be precise, it’s located in top right.

Apologies that I misplaced developer with dashboard. I think my first ask was right. Developer portal is not working

Right, so the developer portal does not automatically publish all the API’s you put into Tyk, it only publishes APIs that you tell it to.

Now to publish an API, first make sure you have a policy set up to grant access to the API, then go to the portal -> catalogue section and add a new API

Fill in the details of what you want to publish, make sure hat the catalogue entry is live and then publish it.

Once you have published a catalogue entry, the API will be visible in the portal.

Sure Martin. I shall try the suggested steps and update asap.

There is a tutorial here:

https://tyk.io/docs/tyk-dashboard-v1-0/tutorials/set-up-your-portal/

Hi Martin,

I have used the tutorial to create the same but it seems its not getting loaded yet.

Is there any significant purpose for CNAME while setting up our Domain before visualizing in portal.

Yes, you need to set a hostname for your portal. If you are just trying things out you can do this with a hosts hack (add entries manually to hosts file).

I have tried giving some random name like project_name.tyk.com.

Would that be the reason I am not getting anything in portal? In that case, how can i update the CNAME back to hostname?

Can you visit the portal and does it render a welcome screen?

No again the page is not loading…

“host_config”: {
“enable_host_names”: true,
“disable_org_slug_prefix”: true,
“hostname”: “X.X.X.X”,
“override_hostname”: “X”,
“portal_domains”: {},
“portal_root_path”: “/portal”,
“generate_secure_paths”: false
},

This is my analytics config… But I have randomly given the domain name as projectname.tyk.com.

Is this wrong ?

Martin,

Any luck on this ?

No not really - did yu set up your hosts file? Did you follow the portal tutorial? I have a feeling you haven’t

Martin,

I badly needs your help. After i edited the hosts file, not sure what happened… The whole tyk instance has gone down. is there anyway to uninstall tyk and reinstall from the first step.

Now, I have created the new setup. but here I am getting the error when i am trying to create a key like below.

Failed to save new session object to Tyk: Failed to unmarshal error: invalid character ‘p’ after top-level value

Please find the below conf files. Let me know if any amendments needed.

tyk.conf

{
“listen_port”: 8080,
“node_secret”: “XXXX”,
“secret”: “XXXXX”,
“template_path”: “/opt/tyk-gateway/templates”,
“tyk_js_path”: “/opt/tyk-gateway/js/tyk.js”,
“use_db_app_configs”: true,

tyk_analytics.conf:

{
“listen_port”: 3000,
“tyk_api_config”: {
“Host”: “http://localhost”,
“Port”: “8080”,
“Secret”: “XXXX”
},

Why are your conf files so short? Did you not run the setup scripts?

No i have not pasted the complete file. Is there anyway to completely uninstall the things and reinstall ?

If you want me to give you the complete file also, i shall pass.

tyk_analytics.conf
{
“listen_port”: 3000,
“tyk_api_config”: {
“Host”: “http://localhost”,
“Port”: “8080”,
“Secret”: “XXXXXX”
},
“mongo_url”: “mongodb://127.0.0.1/tyk_analytics”,
“page_size”: 10,
“admin_secret”: “12345”,
“shared_node_secret”: “XXXX”,
“redis_port”: 6379,
“redis_host”: “localhost”,
“redis_password”: “”,
“enable_cluster”: false,
“force_api_defaults”: false,
“notify_on_change”: true,
“license_key”: “XXXXXXX”,
“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”: “XX”,
“override_hostname”: “XX”,
“portal_domains”: {},
“portal_root_path”: “/portal”,
“generate_secure_paths”: false
},
“http_server_options”: {
“use_ssl”: false,
“certificates”: [
{
“domain_name”: “”,
“cert_file”: “”,
“key_file”: “”
}
],
“min_version”: 0
},
“ui”: {
“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”: “XX”
}
},
“tagging_options”: {
“tag_all_apis_by_org”: false
},
“use_sharded_analytics”: false,
“maintenance_mode”: false,
“allow_explicit_policy_id”: false
}


tyk.conf
{
“listen_port”: 8080,
“node_secret”: “XX”,
“secret”: “XX”,
“template_path”: “/opt/tyk-gateway/templates”,
“tyk_js_path”: “/opt/tyk-gateway/js/tyk.js”,
“use_db_app_configs”: true,
“db_app_conf_options”: {
“connection_string”: “http://X.X.X.X:3000”,
“node_is_segmented”: false,
“tags”: []
},
“app_path”: “/opt/tyk-gateway/apps”,
“middleware_path”: “/opt/tyk-gateway/middleware”,
“storage”: {
“type”: “redis”,
“host”: “localhost”,
“port”: 6379,
“username”: “”,
“password”: “”,
“database”: 0,
“optimisation_max_idle”: 500,
“optimisation_max_active”: 800
},
“enable_analytics”: true,
“analytics_config”: {
“type”: “mongo”,
“csv_dir”: “/tmp”,
“mongo_url”: “”,
“mongo_db_name”: “”,
“mongo_collection”: “”,
“purge_delay”: 100,
“ignored_ips”: [],
“enable_detailed_recording”: true,
“enable_geo_ip”: false,
“geo_ip_db_path”: “”
},
“health_check”: {
“enable_health_checks”: true,
“health_check_value_timeouts”: 60
},
“optimisations_use_async_session_write”: true,
“allow_master_keys”: false,
“policies”: {
“policy_source”: “service”,
“policy_connection_string”: “http://X.X.X.X:3000”,
“policy_record_name”: “tyk_policies”
},
“hash_keys”: true,
“suppress_redis_signal_reload”: false,
“close_connections”: true,
“local_session_cache”: {
“disable_cached_session_state”: true
},
“uptime_tests”: {
“disable”: false,
“config”: {
“enable_uptime_analytics”: true,
“failure_trigger_sample_size”: 3,
“time_wait”: 300,
“checker_pool_size”: 50
}
},
“hostname”: “X.X.X.X”,
“enable_custom_domains”: true,
“enable_jsvm”: true
}

To uninstall:

Log out of dashboard
Remove mogodb
Remove Redis
Then apt-get remove tyk-gateway tyk-dashboard tyk-pump

That should clear it all and all the data

You can then re-install and follow the PRO install tutorial, API tutorial and portal tutorial

Martin,

Even after I reinstall the tyk , I am getting the same below same error.

Failed to save new session object to Tyk: Failed to unmarshal error: invalid character ‘p’ after top-level value

Hi Raja,

Can you share your log files for both gateway and dashboard?

M.

tail tyk-dashboard.log
[Jun 13 09:39:32] INFO Listening on port: 3000
[Jun 13 09:39:32] INFO Loading routes…
[Jun 13 09:39:32] INFO Registering nodes…
[Jun 13 09:39:32] INFO Creating new Redis connection pool
[Jun 13 09:39:32] INFO ui-notifications: Socket server started
[Jun 13 09:39:32] INFO Adding available nodes…
[Jun 13 09:39:32] INFO --> Standard listener (http)
[Jun 13 09:40:20] ERROR Failed to unmarshal error: invalid character ‘p’ after top-level value
[Jun 13 09:40:20] WARN Failed create:Failed to unmarshal error: invalid character ‘p’ after top-level value
[Jun 13 09:40:20] ERROR Failed to save new session object to Tyk: Failed to unmarshal error: invalid character ‘p’ after top-level value

tail tyk-gateway.log
[Jun 13 09:46:39] INFO main: Detected 0 APIs
[Jun 13 09:46:39] WARN main: No API Definitions found, not reloading
[Jun 13 09:46:48] INFO pub-sub: Reloading endpoints
[Jun 13 09:46:48] INFO Initiating reload
[Jun 13 09:46:58] INFO main: Detected 1 APIs
[Jun 13 09:46:58] INFO main: --> Loading API: Test API
[Jun 13 09:46:58] INFO main: ----> Tracking: (no host)
[Jun 13 09:46:58] INFO main: ----> Checking security policy: Token
[Jun 13 09:46:58] INFO host-check-mgr: Loading uptime tests…
[Jun 13 09:46:58] INFO main: API reload complete