GithubHelp home page GithubHelp logo

Comments (9)

bhechinger avatar bhechinger commented on August 18, 2024

With version Triton CLI 7.5.1 I'm having this exact same issue.

fs.js:151
    throw new ERR_INVALID_CALLBACK(cb);
    ^

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. Received undefined
    at makeCallback (fs.js:151:11)
    at Object.unlink (fs.js:1057:14)
    at ClientRequest.<anonymous> (/usr/lib/node_modules/triton/lib/do_profile/profilecommon.js:72:12)
    at ClientRequest.emit (events.js:321:20)
    at TLSSocket.socketErrorListener (_http_client.js:424:9)
    at TLSSocket.emit (events.js:321:20)
    at emitErrorNT (internal/streams/destroy.js:84:8)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  code: 'ERR_INVALID_CALLBACK'
}

from node-triton.

trentm avatar trentm commented on August 18, 2024

Would anyone like to test this diff:

diff --git a/lib/do_profile/profilecommon.js b/lib/do_profile/profilecommon.js
index 5f6cac5..c8b67ce 100644
--- a/lib/do_profile/profilecommon.js
+++ b/lib/do_profile/profilecommon.js
@@ -26,6 +26,7 @@ var sshpk = require('sshpk');
 var mod_url = require('url');
 var crypto = require('crypto');
 var vasync = require('vasync');
+var VError = require('verror');
 var which = require('which');
 var wordwrap = require('wordwrap')(78);
 
@@ -69,8 +70,13 @@ function downloadUrl(opts, cb) {
     });
 
     req.on('error', function (err) {
-        fs.unlink(opts.dest);
-        cb(err);
+        fs.unlink(opts.dest, function onUnlink(unlinkErr) {
+            if (unlinkErr) {
+                cb(VError.errorFromList[err, unlinkErr]);
+            } else {
+                cb(err);
+            }
+        });
     });
 }

?

from node-triton.

bhechinger avatar bhechinger commented on August 18, 2024

This section will setup authentication to Triton DataCenter's Docker endpoint
using your account and key information specified above. This is only required
if you intend to use `docker` with this profile.

WARNING: Docker uses authentication via client TLS certificates that do not
support encrypted (passphrase protected) keys or SSH agents.

If you continue, this profile setup will create a fresh private key to be
written unencrypted to disk in "~/.triton/docker" for use by the Docker
client. This key will be useable only for Docker.

If you do not specifically want to use Docker, you can answer "no" here.

Continue? [y/n] y

Setting up profile "testing" to use Docker.
triton profile create: error (DEPTH_ZERO_SELF_SIGNED_CERT): self signed certificate

from node-triton.

trentm avatar trentm commented on August 18, 2024

@bhechinger Thanks! So better, then.

from node-triton.

bhechinger avatar bhechinger commented on August 18, 2024

Considering it actually tells me what's wrong now, yes. Much better. :)

from node-triton.

trentm avatar trentm commented on August 18, 2024

Oops, I assume you fixed the syntax error in my untested patch.

from node-triton.

bhechinger avatar bhechinger commented on August 18, 2024

I did not. It just worked as is.

from node-triton.

trentm avatar trentm commented on August 18, 2024

I did not. It just worked as is.

Ah, not syntax error, but rather invalid calling of the errorFromList function in a code path you didn't hit.

from node-triton.

trentm avatar trentm commented on August 18, 2024

[email protected] is published with this

from node-triton.

Related Issues (20)

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.