Last active
August 29, 2015 14:20
-
-
Save bdha/14904654149eabc9aee2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ResourceNotFoundError: Workflow with uuid 'workflow-check' does not exist | |
[2015-05-08T13:59:12.286Z] INFO: workflow-api/20171 on 89f64f42-3878-426a-987b-19f142af6b53: (req_id=67bf9be0-f58a-11e4-a6ea-5fcf7a54b72f) | |
evt: { | |
"ph": "b", | |
"name": "getworkflowsuuid010" | |
} | |
[2015-05-08T13:59:12.289Z] ERROR: workflow-api/wf-moray-backend/20171 on 89f64f42-3878-426a-987b-19f142af6b53: getWorkflow Error | |
ObjectNotFoundError: wf_workflows::workflow-check does not exist | |
at EventEmitter.<anonymous> (/opt/smartdc/moray/lib/objects/get.js:71:16) | |
at EventEmitter.g (events.js:180:16) | |
at EventEmitter.emit (events.js:95:17) | |
at endOrError (/opt/smartdc/moray/lib/pg.js:97:13) | |
at f (/opt/smartdc/moray/node_modules/once/once.js:16:25) | |
at onQueryEnd (/opt/smartdc/moray/lib/pg.js:124:9) | |
at EventEmitter.emit (events.js:95:17) | |
at Query.handleReadyForQuery (/opt/smartdc/moray/node_modules/pg/lib/query.js:86:8) | |
at null.<anonymous> (/opt/smartdc/moray/node_modules/pg/lib/client.js:159:19) | |
at EventEmitter.emit (events.js:117:20) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[2015-05-08T13:59:07.130Z] INFO: workflow-api/20171 on 89f64f42-3878-426a-987b-19f142af6b53: handled: 201 (req_id=64aa1e80-f58a-11e4-a6ea-5fcf7a54b72f, audit=true, remoteAddress=10.99.99.10, remotePort=55530, latency=17, _audit=true) | |
POST /workflows HTTP/1.1 | |
accept: application/json | |
content-type: application/json | |
user-agent: restify/2.2.2 (ia32-sunos; v8/3.14.5.9; OpenSSL/1.0.1i) node/0.10.32 | |
accept-version: * | |
date: Fri, 08 May 2015 13:59:07 GMT | |
content-length: 4856 | |
content-md5: 790H3dKXQc4pQLQwfE+ulw== | |
host: workflow.moya.wormhole.local | |
connection: keep-alive | |
{ | |
"name": "net-update-0.0.2", | |
"version": "0.0.2", | |
"chain": [ | |
{ | |
"name": "validate_params", | |
"timeout": 10, | |
"retry": 1, | |
"body": "function validateParams(job, callback) {\n var p;\n var globalsReq = {\n 'CNAPI URL': cnapiUrl,\n 'NAPI URL': napiUrl\n };\n\n var jobParamsReq = {\n 'networks': 'network object list',\n 'original_network': 'original network',\n 'update_params': 'update parameters'\n };\n\n for (p in globalsReq) {\n if (!globalsReq[p]) {\n return callback('No ' + p + ' workflow parameter provided');\n }\n }\n\n for (p in jobParamsReq) {\n if (!job.params[p]) {\n return callback('No ' + p + ' parameter provided');\n }\n }\n\n return callback(null, 'parameters validated successfully');\n}", | |
"uuid": "d56c9849-64aa-4f49-91f2-057e03a6f6f7" | |
}, | |
{ | |
"name": "napi.get_server_nics", | |
"timeout": 10, | |
"retry": 1, | |
"body": "function getServerNics(job, callback) {\n var napi = new sdcClients.NAPI({ url: napiUrl });\n\n job.params.serverUUIDs = [];\n var params = {\n belongs_to_type: 'server',\n nic_tags_provided: [ job.params.original_network.nic_tag ]\n };\n\n napi.listNics(params, function (err, nics) {\n if (err) {\n return callback(err);\n }\n\n job.log.debug(nics.map(function (n) { return n.mac; }),\n 'NICs retrieved from NAPI');\n\n for (var j = 0; j < nics.length; j++) {\n var nic = nics[j];\n\n if (job.params.serverUUIDs.indexOf(\n nic['belongs_to_uuid']) == -1) {\n job.params.serverUUIDs.push(nic['belongs_to_uuid']);\n }\n }\n\n job.log.info({ serverUuids: job.params.serverUUIDs },\n 'Server UUIDs retrieved');\n return callback(null, 'Server UUIDs retrieved');\n });\n}", | |
"uuid": "3e23bdae-d0bc-47b1-a489-b1aaf2a4bf74" | |
}, | |
{ | |
"name": "cnapi.update_nics", | |
"timeout": 60, | |
"retry": 1, | |
"body": "function updateNics(job, callback) {\n if (!job.params.serverUUIDs || job.params.serverUUIDs.length === 0) {\n return callback(null, 'No servers to update');\n }\n\n var cnapi = new sdcClients.CNAPI({ url: cnapiUrl });\n job.params.taskIDs = [];\n var updateParams = {\n original_network: job.params.original_network,\n networks: job.params.networks\n };\n\n async.forEach(job.params.serverUUIDs, function (uuid, cb) {\n var endpoint = '/servers/' + uuid + '/vms/nics/update';\n\n cnapi.post(endpoint, updateParams, function (err, task) {\n if (err) {\n if (err.restCode == 'InvalidVersion') {\n // This is a 6.5 CN - updating nics is not supported\n return cb();\n }\n return cb(err);\n }\n job.log.debug(task, 'Server \"%s\": task', uuid);\n\n job.params.taskIDs.push({ server_uuid: uuid, task_id: task.id});\n return cb(null);\n });\n }, function (err) {\n if (err) {\n return callback(err);\n }\n\n return callback(null, 'Started update on ' +\n job.params.taskIDs.length + ' servers');\n });\n}", | |
"uuid": "d44ec88b-0f8f-4bd8-af4b-bf99c1d491b8" | |
}, | |
{ | |
"name": "cnapi.poll_tasks", | |
"timeout": 180, | |
"retry": 1, | |
"body": "function pollTasks(job, callback) {\n if (!job.params.taskIDs || job.params.taskIDs.length === 0) {\n return callback(null, 'No tasks to poll');\n }\n\n var cnapi = new sdcClients.CNAPI({ url: cnapiUrl });\n\n job.params.taskSuccesses = [];\n job.params.taskFailures = [];\n\n return async.forEach(job.params.taskIDs, function (detail, cb) {\n var timeout = null;\n\n function pollOne() {\n cnapi.getTask(detail.task_id, function onCnapi(err, task) {\n if (timeout) {\n clearTimeout(timeout);\n }\n\n if (err) {\n return cb(err);\n }\n\n job.log.debug(task, 'retrieved task for server \"%s\"',\n detail.server_uuid);\n if (task.status == 'failure') {\n job.params.taskFailures.push(detail);\n return cb(new Error('Job \"' + detail.task_id\n + '\" failed for server \"' + detail.server_uuid + '\"'));\n }\n\n if (task.status == 'complete') {\n job.params.taskSuccesses.push(detail);\n return cb(null);\n }\n\n timeout = setTimeout(pollOne, 1000);\n });\n }\n\n pollOne();\n }, function (err) {\n if (err) {\n return callback(err);\n }\n\n return callback(null, 'All server tasks returned successfully');\n });\n}", | |
"uuid": "8667f2fd-9987-47d3-bc9f-32965d8d63ef" | |
} | |
], | |
"timeout": 270, | |
"onerror": [ | |
{ | |
"name": "On error", | |
"body": "function (job, cb) {\n return cb('Error executing job');\n }", | |
"uuid": "bc4d7989-8409-4219-af56-5a6b541ccb40" | |
} | |
] | |
} | |
-- | |
HTTP/1.1 201 Created | |
location: /workflows/679b7393-0c3f-47c2-b778-c7aa79e5bd87 | |
request-id: 679b7393-0c3f-47c2-b778-c7aa79e5bd87 | |
content-type: application/json | |
content-length: 5228 | |
access-control-allow-origin: * | |
access-control-allow-headers: Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, Api-Version, Response-Time | |
access-control-allow-methods: GET, HEAD, POST | |
access-control-expose-headers: Api-Version, Request-Id, Response-Time | |
connection: Keep-Alive | |
content-md5: VWicrbSfG91Byn31BAekCQ== | |
date: Fri, 08 May 2015 13:59:07 GMT | |
server: WorkflowAPI | |
response-time: 17 | |
x-request-id: 64aa1e80-f58a-11e4-a6ea-5fcf7a54b72f | |
x-response-time: 17 | |
x-server-name: 89f64f42-3878-426a-987b-19f142af6b53 | |
{ | |
"name": "net-update-0.0.2", | |
"timeout": 270, | |
"chain": [ | |
{ | |
"name": "validate_params", | |
"timeout": 10, | |
"retry": 1, | |
"body": "function validateParams(job, callback) {\n var p;\n var globalsReq = {\n 'CNAPI URL': cnapiUrl,\n 'NAPI URL': napiUrl\n };\n\n var jobParamsReq = {\n 'networks': 'network object list',\n 'original_network': 'original network',\n 'update_params': 'update parameters'\n };\n\n for (p in globalsReq) {\n if (!globalsReq[p]) {\n return callback('No ' + p + ' workflow parameter provided');\n }\n }\n\n for (p in jobParamsReq) {\n if (!job.params[p]) {\n return callback('No ' + p + ' parameter provided');\n }\n }\n\n return callback(null, 'parameters validated successfully');\n}", | |
"uuid": "d56c9849-64aa-4f49-91f2-057e03a6f6f7" | |
}, | |
{ | |
"name": "napi.get_server_nics", | |
"timeout": 10, | |
"retry": 1, | |
"body": "function getServerNics(job, callback) {\n var napi = new sdcClients.NAPI({ url: napiUrl });\n\n job.params.serverUUIDs = [];\n var params = {\n belongs_to_type: 'server',\n nic_tags_provided: [ job.params.original_network.nic_tag ]\n };\n\n napi.listNics(params, function (err, nics) {\n if (err) {\n return callback(err);\n }\n\n job.log.debug(nics.map(function (n) { return n.mac; }),\n 'NICs retrieved from NAPI');\n\n for (var j = 0; j < nics.length; j++) {\n var nic = nics[j];\n\n if (job.params.serverUUIDs.indexOf(\n nic['belongs_to_uuid']) == -1) {\n job.params.serverUUIDs.push(nic['belongs_to_uuid']);\n }\n }\n\n job.log.info({ serverUuids: job.params.serverUUIDs },\n 'Server UUIDs retrieved');\n return callback(null, 'Server UUIDs retrieved');\n });\n}", | |
"uuid": "3e23bdae-d0bc-47b1-a489-b1aaf2a4bf74" | |
}, | |
{ | |
"name": "cnapi.update_nics", | |
"timeout": 60, | |
"retry": 1, | |
"body": "function updateNics(job, callback) {\n if (!job.params.serverUUIDs || job.params.serverUUIDs.length === 0) {\n return callback(null, 'No servers to update');\n }\n\n var cnapi = new sdcClients.CNAPI({ url: cnapiUrl });\n job.params.taskIDs = [];\n var updateParams = {\n original_network: job.params.original_network,\n networks: job.params.networks\n };\n\n async.forEach(job.params.serverUUIDs, function (uuid, cb) {\n var endpoint = '/servers/' + uuid + '/vms/nics/update';\n\n cnapi.post(endpoint, updateParams, function (err, task) {\n if (err) {\n if (err.restCode == 'InvalidVersion') {\n // This is a 6.5 CN - updating nics is not supported\n return cb();\n }\n return cb(err);\n }\n job.log.debug(task, 'Server \"%s\": task', uuid);\n\n job.params.taskIDs.push({ server_uuid: uuid, task_id: task.id});\n return cb(null);\n });\n }, function (err) {\n if (err) {\n return callback(err);\n }\n\n return callback(null, 'Started update on ' +\n job.params.taskIDs.length + ' servers');\n });\n}", | |
"uuid": "d44ec88b-0f8f-4bd8-af4b-bf99c1d491b8" | |
}, | |
{ | |
"name": "cnapi.poll_tasks", | |
"timeout": 180, | |
"retry": 1, | |
"body": "function pollTasks(job, callback) {\n if (!job.params.taskIDs || job.params.taskIDs.length === 0) {\n return callback(null, 'No tasks to poll');\n }\n\n var cnapi = new sdcClients.CNAPI({ url: cnapiUrl });\n\n job.params.taskSuccesses = [];\n job.params.taskFailures = [];\n\n return async.forEach(job.params.taskIDs, function (detail, cb) {\n var timeout = null;\n\n function pollOne() {\n cnapi.getTask(detail.task_id, function onCnapi(err, task) {\n if (timeout) {\n clearTimeout(timeout);\n }\n\n if (err) {\n return cb(err);\n }\n\n job.log.debug(task, 'retrieved task for server \"%s\"',\n detail.server_uuid);\n if (task.status == 'failure') {\n job.params.taskFailures.push(detail);\n return cb(new Error('Job \"' + detail.task_id\n + '\" failed for server \"' + detail.server_uuid + '\"'));\n }\n\n if (task.status == 'complete') {\n job.params.taskSuccesses.push(detail);\n return cb(null);\n }\n\n timeout = setTimeout(pollOne, 1000);\n });\n }\n\n pollOne();\n }, function (err) {\n if (err) {\n return callback(err);\n }\n\n return callback(null, 'All server tasks returned successfully');\n });\n}", | |
"uuid": "8667f2fd-9987-47d3-bc9f-32965d8d63ef" | |
} | |
], | |
"onerror": [ | |
{ | |
"name": "On error", | |
"body": "function (job, cb) {\n return cb('Error executing job');\n }", | |
"uuid": "bc4d7989-8409-4219-af56-5a6b541ccb40" | |
} | |
], | |
"max_attempts": 10, | |
"chain_md5": "4346af716fa8f9113c5e2f06f6df0a67", | |
"onerror_md5": "f923e0c4e747ad38ee8b356bce231b92", | |
"uuid": "679b7393-0c3f-47c2-b778-c7aa79e5bd87" | |
} | |
-- | |
route: { | |
"methods": [ | |
"GET", | |
"HEAD", | |
"POST" | |
], | |
"name": "postworkflows010", | |
"params": {}, | |
"spec": { | |
"path": "/workflows", | |
"version": "0.1.0", | |
"method": "POST", | |
"versions": [ | |
"0.1.0" | |
], | |
"name": "postworkflows010" | |
} | |
} | |
-- | |
req.timers: { | |
"bunyan": 26, | |
"handler-1": 68, | |
"parseAccept": 39, | |
"parseDate": 5, | |
"parseQueryString": 9, | |
"readBody": 682, | |
"parseBody": 255, | |
"restifyResponseHeaders": 5, | |
"ensureBackendConnected": 1, | |
"handler-9": 2, | |
"postWorkflow": 15864 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment