Git Product home page Git Product logo

Comments (9)

Marak avatar Marak commented on June 9, 2024

Can you paste the code you are attempting to run?

That error message is being thrown from node.js core, it generally means that your outgoing connection cannot find it's target ( bad URI / bad network / etc )

from node-cloudservers.

rilkeanheart avatar rilkeanheart commented on June 9, 2024

Thanks Marak. Here's the code I'm trying to run.

var cloudservers = require('cloudservers'),
    sys = require('sys');

function createServer(serverName, client) {
  var options = {
    name: serverName,
    image: 49, // Ubuntu 10.04 (Lucid Lynx)
    flavor: 1, // 256 server
  };

  client.setAuth(function (err, res) {
    if(err) {
      console.log("Error Authenticating Client:")
      console.log(err);
    } else {
      client.createServer(options, function (err, server) {
        if(err) {
          console.log("Error Creating Server")
          console.log(err);
        } else {
          server.setWait({ status: 'ACTIVE' }, 5000, function () {
            // Our server is now built and active, so we can install node.js on it
            sys.puts('Your server ' + serverName + ' is now ready.');
            sys.puts('  IP Address: ' + server.addresses.public);
            sys.puts('  Root password: ' + server.adminPass);
          });
        }
      });      
    }
  });
};

var args = process.argv.slice(2);
var serverName = args[0];
var username = args[1] || 'my-userid';
var apiKey = args[2] || 'my-api-key';

var config = {
  auth : {
    username: 'my-userid',
    apiKey: 'my-api-key'
  }
};

var client = cloudservers.createClient(config);

createServer(serverName, client);

I can successfully authenticate using curl with the following:

user$ curl -D -
-H "X-Auth-Key: (my-api-key)"
-H "X-Auth-User: (my-user-id)"
https://auth.api.rackspacecloud.com/v1.0

I agree with you. Everything points to something funky with the outbound connection...but I don't seem to have issues with curl or npm.

from node-cloudservers.

rilkeanheart avatar rilkeanheart commented on June 9, 2024

Haven't resolved. Any ideas?

from node-cloudservers.

CrypticSwarm avatar CrypticSwarm commented on June 9, 2024

Confirmed the same problem. I used the client.getFlavors example from the readme.

from node-cloudservers.

CrypticSwarm avatar CrypticSwarm commented on June 9, 2024

Seems the current git repo works. What is in npm doesn't. Might need to publish version "0.2.9". Current in npm in "0.2.8"

from node-cloudservers.

kenperkins avatar kenperkins commented on June 9, 2024

Ditto on the npm installed version.

from node-cloudservers.

pkrumins avatar pkrumins commented on June 9, 2024

Well I just had to use this library and the workaround is to set "host" to "auth.api.rackspacecloud.com" in the auth hash. The problem is within lib/cloudservers/code.js when in the setAuth function the authUrl becomes undefined for some reason. I tried debugging it but couldn't figure out why that happens.

Here is how you set the auth hash so it worked:

{
"username" : "X",
"apiKey" : "Y",
"host" : "auth.api.rackspacecloud.com"
}

from node-cloudservers.

pkrumins avatar pkrumins commented on June 9, 2024

Turns out this bug has been fixed in the current master, and it just hasn't been npm published!

from node-cloudservers.

crystalneth avatar crystalneth commented on June 9, 2024

Current master is broken in other ways. It does not properly set the serverUrl after authorization resulting in a protocol error. Any chance of getting a stable version pushed to npm?

UPDATE: My bad, I had an auth error, which instead of being reported or throwing an exception, just messes up the config hash by assuming a valid response.

from node-cloudservers.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.