Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

util.inspect on Node.js 5.x.x Causing Issues #111

Closed
atom0s opened this issue Jan 12, 2016 · 5 comments
Closed

util.inspect on Node.js 5.x.x Causing Issues #111

atom0s opened this issue Jan 12, 2016 · 5 comments

Comments

@atom0s
Copy link

atom0s commented Jan 12, 2016

I have a project that we use this module in. Upon making a request to createContainerIfNotExists, the project continues to execute as if the call happened but it does not. The module will eventually get to this line and stop:

self.logger.log(Logger.LogLevels.DEBUG, 'FINAL REQUEST OPTIONS:\n' + util.inspect(finalRequestOptions));

Calling util.inspect lands up eventually getting to this following block of code within node's util.js:

function ensureDebugIsInitialized() {
  if (Debug === undefined) {
    const runInDebugContext = require('vm').runInDebugContext;
    Debug = runInDebugContext('Debug');
  }
}

The last line, Debug = runInDebugContext('Debug'); lands up never returning and the promise that called it never returns/ends. This completely causes all debugging for the app that makes use of your module to stop working.

@yaxia
Copy link
Member

yaxia commented Jan 15, 2016

@atom0s I cannot repro the issue as you described. The request options are printed as expect. Could you please share more about your code of calling the API? Thanks.

@atom0s
Copy link
Author

atom0s commented Jan 15, 2016

With node v5.4.1 this error persists. It is a known error/issue on Node's issue tracker as well here:
nodejs/node#4440

Our project makes use of this in a manner like this:

var azure = require('azure-storage');
var blobService = azure.createBlobService();

module.exports.createContainer = function createContainer(container, callback) {
    blobService.createContainerIfNotExists(container, { publicAccessLevel: 'container' }, function (err, result, response) {
        callback(err, result);
    });
}

....

<ModuleName>.createContainer('images', function (err, result) {

Which lands up getting into azure-storage-node's code which calls the above logging feature causing the crash.

@yaxia
Copy link
Member

yaxia commented Jan 15, 2016

I see. I can repro it with step-by-step debug and get no problem when just continue to run the code in the debug mode. It looks like a nodejs debugger issue.

@tSreeram
Copy link

I also faced similar util.inspect issue. But after upgrade to NodeJS 5.6 (latest) the debugger issue is resolved.

@yaxia
Copy link
Member

yaxia commented Feb 24, 2016

@tSreeram Thanks for sharing. @atom0s I am going to close the issue. Please feel free to reopen it if the latest Nodejs doesn't work for you. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants