{"action":"created","issue":{"url":"https://api.github.com/repos/Mashape/kong/issues/725","labels_url":"https://api.github.com/repos/Mashape/kong/issues/725/labels{/name}","comments_url":"https://api.github.com/repos/Mashape/kong/issues/725/comments","events_url":"https://api.github.com/repos/Mashape/kong/issues/725/events","html_url":"https://github.com/Mashape/kong/issues/725","id":117422927,"number":725,"title":"Routes registered via API get bungled & dropped","user":{"login":"nricklin","id":5749532,"avatar_url":"https://avatars.githubusercontent.com/u/5749532?v=3","gravatar_id":"","url":"https://api.github.com/users/nricklin","html_url":"https://github.com/nricklin","followers_url":"https://api.github.com/users/nricklin/followers","following_url":"https://api.github.com/users/nricklin/following{/other_user}","gists_url":"https://api.github.com/users/nricklin/gists{/gist_id}","starred_url":"https://api.github.com/users/nricklin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nricklin/subscriptions","organizations_url":"https://api.github.com/users/nricklin/orgs","repos_url":"https://api.github.com/users/nricklin/repos","events_url":"https://api.github.com/users/nricklin/events{/privacy}","received_events_url":"https://api.github.com/users/nricklin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-11-17T18:49:48Z","updated_at":"2015-11-17T22:21:24Z","closed_at":null,"body":"I'm spinning up the official kong-proxy Amazon AMI and configuring it with userdata.\r\n\r\nMy userdata looks like this:\r\n```bash\r\n#!/bin/bash\r\nexec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1\r\nsed -i 's/Defaults    requiretty/#Defaults    requiretty/' /etc/sudoers\r\nsed -i -e \"/proxy_port/ s/8000/80/\" /etc/kong/kong.yml\r\nsed -i -e '/proxy_ssl_port/ s/8443/443/' /etc/kong/kong.yml\r\naws s3 cp s3://my-bucket/ssl_certs/mydomain.com/mydomain.com.cert /home/ec2-user/mydomain.com.cert\r\naws s3 cp s3://my-bucket/ssl_certs/mydomain.com/mydomain.com.key /home/ec2-user/mydomain.com.key\r\naws s3 cp s3://my-bucket/ssl_certs/mydomain.com/bundle.cert /home/ec2-user/bundle.cert\r\necho \"ssl_cert_path: /home/ec2-user/bundle.cert\" >> /etc/kong/kong.yml\r\necho \"ssl_key_path: /home/ec2-user/mydomain.key\" >> /etc/kong/kong.yml\r\nsudo service cassandra start\r\nsleep 60\r\nsudo -u root /usr/local/bin/kong restart\r\ncurl -i -X POST --url http://localhost:8001/apis/ --data 'strip_request_path=false' --data 'name=ac' --data 'upstream_url=XXXXX' --data 'request_path=/ac/v1'\r\ncurl -i -X POST --url http://localhost:8001/apis/ --data 'strip_request_path=false' --data 'name=df' --data 'upstream_url=XXXXX' --data 'request_path=/df/v1'\r\ncurl -i -X POST --url http://localhost:8001/apis/ --data 'strip_request_path=false' --data 'name=wf' --data 'upstream_url=XXXXX' --data 'request_path=/wf/v1'\r\n```\r\n\r\nI'm leaving out a lot of other stuff, like additional routes and certs and plugin enablement.\r\n\r\nThe corresponding output looks like this:\r\n```\r\ndownload: s3://my-bucket/ssl_certs/mydomain.com/mydomain.com.cert to home/ec2-user/mydomain.com.cert\r\ndownload: s3://my-bucket/ssl_certs/mydomain.com/mydomain.com.key to home/ec2-user/mydomain.com.key\r\ndownload: s3://my-bucket/ssl_certs/mydomain.com/bundle.cert to home/ec2-user/bundle.cert\r\nStarting Cassandra: OK\r\n[INFO] Using configuration: /etc/kong/kong.yml\r\n[INFO] Kong version.......0.5.2\r\n       Proxy HTTP port....80\r\n       Proxy HTTPS port...443\r\n       Admin API port.....8001\r\n       dnsmasq port.......8053\r\n       Database...........cassandra keepalive=60000 timeout=1000 contact_points=localhost:9042 keyspace=kong\r\n[INFO] Connecting to the database...\r\n[INFO] Database not initialized. Running migrations...\r\n[OK] core migrated up to: 2015-01-12-175310_skeleton\r\n[OK] core migrated up to: 2015-01-12-175310_init_schema\r\n[OK] jwt migrated up to: 2015-06-09-jwt-auth\r\n[OK] acl migrated up to: 2015-08-25-841841_init_acl\r\n[OK] oauth2 migrated up to: 2015-08-03-132400_init_oauth2\r\n[OK] oauth2 migrated up to: 2015-08-24-215800_cascade_delete_index\r\n[OK] key-auth migrated up to: 2015-07-31-172400_init_keyauth\r\n[OK] hmac-auth migrated up to: 2015-09-16-132400_init_hmacauth\r\n[OK] basic-auth migrated up to: 2015-08-03-132400_init_basicauth\r\n[OK] rate-limiting migrated up to: 2015-08-03-132400_init_ratelimiting\r\n[OK] response-ratelimiting migrated up to: 2015-08-21_init_response-rate-limiting\r\n[INFO] Auto-generating the default SSL certificate and key...\r\n[INFO] dnsmasq started (dnsmasq)\r\n[OK] Restarted\r\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\r\n                                 Dload  Upload   Total   Spent    Left  Speed\r\n100   321    0   207  100   114   1058    582 --:--:-- --:--:-- --:--:--  1061\r\nHTTP/1.1 201 Created\r\nDate: Tue, 17 Nov 2015 10:00:01 GMT\r\nContent-Type: application/json; charset=utf-8\r\nTransfer-Encoding: chunked\r\nConnection: keep-alive\r\nAccess-Control-Allow-Origin: *\r\nServer: kong/0.5.2\r\n\r\n{\"upstream_url\":\"XXXXX\",\"request_path\":\"\\/ac\\/v1\",\"id\":\"11dc4cc3-f7bb-43d2-c325-769687ce0882\",\"created_at\":1447754402000,\"strip_request_path\":false,\"name\":\"ac\"}\r\n{\"upstream_url\":\"XXXXX\",\"request_path\":\"\\/df\\/v1\",\"id\":\"80fa477f-e821-4d9f-cd6d-16c587174bdc\",\"created_at\":1447754402000,\"strip_request_path\":false,\"name\":\"df\"}\r\n{\"upstream_url\":\"XXXXX\",\"request_path\":\"\\/wf\\/v1\",\"id\":\"11dc4cc3-f7bb-43d2-c325-769687ce0882\",\"created_at\":1447754403000,\"strip_request_path\":false,\"name\":\"wf\"}\r\n```\r\n\r\nNote that I get the same ```id``` back for two different APIs.  \r\n\r\nIf I do a \r\n```bash\r\ncurl http://localhost:8001/apis/11dc4cc3-f7bb-43d2-c325-769687ce0882\r\n```\r\nit references the ```/wf/v1``` api.  \r\n\r\nIf I do a \r\n```bash\r\ncurl http://localhost:8001/apis/80fa477f-e821-4d9f-cd6d-16c587174bdc\r\n```\r\n\r\nit references another API, not the ```df/v1``` that it is supposed to.\r\n\r\nAs you can see, the APIs are \"bungled\".  I noticed this because the ```/df/v1``` route was not working, and did not exist.   \r\n\r\nNone of the REST api calls against kong failed."},"comment":{"url":"https://api.github.com/repos/Mashape/kong/issues/comments/157528957","html_url":"https://github.com/Mashape/kong/issues/725#issuecomment-157528957","issue_url":"https://api.github.com/repos/Mashape/kong/issues/725","id":157528957,"user":{"login":"thibaultCha","id":1125431,"avatar_url":"https://avatars.githubusercontent.com/u/1125431?v=3","gravatar_id":"","url":"https://api.github.com/users/thibaultCha","html_url":"https://github.com/thibaultCha","followers_url":"https://api.github.com/users/thibaultCha/followers","following_url":"https://api.github.com/users/thibaultCha/following{/other_user}","gists_url":"https://api.github.com/users/thibaultCha/gists{/gist_id}","starred_url":"https://api.github.com/users/thibaultCha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thibaultCha/subscriptions","organizations_url":"https://api.github.com/users/thibaultCha/orgs","repos_url":"https://api.github.com/users/thibaultCha/repos","events_url":"https://api.github.com/users/thibaultCha/events{/privacy}","received_events_url":"https://api.github.com/users/thibaultCha/received_events","type":"User","site_admin":false},"created_at":"2015-11-17T22:21:24Z","updated_at":"2015-11-17T22:21:24Z","body":"Don't think that helps, since the issue happens when the load is redirected to another worker, which is not necessarily due to a heavy load iirc."}}