404 not found or Rate limit exceeded

Hi all,

i’m setting up Tyk (on premise) with docker-compose installation and I’m getting some errors that can’t let me advance in my development.

First of all, I had to remap tyk_gateway listening ports to 81 and 8081 due to been already binded.

docker-compose.yml
tyk_gateway: image: tykio/tyk-gateway:latest ports: - "81:8080" - "8081:8080"

Then, I run setup.sh like this
./setup.sh 127.0.0.1 test-tyk.com

having modified /etc/hosts properly

After that, I follow setting-up instructions (api, key, policies, catalogue, portal) where Target URL is http://127.0.0.1:8080/ (my api)

The only thing I had to change in ‘common’ flow is that, when I want to navigate to portal, the URL has to be http://test-tyk.com:81/portal/ (remember I changed the port mapping)

Ok, let’s test it …
I have an endpoint in my API - > /me
When I test it in Postman it always response with 404 Not found
I tested
http://test-tyk.com:81/<listen-path>/me http://test-tyk.com:81/<listen-path>/ http://test-tyk.com:81/<listen-path>/oauth/confirm_access (another endpoint) http://test-tyk.com:81/<listen-path>/jksdfkjfdjhkddsj (non-existing endpoint
I’m testing with different authentication methods and gatewat seems to be ok cause it throws error responses when putting bad credentials or bad requests.

Looking on docker-compose logs, all it says is

tyk_pump_1 | time="Oct 26 09:23:38" level=info msg="Purging 1 records"

Just in case you’re thinking my API could be down … not. When I call it directly in Postman it responses correctly.

What I’m doing wrong?

Thanks in advance,
Carlos

Hi, is http://test-tyk.com:81 your portal URL?

HI,
I can access to Tyk Developer Portal by http://test-tyk.com:81/portal/

Great, have you tried to access your API through port 8081?

http://test-tyk.com:8081/<listen-path>/me`

Yes, with same result.
I tested replacing test-tyk.com with 127.0.0.1 and localhost and same problem …
I don’t know which info could I add to identify the problem.

I saw that tyk.conf and tyk_analytics.conf have configuration params pointing to 8080 port.
I changed it but the result is the same.

Can you share your tyk.conf and tyk_analytics.conf?

Now they are by default
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 }

tyk_analytics.conf
{ "listen_port": 3000, "tyk_api_config": { "Host": "http://tyk_gateway", "Port": "8080", "Secret": "352d20ee67be67f6340b4c0605b044b7" }, "mongo_url": "mongodb://mongo:27017/tyk_analytics", "page_size": 10, "admin_secret": "12345", "shared_node_secret": "352d20ee67be67f6340b4c0605b044b7", "redis_port": 6379, "redis_host": "redis", "redis_password": "", "enable_cluster": false, "force_api_defaults": false, "notify_on_change": true, "license_key": "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": "" }, "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": false, "disable_org_slug_prefix": true, "hostname": "", "override_hostname": "www.tyk-portal-test.com", "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": { "languages": null, "hide_help": false, "default_lang": "", "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": "", "secret": "" } }, "tagging_options": { "tag_all_apis_by_org": false }, "use_sharded_analytics": false, "enable_aggregate_lookups": false, "aggregate_lookup_cutoff": "", "maintenance_mode": false, "allow_explicit_policy_id": false }

I’ve solved it. The target URL was wrong. The IP can’t be my localhost ip, it must be my public IP

1 Like