ERROR: 'NoneType' object has no attribute 'replace' (HTTP 500) openstack magnum client - docker

I installed openstack magnum (ocata release) on docker in my controller node because I have installed newton on my host machines and newton binaries did not install correctly but now when I try to run magnum-service list command the output is:
ERROR: 'NoneType' object has no attribute 'replace' (HTTP 500) (Request-ID: req-c5c279c2-9bc1-4672-90d3-410107880a4e)
magnum --debug service-list:
DEBUG (extension:180) found extension EntryPoint.parse('token_endpoint = openstackclient.api.auth_plugin:TokenEndpoint')
DEBUG (extension:180) found extension EntryPoint.parse('v2token = keystoneauth1.loading._plugins.identity.v2:Token')
DEBUG (extension:180) found extension EntryPoint.parse('v3oauth1 = keystoneauth1.extras.oauth1._loading:V3OAuth1')
DEBUG (extension:180) found extension EntryPoint.parse('admin_token = keystoneauth1.loading._plugins.admin_token:AdminToken')
DEBUG (extension:180) found extension EntryPoint.parse('v3oidcauthcode = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAuthorizationCode')
DEBUG (extension:180) found extension EntryPoint.parse('v2password = keystoneauth1.loading._plugins.identity.v2:Password')
DEBUG (extension:180) found extension EntryPoint.parse('v3samlpassword = keystoneauth1.extras._saml2._loading:Saml2Password')
DEBUG (extension:180) found extension EntryPoint.parse('v3password = keystoneauth1.loading._plugins.identity.v3:Password')
DEBUG (extension:180) found extension EntryPoint.parse('v3oidcaccesstoken = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAccessToken')
DEBUG (extension:180) found extension EntryPoint.parse('v3oidcpassword = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectPassword')
DEBUG (extension:180) found extension EntryPoint.parse('v3kerberos = keystoneauth1.extras.kerberos._loading:Kerberos')
DEBUG (extension:180) found extension EntryPoint.parse('token = keystoneauth1.loading._plugins.identity.generic:Token')
DEBUG (extension:180) found extension EntryPoint.parse('v3oidcclientcredentials = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectClientCredentials')
DEBUG (extension:180) found extension EntryPoint.parse('v3tokenlessauth = keystoneauth1.loading._plugins.identity.v3:TokenlessAuth')
DEBUG (extension:180) found extension EntryPoint.parse('v3token = keystoneauth1.loading._plugins.identity.v3:Token')
DEBUG (extension:180) found extension EntryPoint.parse('v3totp = keystoneauth1.loading._plugins.identity.v3:TOTP')
DEBUG (extension:180) found extension EntryPoint.parse('password = keystoneauth1.loading._plugins.identity.generic:Password')
DEBUG (extension:180) found extension EntryPoint.parse('v3fedkerb = keystoneauth1.extras.kerberos._loading:MappedKerberos')
DEBUG (extension:180) found extension EntryPoint.parse('aodh-noauth = aodhclient.noauth:AodhNoAuthLoader')
DEBUG (session:337) REQ: curl -g -i -X GET http://controller:35357/v3 -H "Accept: application/json" -H "User-Agent: magnum keystoneauth1/2.12.1 python-requests/2.10.0 CPython/2.7.12"
INFO (connectionpool:213) Starting new HTTP connection (1): controller
DEBUG (connectionpool:395) "GET /v3 HTTP/1.1" 200 250
DEBUG (session:366) RESP: [200] Date: Mon, 24 Sep 2018 06:56:28 GMT Server: Apache/2.4.18 (Ubuntu) Vary: X-Auth-Token X-Distribution: Ubuntu x-openstack-request-id: req-58453c24-09de-44e2-a2c5-b37a99e4e310 Content-Length: 250 Content-Type: application/json
RESP BODY: {"version": {"status": "stable", "updated": "2016-10-06T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}], "id": "v3.7", "links": [{"href": "http://controller:35357/v3/", "rel": "self"}]}}
DEBUG (base:165) Making authentication request to http://controller:35357/v3/auth/tokens
DEBUG (connectionpool:395) "POST /v3/auth/tokens HTTP/1.1" 201 6941
DEBUG (base:170) {"token": {"is_domain": false, "methods": ["password"], "roles": [{"id": "8ef21622b17946e5b1a18957131f648a", "name": "admin"}, {"id": "502cd9efebb04bd3827640b146723e93", "name": "user"}], "expires_at": "2018-09-24T07:56:28.000000Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "7f5b52b3f61a4f71a00fc3f6c6d9232c", "name": "admin"}, "catalog": [{"endpoints": [{"url": "http://controller:9696", "interface": "admin", "region": "Tehran", "region_id": "Tehran", "id": "2b096a1f466240578bd176ac3d0afaf6"}, {"url": "http://controller:9696", "interface": "internal", "region": "Tehran", "region_id": "Tehran", "id": "d26d991f09664b539a81bcfe4d2db213"}, {"url": "http://controller:9696", "interface": "public", "region": "Tehran", "region_id": "Tehran", "id": "d5fe08da089543c19a3c4fe11eb3d05b"}], "type": "network", "id": "1ac84ac88f684c20a6a62c75a4090f18", "name": "neutron"}, {"endpoints": [{"url": "http://controller:9292", "interface": "internal", "region": "Tehran", "region_id": "Tehran", "id": "8c13fb4c3ac54d1aa2c5697c1e17f838"}, {"url": "http://controller:9292", "interface": "public", "region": "Tehran", "region_id": "Tehran", "id": "b940e0047549462e9772f8cd1262d605"}, {"url": "http://controller:9292", "interface": "admin", "region": "Tehran", "region_id": "Tehran", "id": "ec0db283a74a4127b459d1d182f92749"}], "type": "image", "id": "218a33dc6be14a738d24d5d5d9e4ee8a", "name": "glance"}, {"endpoints": [{"url": "http://controller:8004/v1/7f5b52b3f61a4f71a00fc3f6c6d9232c", "interface": "internal", "region": "Tehran", "region_id": "Tehran", "id": "6faf56074d164ef597736f45951d6ffd"}, {"url": "http://controller:8004/v1/7f5b52b3f61a4f71a00fc3f6c6d9232c", "interface": "public", "region": "Tehran", "region_id": "Tehran", "id": "b91e7ed746c44ee3ae506372ff37caab"}, {"url": "http://controller:8004/v1/7f5b52b3f61a4f71a00fc3f6c6d9232c", "interface": "admin", "region": "Tehran", "region_id": "Tehran", "id": "ea71e861cf0740d48ffa1e3b52f19208"}], "type": "orchestration", "id": "2a3cc821104347f8a50400d2baaff43d", "name": "heat"}, {"endpoints": [{"url": "http://controller:8777", "interface": "internal", "region": "Tehran", "region_id": "Tehran", "id": "96ce47ce1afe4c66aba00e1703ed0eb0"}, {"url": "http://controller:8777", "interface": "public", "region": "Tehran", "region_id": "Tehran", "id": "bc53b46ed0134a169a0b4a0e9e721046"}, {"url": "http://controller:8777", "interface": "admin", "region": "Tehran", "region_id": "Tehran", "id": "c6cfb1d3e2d14d8e9856ddf1e3f4832a"}], "type": "metering", "id": "3bab377c64c5438090d82d32ac404872", "name": "ceilometer"}, {"endpoints": [{"url": "http://controller:5000/v3/", "interface": "public", "region": "Tehran", "region_id": "Tehran", "id": "30203075b93d44b88d40a4d3431fb447"}, {"url": "http://controller:35357/v3/", "interface": "internal", "region": "Tehran", "region_id": "Tehran", "id": "fd67bc46db2049539f36afd36f1e79e2"}, {"url": "http://controller:35357/v3/", "interface": "admin", "region": "Tehran", "region_id": "Tehran", "id": "fecf5cafcae54d04a76f236e8bb9c3d6"}], "type": "identity", "id": "69c3e22db5ca4925a470c8dbf3ca78a1", "name": "keystone"}, {"endpoints": [{"url": "http://controller:8774/v2.1/7f5b52b3f61a4f71a00fc3f6c6d9232c", "interface": "public", "region": "Tehran", "region_id": "Tehran", "id": "07a0ce9b8c524340af077317008da39b"}, {"url": "http://controller:8774/v2.1/7f5b52b3f61a4f71a00fc3f6c6d9232c", "interface": "admin", "region": "Tehran", "region_id": "Tehran", "id": "1a04d3e1a5734cba846dfd93c32665e0"}, {"url": "http://controller:8774/v2.1/7f5b52b3f61a4f71a00fc3f6c6d9232c", "interface": "internal", "region": "Tehran", "region_id": "Tehran", "id": "4fc391d188794fa0b28f6d14e636deae"}], "type": "compute", "id": "a606e06af40f4faa9ca3b18b3eeafb51", "name": "nova"}, {"endpoints": [{"url": "http://controller:8080/v1/AUTH_7f5b52b3f61a4f71a00fc3f6c6d9232c", "interface": "internal", "region": "Tehran", "region_id": "Tehran", "id": "2ab7e3b493c1465dad6c5b485b02ceb5"}, {"url": "http://controller:8080/v1/AUTH_7f5b52b3f61a4f71a00fc3f6c6d9232c", "interface": "public", "region": "Tehran", "region_id": "Tehran", "id": "78f3fd8aa58e411595581a8d8768bd7c"}, {"url": "http://controller:8080/v1", "interface": "admin", "region": "Tehran", "region_id": "Tehran", "id": "e8e2dd4e3c434379bc44d4f784c6d0de"}], "type": "object-store", "id": "aa3a3ddfa0024966a574b27ec2af06d7", "name": "swift"}, {"endpoints": [{"url": "http://controller:8776/v1/7f5b52b3f61a4f71a00fc3f6c6d9232c", "interface": "internal", "region": "Tehran", "region_id": "Tehran", "id": "6291788f2d0d407a95295e040df06674"}, {"url": "http://controller:8776/v1/7f5b52b3f61a4f71a00fc3f6c6d9232c", "interface": "public", "region": "Tehran", "region_id": "Tehran", "id": "97195ab376c34550b37d8da4fa2b172a"}, {"url": "http://controller:8776/v1/7f5b52b3f61a4f71a00fc3f6c6d9232c", "interface": "admin", "region": "Tehran", "region_id": "Tehran", "id": "dc88538325e246a3a3906c9a25e8948c"}], "type": "volume", "id": "be28bf09d9ef44f48d9badfe133ed97f", "name": "cinder"}, {"endpoints": [{"url": "http://controller:8776/v2/7f5b52b3f61a4f71a00fc3f6c6d9232c", "interface": "admin", "region": "Tehran", "region_id": "Tehran", "id": "757361dea28c4b8787c6c40301313482"}, {"url": "http://controller:8776/v2/7f5b52b3f61a4f71a00fc3f6c6d9232c", "interface": "public", "region": "Tehran", "region_id": "Tehran", "id": "b3475927386e4859aed918173b4f5dce"}, {"url": "http://controller:8776/v2/7f5b52b3f61a4f71a00fc3f6c6d9232c", "interface": "internal", "region": "Tehran", "region_id": "Tehran", "id": "db0b1c2a81c64a46a043ab48f8d666c2"}], "type": "volumev2", "id": "e14b62f9ab7146779883fc0c31f4e696", "name": "cinderv2"}, {"endpoints": [{"url": "http://controller:8000/v1", "interface": "admin", "region": "Tehran", "region_id": "Tehran", "id": "2629cb834728483480a7af73f9870645"}, {"url": "http://controller:8000/v1", "interface": "internal", "region": "Tehran", "region_id": "Tehran", "id": "5102fdb2b836407ea1bc5e7878a0f041"}, {"url": "http://controller:8000/v1", "interface": "public", "region": "Tehran", "region_id": "Tehran", "id": "7db9e6882c874546a0e0750f27998da9"}], "type": "cloudformation", "id": "f40a43a7c7094922b2336eb6fb2bbf2c", "name": "heat-cfn"}, {"endpoints": [{"url": "http://controller:9511/v1", "interface": "internal", "region": "Tehran", "region_id": "Tehran", "id": "0b1528bbe71d4b95848c93ba3246abcc"}, {"url": "http://controller:9511/v1", "interface": "admin", "region": "Tehran", "region_id": "Tehran", "id": "9b72490da74b44058d1f10290163ff34"}, {"url": "http://controller:9511/v1", "interface": "public", "region": "Tehran", "region_id": "Tehran", "id": "d131ce5383964b91990cf4989de08c35"}], "type": "container-infra", "id": "fbb700c7298741faaf9c8d3a60810908", "name": "magnum"}], "user": {"domain": {"id": "default", "name": "Default"}, "id": "0f48db6ef8ee4d0c86ffe747579fe78c", "name": "admin"}, "audit_ids": ["bhw-Dp3wTHqad34x4JVd1w"], "issued_at": "2018-09-24T06:56:28.000000Z"}}
DEBUG (session:337) REQ: curl -g -i -X GET http://controller:9511/v1/mservices -H "OpenStack-API-Version: container-infra latest" -H "X-Auth-Token: {SHA1}6fdfd1c001c639c7476888a9fdd9d72ecfc2c7ae" -H "Content-Type: application/json" -H "Accept: application/json" -H "User-Agent: None"
INFO (connectionpool:213) Starting new HTTP connection (1): controller
DEBUG (connectionpool:395) "GET /v1/mservices HTTP/1.1" 500 193
DEBUG (session:366) RESP: [500] OpenStack-API-Minimum-Version: container-infra 1.1 OpenStack-API-Maximum-Version: container-infra 1.6 OpenStack-API-Version: container-infra 1.6 vary: OpenStack-API-Version Content-Type: application/json Content-Length: 193 x-openstack-request-id: req-0a9e24cb-9c08-4620-96e4-1e844fac98bd Server: Werkzeug/0.14.1 Python/2.7.12 Date: Mon, 24 Sep 2018 06:56:29 GMT
RESP BODY: {"errors": [{"status": 500, "code": "server", "links": [], "title": "'NoneType' object has no attribute 'replace'", "detail": "'NoneType' object has no attribute 'replace'", "request_id": ""}]}
DEBUG (shell:694) 'NoneType' object has no attribute 'replace' (HTTP 500) (Request-ID: req-0a9e24cb-9c08-4620-96e4-1e844fac98bd)
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/magnumclient/shell.py", line 691, in main
OpenStackMagnumShell().main(map(encodeutils.safe_decode, sys.argv[1:]))
File "/usr/lib/python2.7/dist-packages/magnumclient/shell.py", line 633, in main
args.func(self.cs, args)
File "/usr/lib/python2.7/dist-packages/magnumclient/v1/mservices_shell.py", line 22, in do_service_list
mservices = cs.mservices.list()
File "/usr/lib/python2.7/dist-packages/magnumclient/v1/mservices.py", line 68, in list
return self._list(self._path(path), "mservices")
File "/usr/lib/python2.7/dist-packages/magnumclient/common/base.py", line 121, in _list
resp, body = self.api.json_request('GET', url)
File "/usr/lib/python2.7/dist-packages/magnumclient/common/httpclient.py", line 366, in json_request
resp = self._http_request(url, method, **kwargs)
File "/usr/lib/python2.7/dist-packages/magnumclient/common/httpclient.py", line 350, in _http_request
error_json.get('debuginfo'), method, url)
InternalServerError: 'NoneType' object has no attribute 'replace' (HTTP 500) (Request-ID: req-0a9e24cb-9c08-4620-96e4-1e844fac98bd)
ERROR: 'NoneType' object has no attribute 'replace' (HTTP 500) (Request-ID: req-0a9e24cb-9c08-4620-96e4-1e844fac98bd)
now magnum-api log is:
Sep 24 14:21:37 C32 keystone-wsgi-admin[26838]: 2018-09-24 14:21:37.107 26838 INFO keystone.common.wsgi [req-6dca8e34-ab31-4b84-b403-8a6972886ce4
Sep 24 14:21:37 C32 magnum-api[17373]: 2018-09-24 14:21:37.329 11738 ERROR wsme.api [req-e1c16795-4ebe-4960-92ac-ca81513e2e2f - - - - -] Server-si
Sep 24 14:21:37 C32 magnum-api[17373]: Traceback (most recent call last):
Sep 24 14:21:37 C32 magnum-api[17373]: File "/var/lib/magnum/env/local/lib/python2.7/site-packages/wsmeext/pecan.py", line 85, in callfunction
Sep 24 14:21:37 C32 magnum-api[17373]: result = f(self, *args, **kwargs)
Sep 24 14:21:37 C32 magnum-api[17373]: File "<decorator-gen-28>", line 2, in get_all
Sep 24 14:21:37 C32 magnum-api[17373]: File "/var/lib/magnum/env/local/lib/python2.7/site-packages/magnum/common/policy.py", line 130, in wrappe
Sep 24 14:21:37 C32 magnum-api[17373]: exc=exception.PolicyNotAuthorized, action=action)
Sep 24 14:21:37 C32 magnum-api[17373]: File "/var/lib/magnum/env/local/lib/python2.7/site-packages/magnum/common/policy.py", line 97, in enforce
Sep 24 14:21:37 C32 magnum-api[17373]: add_policy_attributes(target)
Sep 24 14:21:37 C32 magnum-api[17373]: File "/var/lib/magnum/env/local/lib/python2.7/site-packages/magnum/common/policy.py", line 106, in add_po
Sep 24 14:21:37 C32 magnum-api[17373]: trustee_domain_id = admin_osc.keystone().trustee_domain_id
Sep 24 14:21:37 C32 magnum-api[17373]: File "/var/lib/magnum/env/local/lib/python2.7/site-packages/magnum/common/keystone.py", line 182, in trus
Sep 24 14:21:37 C32 magnum-api[17373]: access = self.domain_admin_auth.get_access(
Sep 24 14:21:37 C32 magnum-api[17373]: File "/var/lib/magnum/env/local/lib/python2.7/site-packages/magnum/common/keystone.py", line 148, in doma
Sep 24 14:21:37 C32 magnum-api[17373]: auth_url=self.auth_url,
Sep 24 14:21:37 C32 magnum-api[17373]: File "/var/lib/magnum/env/local/lib/python2.7/site-packages/magnum/common/keystone.py", line 49, in auth_
Sep 24 14:21:37 C32 magnum-api[17373]: return CONF[ksconf.CFG_LEGACY_GROUP].auth_uri.replace('v2.0', 'v3')
Sep 24 14:21:37 C32 magnum-api[17373]: AttributeError: 'NoneType' object has no attribute 'replace'

It looks like you are missing auth_uri in the [keystone_authtoken] section of your magnum configuration.
You can use Kolla as a reference.
https://github.com/openstack/kolla-ansible/blob/stable/ocata/ansible/roles/magnum/templates/magnum.conf.j2#L56

This issue should by fixed in stable/rocky branch, see:
https://github.com/openstack/kolla-ansible/commit/187323e27655b1b1b5a5a378370d3ef18920272c#diff-786f05c66ee3d151fb1e18e6be9ce71c
Just update your kolla-ansible repository
git pull origin stable/rocky
and (re)deploy magnum again:
kolla-ansible -i inventory deploy -t magnum

If it is also www_authenticate_uri in your config file, then it could be like that :
www_authenticate_uri=http://localhost:5000
I changed URL and added v3 to the end.
www_authenticate_uri=http://localhost:5000/v3
That fixed my problem. Hope it will fix yours too!

Related

How to use a dictionary from JSON with Realm?

Creating a data model to use with codable and realm. Im getting stuck on dictionaries. As I understand it, you cannot use dictionaries with realm? How can I decode the following JSON and use it with something Realm will accept?
JSON Example A
"platform": {
"data": {
"25": {
"id": 25,
"name": "3DO",
"alias": "3do"
},
"4944": {
"id": 4944,
"name": "Acorn Archimedes",
"alias": "acorn-archimedes"
},
"4954": {
"id": 4954,
"name": "Acorn Electron",
"alias": "acorn-electron"
}
}
Note, the keys are strings that change, in decoable form i have it as
StructExample A
struct PlatformData : Codable {
let data : [String: PlatformInformation]
}
JSON Example B
"include": {
"boxart": {
"base_url": {
"original": "https:\/\/cdn.thegamesdb.net\/images\/original\/",
"small": "https:\/\/cdn.thegamesdb.net\/images\/small\/",
"thumb": "https:\/\/cdn.thegamesdb.net\/images\/thumb\/",
"cropped_center_thumb": "https:\/\/cdn.thegamesdb.net\/images\/cropped_center_thumb\/",
"medium": "https:\/\/cdn.thegamesdb.net\/images\/medium\/",
"large": "https:\/\/cdn.thegamesdb.net\/images\/large\/"
},
"data": {
"1":
[
{
"id": 242,
"type": "fanart",
"side": null,
"filename": "fanart\/1-2.jpg",
"resolution": "1920x1080"
},
{
"id": 433,
"type": "fanart",
"side": null,
"filename": "fanart\/1-5.jpg",
"resolution": "1920x1080"
}
],
"2":
[
{
"id": 15,
"type": "fanart",
"side": null,
"filename": "fanart\/2-1.jpg",
"resolution": "1920x1080"
},
{
"id": 133,
"type": "fanart",
"side": null,
"filename": "fanart\/2-2.jpg",
"resolution": "1920x1080"
},
{
"id": 656,
"type": "fanart",
"side": null,
"filename": "fanart\/2-4.jpg",
"resolution": "1920x1080"
}
],
"4":
[
{
"id": 208,
"type": "fanart",
"side": null,
"filename": "fanart\/4-1.jpg",
"resolution": "1920x1080"
},
{
"id": 481,
"type": "banner",
"side": null,
"filename": "graphical\/4-g.jpg",
"resolution": null
},
{
"id": 846,
"type": "boxart",
"side": "front",
"filename": "boxart\/front\/4-1.jpg",
"resolution": "1000x705"
},
{
"id": 847,
"type": "boxart",
"side": "back",
"filename": "boxart\/back\/4-1.jpg",
"resolution": "1000x705"
},
{
"id": 73897,
"type": "clearlogo",
"side": null,
"filename": "clearlogo\/4.png",
"resolution": "400x148"
},
{
"id": 215539,
"type": "fanart",
"side": null,
"filename": "fanart\/4-2.jpg",
"resolution": null
},
{
"id": 238533,
"type": "screenshot",
"side": null,
"filename": "screenshot\/4-1.jpg",
"resolution": null
},
{
"id": 238534,
"type": "screenshot",
"side": null,
"filename": "screenshot\/4-2.jpg",
"resolution": null
},
{
"id": 238535,
"type": "screenshot",
"side": null,
"filename": "screenshot\/4-3.jpg",
"resolution": null
},
{
"id": 238536,
"type": "screenshot",
"side": null,
"filename": "screenshot\/4-4.jpg",
"resolution": null
},
{
"id": 238537,
"type": "screenshot",
"side": null,
"filename": "screenshot\/4-5.jpg",
"resolution": null
},
{
"id": 238538,
"type": "screenshot",
"side": null,
"filename": "screenshot\/4-6.jpg",
"resolution": null
}
],
"5":
[
{
"id": 396,
"type": "banner",
"side": null,
"filename": "graphical\/5-g.jpg",
"resolution": null
},
{
"id": 2364,
"type": "fanart",
"side": null,
"filename": "fanart\/5-4.jpg",
"resolution": "1920x1080"
},
]
Here is similar, except now with an array of objects as the value
Struct Example B
struct BoxArtData : Codeable {
let data: [String:[ExtraImages]]
}

Data missing in extra_fields in /collectors/{id}/recipients

I am trying to get the response with this query from SurveyMoneky:
/collectors/{id}/recipients?include=survey_response_status,mail_status,custom_fields,remove_link,extra_fields,survey_link
Response I am getting is:
"last_name": "Siraj",
"first_name": "Abdullah",
"survey_response_status": "completely_responded",
"mail_status": "sent",
"email": "***",
"href": "****",
"custom_fields": {
"1": null,
"6": "2017"
},
"remove_link": "****",
"id": "3310118350",
"survey_link": "****"
My problem is:
I am supposed to get the extra_fields which I am not receiving
custom_field 1 is definitely not null, its wrong data.
The actual values of those fields are:
"extra_fields": {
"job_item_id": "123456",
"year": "2017"
},
"custom_fields": {
"1": "123456",
"6": "2017"
}
I checked with this call: /collectors/{id}/recipients/{id} and this works fine.
Am I missing something?

How to get the progress of a running build using TFS REST API?

I'm monitoring builds on TFS & VSTS and would like to know how to get the overall progress (in percentage) of a running build or release.
You could use Rest API Get build details with timeline.
GET https://{instance}/DefaultCollection/{project}/_apis/build/builds/{buildId}/timeline?api-version={version}
Which will return build timeline and some more detail info including a percentComplete result. Note: this is task level based just like the build log in webportal, not the entire build.
Sample response
{
"records": [
{
"id": "bcddc27d-c891-4209-85d6-387e155439b0",
"parentId": "045f4ce9-cb71-424f-84de-4ab19281dc70",
"type": "Task",
"name": "Build solution **\\*.sln",
"startTime": "2015-07-16T19:53:20.853Z",
"finishTime": "2015-07-16T19:53:28.567Z",
"currentOperation": null,
"percentComplete": 100,
"state": "completed",
"result": "succeeded",
"resultCode": null,
"changeId": 16,
"lastModified": "0001-01-01T00:00:00",
"workerName": "Hosted Agent",
"order": 2,
"details": {
"id": "ef959107-e566-4c28-8d9f-354d605dd400",
"changeId": 6,
"url": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/build/builds/391/Timeline/ef959107-e566-4c28-8d9f-354d605dd400"
},
"errorCount": 0,
"warningCount": 1,
"url": null,
"log": {
"id": 2,
"type": "Container",
"url": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/build/builds/391/logs/2"
},
"issues": [
{
"type": "warning",
"category": "General",
"message": "The MSBuild version parameter has been deprecated. Ignoring value: latest",
"data": {
"type": "warning"
}
}
]
},
{
"id": "b5bb4de7-a8ea-4c7d-8491-3f745bba7d1b",
"parentId": "045f4ce9-cb71-424f-84de-4ab19281dc70",
"type": "Task",
"name": "Get sources",
"startTime": "2015-07-16T19:53:07.057Z",
"finishTime": "2015-07-16T19:53:19.493Z",
"currentOperation": null,
"percentComplete": 100,
"state": "completed",
"result": "succeeded",
"resultCode": null,
"changeId": 13,
"lastModified": "0001-01-01T00:00:00",
"workerName": "Hosted Agent",
"order": 1,
"details": null,
"errorCount": 0,
"warningCount": 0,
"url": null,
"log": {
"id": 1,
"type": "Container",
"url": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/build/builds/391/logs/1"
}
},

SurveyMonkey API v3 language codes

For API v2 there was a table which related language_id (integer) to language description which I built into my app so that I could match my user language to that of the survey.
Is there a similar table for v3 to relate language (string) to the language description; I couldn't find one.
It would be good to know what language codes are currently possible.
In V2 survey showed language_id which was an internal number that references a language, the table is located here.
In V3 the language used is the standard ISO language codes used everywhere (instead of a number it'll be en, es, fr for example. Here's a table of language codes I just searched up. Maybe a similar table should be added to the API v3 docs.
survey_languages = [
{"name": "English", "id": 1, "code": "en"},
{"name": "Albanian", "id": 24, "code": "sq"},
{"name": "Arabic", "id": 25, "code": "ar"},
{"name": "Armenian", "id": 26, "code": "hy"},
{"name": "Basque", "id": 27, "code": "eu"},
{"name": "Bengali", "id": 28, "code": "bn"},
{"name": "Bosnian", "id": 29, "code": "bs"},
{"name": "Bulgarian", "id": 30, "code": "bg"},
{"name": "Catalan", "id": 31, "code": "ca"},
{"name": "Chinese (Simplified)", "id": 2, "code": "zh-cn"},
{"name": "Chinese (Traditional)", "id": 3, "code": "zh-tw"},
{"name": "Portuguese (Brazilian)", "id": 17, "code": "pt-br"},
{"name": "Portuguese (Iberian)", "id": 16, "code": "pt"},
{"name": "Croatian", "id": 32, "code": "hr"},
{"name": "Czech", "id": 33, "code": "cs"},
{"name": "Danish", "id": 4, "code": "da"},
{"name": "Dutch", "id": 5, "code": "nl"},
{"name": "Estonian", "id": 34, "code": "et"},
{"name": "Filipino", "id": 35, "code": "tl"},
{"name": "Finnish", "id": 6, "code": "fi"},
{"name": "French", "id": 7, "code": "fr"},
{"name": "Georgian", "id": 36, "code": "ka"},
{"name": "German", "id": 8, "code": "de"},
{"name": "Greek", "id": 9, "code": "el"},
{"name": "Hebrew", "id": 37, "code": "he"},
{"name": "Hindi", "id": 38, "code": "hi"},
{"name": "Hungarian", "id": 39, "code": "hu"},
{"name": "Icelandic", "id": 40, "code": "is"},
{"name": "Indonesian", "id": 41, "code": "id"},
{"name": "Irish", "id": 42, "code": "ga"},
{"name": "Italian", "id": 10, "code": "it"},
{"name": "Japanese", "id": 11, "code": "ja"},
{"name": "Korean", "id": 12, "code": "ko"},
{"name": "Kurdish", "id": 43, "code": "ku"},
{"name": "Latvian", "id": 44, "code": "lv"},
{"name": "Lithuanian", "id": 45, "code": "lt"},
{"name": "Macedonian", "id": 46, "code": "mk"},
{"name": "Malay", "id": 13, "code": "ms"},
{"name": "Malayalam", "id": 47, "code": "ml"},
{"name": "Norwegian", "id": 14, "code": "no"},
{"name": "Persian", "id": 48, "code": "fa"},
{"name": "Polish", "id": 15, "code": "pl"},
{"name": "Punjabi", "id": 49, "code": "pa"},
{"name": "Romanian", "id": 50, "code": "ro"},
{"name": "Russian", "id": 18, "code": "ru"},
{"name": "Serbian", "id": 51, "code": "sr"},
{"name": "Slovak", "id": 52, "code": "sk"},
{"name": "Slovenian", "id": 53, "code": "sl"},
{"name": "Spanish", "id": 19, "code": "es"},
{"name": "Swahili", "id": 54, "code": "sw"},
{"name": "Swedish", "id": 20, "code": "sv"},
{"name": "Tamil", "id": 55, "code": "ta"},
{"name": "Telugu", "id": 56, "code": "te"},
{"name": "Thai", "id": 57, "code": "th"},
{"name": "Turkish", "id": 21, "code": "tr"},
{"name": "Ukrainian", "id": 22, "code": "uk"},
{"name": "Vietnamese", "id": 58, "code": "vi"},
{"name": "Welsh", "id": 59, "code": "cy"},
]

Flocker data migration

I'm using flocker to persist and migrate docker containers data through ZfS Dataset backend.
docker run -v test:/data --volume-driver flocker busybox
sh -c "echo hello world > /data/file.txt"
I had this error for a week:
Unable to find image 'busybox:latest' locally latest: Pulling from
library/busybox 583635769552: Pull complete b175bcb79023: Pull
complete Digest:
sha256:c1bc9b4bffe665bf014a305cc6cf3bca0e6effeb69d681d7a208ce741dad58e0
Status: Downloaded newer image for busybox:latest Error response from
daemon: Cannot start container
128ddff1c0e9d6740c23b2f475b14206775a131878b4ed725a3280e22de79666:
Timed out waiting for dataset to mount...
Any help would be appreciated.
flocker-docker-plugin.log
{
"task_uuid": "4001196a-902c-4139-8b4f-e217490242ab",
"error": true,
"timestamp": 1459172727.570846,
"message": "Unhandled Error\nTraceback (most recent call last):\n File \"/opt/flocker/local/lib/python2.7/site-packages/flocker/dockerplugin/_script.py\", line 93, in docker_plugin_main\n options=DockerPluginOptions()).main()\n File \"/opt/flocker/local/lib/python2.7/site-packages/flocker/common/script.py\", line 294, in main\n self._react(run_and_log, [], _reactor=self._reactor)\n File \"/opt/flocker/local/lib/python2.7/site-packages/twisted/internet/task.py\", line 882, in react\n finished = main(_reactor, *argv)\n File \"/opt/flocker/local/lib/python2.7/site-packages/flocker/common/script.py\", line 282, in run_and_log\n d = maybeDeferred(self.script.main, reactor, options)\n--- <exception caught here> ---\n File \"/opt/flocker/local/lib/python2.7/site-packages/twisted/internet/defer.py\", line 150, in maybeDeferred\n result = f(*args, **kw)\n File \"/opt/flocker/local/lib/python2.7/site-packages/flocker/dockerplugin/_script.py\", line 71, in main\n certificates_path.child(b\"plugin.key\"))\n File \"/opt/flocker/local/lib/python2.7/site-packages/flocker/apiclient/_client.py\", line 592, in __init__\n cert_path, key_path)\n File \"/opt/flocker/local/lib/python2.7/site-packages/flocker/ca/_validation.py\", line 137, in treq_with_authentication\n user_credential = UserCredential.from_files(user_cert_path, user_key_path)\n File \"/opt/flocker/local/lib/python2.7/site-packages/flocker/ca/_ca.py\", line 371, in from_files\n certificate = load_certificate_file(certificate_path)\n File \"/opt/flocker/local/lib/python2.7/site-packages/flocker/ca/_ca.py\", line 232, in load_certificate_file\n e.filename, code, failure\nflocker.ca._ca.PathError: Certificate file could not be opened. No such file or directory /etc/flocker/plugin.crt\n",
"message_type": "twisted:log",
"task_level": [
1
]
}
{
"task_uuid": "846b9f01-f618-4723-bf9e-2ce7ac6b79c9",
"error": true,
"timestamp": 1459172727.57451,
"message": "main function encountered error\nTraceback (most recent call last):\n File \"/opt/flocker/local/lib/python2.7/site-packages/flocker/dockerplugin/_script.py\", line 93, in docker_plugin_main\n options=DockerPluginOptions()).main()\n File \"/opt/flocker/local/lib/python2.7/site-packages/flocker/common/script.py\", line 294, in main\n self._react(run_and_log, [], _reactor=self._reactor)\n File \"/opt/flocker/local/lib/python2.7/site-packages/twisted/internet/task.py\", line 882, in react\n finished = main(_reactor, *argv)\n File \"/opt/flocker/local/lib/python2.7/site-packages/flocker/common/script.py\", line 282, in run_and_log\n d = maybeDeferred(self.script.main, reactor, options)\n--- <exception caught here> ---\n File \"/opt/flocker/local/lib/python2.7/site-packages/twisted/internet/defer.py\", line 150, in maybeDeferred\n result = f(*args, **kw)\n File \"/opt/flocker/local/lib/python2.7/site-packages/flocker/dockerplugin/_script.py\", line 71, in main\n certificates_path.child(b\"plugin.key\"))\n File \"/opt/flocker/local/lib/python2.7/site-packages/flocker/apiclient/_client.py\", line 592, in __init__\n cert_path, key_path)\n File \"/opt/flocker/local/lib/python2.7/site-packages/flocker/ca/_validation.py\", line 137, in treq_with_authentication\n user_credential = UserCredential.from_files(user_cert_path, user_key_path)\n File \"/opt/flocker/local/lib/python2.7/site-packages/flocker/ca/_ca.py\", line 371, in from_files\n certificate = load_certificate_file(certificate_path)\n File \"/opt/flocker/local/lib/python2.7/site-packages/flocker/ca/_ca.py\", line 232, in load_certificate_file\n e.filename, code, e file could nfailure\nflocker.ca._ca.PathError: Certificatot be opened. No such file or directory /etc/flocker/plugin.crt\n",
"message_type": "twisted:log",
"task_level": [
1
]
}{
"task_uuid": "7aab456b-a754-4160-8bcb-0b618a63ecda",
"error": false,
"timestamp": 1459172727.575473,
"message": "Main loop terminated.",
"message_type": "twisted:log",
"task_level": [
1
]
}{
"task_uuid": "5b490165-8eb1-4755-9c87-1b49f00bc700",
"error": false,
"timestamp": 1459172728.921761,
"message": "Log opened.",
"message_type": "twisted:log",
"task_level": [
1
]
}
flocker-dataset-agent.log
{
"task_uuid": "e0a6549f-7515-427f-abb6-b31379895bde",
"cluster_state": {
"node_uuid_to_era": {
"values": [
[
{
"hex": "e4b23086-3d3e-44c4-acc4-8b5d31c8fc9b",
"$__class__$": "UUID"
},
{
"hex": "c1ccd75f-14c4-4e33-a9a9-b6ea876c5a05",
"$__class__$": "UUID"
}
],
[
{
"hex": "70f6f5dd-378c-4913-8b2f-0b0f1f55f0a8",
"$__class__$": "UUID"
},
{
"hex": "f824f593-8723-47f3-8605-a45b2262b268",
"$__class__$": "UUID"
}
]
],
"$__class__$": "PMap"
},
"nodes": [
{
"paths": {
"values": [
[
"7645c292-5329-4aa3-b606-981c2f4e4892",
{
"path": "/flocker/55ab515f-43eb-488b-b3a3-e65fa5c62249.default.7645c292-5329-4aa3-b606-981c2f4e4892",
"$__class__$": "FilePath"
}
]
],
"$__class__$": "PMap"
},
"uuid": {
"hex": "e4b23086-3d3e-44c4-acc4-8b5d31c8fc9b",
"$__class__$": "UUID"
},
"$__class__$": "NodeState",
"hostname": "192.168.224.7",
"devices": {
"values": [
],
"$__class__$": "PMap"
},
"applications": [
],
"manifestations": {
"values": [
[
"7645c292-5329-4aa3-b606-981c2f4e4892",
{
"dataset": {
"deleted": false,
"dataset_id": "7645c292-5329-4aa3-b606-981c2f4e4892",
"metadata": {
"values": [
],
"$__class__$": "PMap"
},
"maximum_size": 80530636800,
"$__class__$": "Dataset"
},
"primary": true,
"$__class__$": "Manifestation"
}
]
],
"$__class__$": "PMap"
}
},
{
"paths": {
"values": [
],
"$__class__$": "PMap"
},
"uuid": {
"hex": "70f6f5dd-378c-4913-8b2f-0b0f1f55f0a8",
"$__class__$": "UUID"
},
"$__class__$": "NodeState",
"hostname": "192.168.224.89",
"devices": {
"values": [
],
"$__class__$": "PMap"
},
"applications": [
],
"manifestations": {
"values": [
],
"$__class__$": "PMap"
}
}
],
"nonmanifest_datasets": {
"values": [
],
"$__class__$": "PMap"
},
"$__class__$": "DeploymentState"
},
"action_type": "flocker:agent:converge",
"desired_configuration": {
"persistent_state": {
"blockdevice_ownership": {
"values": [
],
"$__class__$": "PMap"
},
"$__class__$": "PersistentState"
},
"nodes": [
{
"applications": [
],
"manifestations": {
"values": [
[
"7645c292-5329-4aa3-b606-981c2f4e4892",
{
"dataset": {
"deleted": false,
"dataset_id": "7645c292-5329-4aa3-b606-981c2f4e4892",
"metadata": {
"values": [
[
"name",
"apples"
]
],
"$__class__$": "PMap"
},
"maximum_size": 80530636800,
"$__class__$": "Dataset"
},
"primary": true,
"$__class__$": "Manifestation"
}
]
],
"$__class__$": "PMap"
},
"uuid": {
"hex": "70f6f5dd-378c-4913-8b2f-0b0f1f55f0a8",
"$__class__$": "UUID"
},
"$__class__$": "Node"
},
{
"applications": [
],
"manifestations": {
"values": [
],
"$__class__$": "PMap"
},
"uuid": {
"hex": "e4b23086-3d3e-44c4-acc4-8b5d31c8fc9b",
"$__class__$": "UUID"
},
"$__class__$": "Node"
}
],
"leases": {
"values": [
],
"$__class__$": "PMap"
},
"$__class__$": "Deployment"
},
"timestamp": 1459176487.344602,
"action_status": "started",
"task_level": [
2,
1
]
}{
"timestamp": 1459176487.345864,
"task_uuid": "e0a6549f-7515-427f-abb6-b31379895bde",
"action_type": "flocker:agent:discovery",
"action_status": "started",
"task_level": [
2,
2,
1
]
}{
"fsm_next_state": "<ConvergenceLoopStates=CONVERGING>",
"task_level": [
3
],
"action_type": "fsm:transition",
"timestamp": 1459176487.348982,
"fsm_output": [
"<ConvergenceLoopOutputs=CLEAR_WAKEUP>",
"<ConvergenceLoopOutputs=CONVERGE>"
],
"task_uuid": "e0a6549f-7515-427f-abb6-b31379895bde",
"action_status": "succeeded"
}{
"task_uuid": "e0a6549f-7515-427f-abb6-b31379895bde",
"task_level": [
2,
2,
2
],
"action_type": "flocker:agent:discovery",
"timestamp": 1459176487.354977,
"state": "NodeLocalState(node_state=NodeState(applications=None, paths=UnicodeFilepathPMap({}), manifestations=UnicodeManifestationPMap({}), hostname=u'192.168.224.89', uuid=UUID('70f6f5dd-378c-4913-8b2f-0b0f1f55f0a8'), devices=UuidFilepathPMap({})))",
"action_status": "succeeded"
}{
"timestamp": 1459176487.356563,
"task_uuid": "e0a6549f-7515-427f-abb6-b31379895bde",
"message_type": "flocker:agent:converge:actions",
"task_level": [
2,
3
],
"calculated_actions": "NoOp(sleep=datetime.timedelta(0, 1))"
}{
"timestamp": 1459176487.356925,
"task_uuid": "e0a6549f-7515-427f-abb6-b31379895bde",
"action_type": "flocker:change:noop",
"action_status": "started",
"task_level": [
2,
4,
1
]
}{
"timestamp": 1459176487.357233,
"task_uuid": "e0a6549f-7515-427f-abb6-b31379895bde",
"action_type": "flocker:change:noop",
"action_status": "succeeded",
"task_level": [
2,
4,
2
]
}
The logs contain the following error:
_ca.PathError: Certificate file could not be opened. No such file or directory /etc/flocker/plugin.crt
This means you are missing the necessary certificates in order for the docker plugin to communicate correctly.
Please see the below link to create the necessary certificates.
https://docs.clusterhq.com/en/latest/docker-integration/generate-api-plugin.html
The problem is still there. The full discussion with Ryan can be found in this link:
https://groups.google.com/forum/#!topic/flocker-users/l5wCW-U1zKs

Resources