node-openstack-wrapper icon indicating copy to clipboard operation
node-openstack-wrapper copied to clipboard

.createServerImage() errors with "Invalid format (output) missing from remote call"

Open vladfulgeanu opened this issue 7 years ago • 1 comments

When issuing a .createServerImage() command, the response returns the following error in the callback:

{ Error: Invalid format (output) missing from remote call
    at _getRequestError (/home/test/node_modules/openstack-wrapper/lib/os-request.js:219:20)
    at Request._callback (/home/test/node_modules/openstack-wrapper/lib/os-request.js:316:15)
    at Request.self.callback (/home/test/node_modules/request/request.js:186:22)
    at Request.emit (events.js:182:13)
    at Request.<anonymous> (/home/test/node_modules/request/request.js:1163:10)
    at Request.emit (events.js:182:13)
    at IncomingMessage.<anonymous> (/home/test/node_modules/request/request.js:1085:12)
    at Object.onceWrapper (events.js:273:13)
    at IncomingMessage.emit (events.js:187:15)
    at endReadableNT (_stream_readable.js:1086:12)
  code: 'REMOTEERROR',
  detail: 
   { remoteMethod: 'POST',
     remoteURI: '~~~remoteURI~~~',
     remoteStatusCode: 202,
     remoteMessage: '',
     remoteCode: '',
     remoteDetail: '',
     responseTime: 0.975 } }

The issued command looks something like this:

    await  nova.createServerImage(serverId, {
        "name" :   `image ${dateformat(new Date(), "dd/mm/yyyy HH:MM")}`,
        "metadata": {
            "test_var": "test_val"
        }
    }, (error, result) => {
        if (error) {
            console.log(error); // will output the earlier error
        }
        console.log(result);  // will be undefined
    });

even though the image is created fine, also seen by the remoteStatusCode 202.

I want to know if this is a problem with the cloud provider (OVH) because there is no body in their response.

vladfulgeanu avatar Aug 29 '18 08:08 vladfulgeanu

Sorry for the slow response here - your provider (OVH) is probably doing this the right way. Nova has simply changed the output format recently and the library wasn't supporting the older format.

Just published a new version (2.2.0) that should support both new and old formats on that call and should fix your issue.

You can see more info about the problem here if you are interested: https://developer.openstack.org/api-ref/compute/?expanded=create-image-createimage-action-detail#create-image-createimage-action

BannedInSweden avatar Nov 07 '18 23:11 BannedInSweden