{"action":"created","issue":{"url":"https://api.github.com/repos/rackerlabs/otter/issues/1119","labels_url":"https://api.github.com/repos/rackerlabs/otter/issues/1119/labels{/name}","comments_url":"https://api.github.com/repos/rackerlabs/otter/issues/1119/comments","events_url":"https://api.github.com/repos/rackerlabs/otter/issues/1119/events","html_url":"https://github.com/rackerlabs/otter/issues/1119","id":58407599,"number":1119,"title":"Active server links JSON not written to DB","user":{"login":"cyli","id":223200,"avatar_url":"https://avatars.githubusercontent.com/u/223200?v=3","gravatar_id":"","url":"https://api.github.com/users/cyli","html_url":"https://github.com/cyli","followers_url":"https://api.github.com/users/cyli/followers","following_url":"https://api.github.com/users/cyli/following{/other_user}","gists_url":"https://api.github.com/users/cyli/gists{/gist_id}","starred_url":"https://api.github.com/users/cyli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyli/subscriptions","organizations_url":"https://api.github.com/users/cyli/orgs","repos_url":"https://api.github.com/users/cyli/repos","events_url":"https://api.github.com/users/cyli/events{/privacy}","received_events_url":"https://api.github.com/users/cyli/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rackerlabs/otter/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/rackerlabs/otter/milestones/4","labels_url":"https://api.github.com/repos/rackerlabs/otter/milestones/4/labels","id":972857,"number":4,"title":"Convergence: Servers","description":"Get to the point that we can enable convergence on servers for some tenants in production.\r\n\r\nNo CLB support is necessary. No RCv3 support is necessary. However, any core reliability/operational features (such as support for restarting in the middle of a convergence cycle or having useful logging) should be part of this milestone.","creator":{"login":"radix","id":227068,"avatar_url":"https://avatars.githubusercontent.com/u/227068?v=3","gravatar_id":"","url":"https://api.github.com/users/radix","html_url":"https://github.com/radix","followers_url":"https://api.github.com/users/radix/followers","following_url":"https://api.github.com/users/radix/following{/other_user}","gists_url":"https://api.github.com/users/radix/gists{/gist_id}","starred_url":"https://api.github.com/users/radix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radix/subscriptions","organizations_url":"https://api.github.com/users/radix/orgs","repos_url":"https://api.github.com/users/radix/repos","events_url":"https://api.github.com/users/radix/events{/privacy}","received_events_url":"https://api.github.com/users/radix/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":1,"state":"open","created_at":"2015-02-10T00:36:04Z","updated_at":"2015-02-20T20:41:46Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2015-02-20T20:41:46Z","updated_at":"2015-02-20T20:43:23Z","closed_at":null,"body":"Listing groups for a convergence tenant results in the following traceback:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"/opt/otter/.ve/local/lib/python2.7/site-packages/twisted/internet/defer.py\", line 491, in _startRunCallbacks\r\n    self._runCal\r\nlbacks()\r\n  File \"/opt/otter/.ve/local/lib/python2.7/site-packages/twisted/internet/defer.py\", line 578, in _runCallbacks\r\n    current.result = callback(current.result, *args, **kw)\r\n  File \"/opt/otter/.ve/local\r\n/lib/python2.7/site-packages/twisted/internet/defer.py\", line 383, in callback\r\n    self._startRunCallbacks(result)\r\n  File \"/opt/otter/.ve/local/lib/python2.7/site-packages/twisted/internet/defer.py\", line 491,\r\n in _startRunCallbacks\r\n    self._runCallbacks()\r\n--- <exception caught here> ---\r\n  File \"/opt/otter/.ve/local/lib/python2.7/site-packages/twisted/internet/defer.py\", line 578, in _runCallbacks\r\n    current.resu\r\nlt = callback(current.result, *args, **kw)\r\n  File \"/opt/otter/otter/rest/groups.py\", line 181, in format_list\r\n    } for state in group_states]\r\n  File \"/opt/otter/otter/rest/groups.py\", line 74, in format_sta\r\nte_dict\r\n    } for key, server_blob in state.active.iteritems()\r\nexceptions.KeyError: 'links'\r\n```\r\n\r\nBecause in the DB, an example of the data stored in active servers looks like:\r\n\r\n`{\"test-server2137886081-id-2137886081\": {\"id\": \"test-server2137886081-id-2137886081\"}, \"test-server2913956880-id-2913956880\": {\"id\": \"test-server2913956880-id-2913956880\"}}`\r\n\r\n\r\nThe worker stores a lot more info, but the only things autoscale presents to the user are the `id` and the `links`, so just making sure the links are available will probably solve this bug.\r\n\r\nCan be solved probably as part of #1106."},"comment":{"url":"https://api.github.com/repos/rackerlabs/otter/issues/comments/75315733","html_url":"https://github.com/rackerlabs/otter/issues/1119#issuecomment-75315733","issue_url":"https://api.github.com/repos/rackerlabs/otter/issues/1119","id":75315733,"user":{"login":"cyli","id":223200,"avatar_url":"https://avatars.githubusercontent.com/u/223200?v=3","gravatar_id":"","url":"https://api.github.com/users/cyli","html_url":"https://github.com/cyli","followers_url":"https://api.github.com/users/cyli/followers","following_url":"https://api.github.com/users/cyli/following{/other_user}","gists_url":"https://api.github.com/users/cyli/gists{/gist_id}","starred_url":"https://api.github.com/users/cyli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyli/subscriptions","organizations_url":"https://api.github.com/users/cyli/orgs","repos_url":"https://api.github.com/users/cyli/repos","events_url":"https://api.github.com/users/cyli/events{/privacy}","received_events_url":"https://api.github.com/users/cyli/received_events","type":"User","site_admin":false},"created_at":"2015-02-20T20:43:23Z","updated_at":"2015-02-20T20:43:23Z","body":"For reference, a DB entry for active servers produced by the worker look like:\r\n\r\n`{\"test-server8057297169-id-8057297169\": {\"id\": \"test-server8057297169-id-8057297169\", \"links\": [{\"href\": \"http://localhost:8900/mimicking/NovaApi-3bab1e/ORD/v2/111111/servers/test-server8057297169-id-8057297169\", \"rel\": \"self\"}, {\"href\": \"http://localhost:8900/mimicking/NovaApi-3bab1e/ORD/111111/servers/test-server8057297169-id-8057297169\", \"rel\": \"bookmark\"}], \"name\": \"test_sg_bhv_srv424679-as5fde94d9\", \"lb_info\": [], \"created\": \"2015-02-20T20:40:14.790059Z\"}, \"test-server5196953637-id-5196953637\": {\"name\": \"test_sg_bhv_srv424679-as9148a19f\", \"links\": [{\"href\": \"http://localhost:8900/mimicking/NovaApi-3bab1e/ORD/v2/111111/servers/test-server5196953637-id-5196953637\", \"rel\": \"self\"}, {\"href\": \"http://localhost:8900/mimicking/NovaApi-3bab1e/ORD/111111/servers/test-server5196953637-id-5196953637\", \"rel\": \"bookmark\"}], \"id\": \"test-server5196953637-id-5196953637\", \"lb_info\": [], \"created\": \"2015-02-20T20:40:14.846512Z\"}, \"_ver\": 1, \"test-server5785648061-id-5785648061\": {\"lb_info\": [], \"created\": \"2015-02-20T20:40:14.856580Z\", \"id\": \"test-server5785648061-id-5785648061\", \"links\": [{\"href\": \"http://localhost:8900/mimicking/NovaApi-3bab1e/ORD/v2/111111/servers/test-server5785648061-id-5785648061\", \"rel\": \"self\"}, {\"href\": \"http://localhost:8900/mimicking/NovaApi-3bab1e/ORD/111111/servers/test-server5785648061-id-5785648061\", \"rel\": \"bookmark\"}], \"name\": \"test_sg_bhv_srv424679-as261fed64\"}}`"}}