Git Product home page Git Product logo

Comments (30)

nnabuuu avatar nnabuuu commented on May 24, 2024

Hi @Zig1375 , Can you please show your code here? From listing category to article. I have no issue with article list in my environment

from node-zendesk.

Zig1375 avatar Zig1375 commented on May 24, 2024

Before NodeJS update, it all work. But after update from 0.12 to 4.1.1 I always have an error.

var zd = require('node-zendesk');
var client = zd.createClient({
            "username"  : "username",
            "token"     : "token",
            "remoteUri" : "https://domain.zendesk.com/api/v2/help_center",
            "helpcenter" : true
        });

client.sections.list(function (err, req, result) {
            if (err) {
                console.error(err);
                return;
            }
            client.articles.list(function (err, req, result) {
// I have the error here
                if (err) {
                    console.error(err);
                    return;
                }

            });
        });

from node-zendesk.

nnabuuu avatar nnabuuu commented on May 24, 2024

OK, let me check with that node version...

from node-zendesk.

jonhill04 avatar jonhill04 commented on May 24, 2024

I'm getting this error too....any updates?

from node-zendesk.

didil avatar didil commented on May 24, 2024

I also see this type of errors from time to time with node v4 , on all api methods

Error: socket hang up
at createHangUpError (_http_client.js:203:15)
at TLSSocket.socketOnEnd (_http_client.js:288:23)
at emitNone (events.js:72:20)
at TLSSocket.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:893:12)
at doNTCallback2 (node.js:429:9)
at process._tickDomainCallback (node.js:384:17) { [Error: socket hang up] code: 'ECONNRESET' }

from node-zendesk.

masonicGIT avatar masonicGIT commented on May 24, 2024

SOLUTION:

Same issue with node v4.1.1, getting { [Error: socket hang up] code: 'ECONNRESET' }

Worked fine after rolling back to node v0.12.7

from node-zendesk.

nnabuuu avatar nnabuuu commented on May 24, 2024

Could anyone provide your platform information?

I am not able to reproduce it on Windows x64 node v4.1.1 , and 4.2.2 also works fine : (

Thanks

from node-zendesk.

dbaq avatar dbaq commented on May 24, 2024

Hey guys,

I just started today with this plugin, I got the same error.

MacOS
node -v
v4.2.1
express
^4.13.3
node-zendesk
^1.1.5

Let me know if I can help.

from node-zendesk.

Zig1375 avatar Zig1375 commented on May 24, 2024

MacOS 10.11 (Node v5.0.0)
FreeBSD 10.2-RELEASE-p5 (Node v4.1.1)

from node-zendesk.

didil avatar didil commented on May 24, 2024

Ubuntu 14.04 . Node v4.1.1

from node-zendesk.

rpnzl avatar rpnzl commented on May 24, 2024

I'm getting a similar error (Unhandled rejection RequestError: Error: socket hang up) with Node v5.0.0 using request-promise against the Zendesk API, the common elements seem to be the request library and Node versions > 4. Not using this library at all, but found this issue when Googling for discussions about the bug. Rolling back to Node v0.12.7 resolved the issue for me.

from node-zendesk.

nnabuuu avatar nnabuuu commented on May 24, 2024

I used MacOS 10.11 and Node v4.1.1, but still not able to reproduce : (

I am using following code

var zd = require('node-zendesk');
var os = require('os');

var client = zd.createClient({
  username:  'somename',
  password:     'somepassword',
  remoteUri: 'https://node-zendesk.zendesk.com/hc/api/v2',
  helpcenter: true
});

console.log("node version:", process.version);
console.log("operation system:", os.type(), os.arch(), os.release());


client.sections.list(function (err, req, result) {

  if (err) {
    console.error(err);
    return;
  } else {
    console.log("no error here")
  }

  client.articles.list(function (err, req, result) {

    if (err) {
      console.error(err);
      return;
    } else {
      console.log("no error here")
    }
  });
});

And my output is:

node version: v4.1.1
operation system: Darwin x64 15.0.0
no error here
no error here

from node-zendesk.

callumacrae avatar callumacrae commented on May 24, 2024

My code:

const query = `checkout-failure order_by:created sort:desc`;
zendeskClient.search.queryAll(query, function (err, req, res) {
    console.log(err);
});

My error:

{ [Error: socket hang up] code: 'ECONNRESET' }

My system:

❯ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.10.1
BuildVersion:   14B25

❯ uname -a
Darwin callum-lmn-mbp.local 14.0.0 Darwin Kernel Version 14.0.0: Fri Sep 19 00:26:44 PDT 2014; root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64

❯ node -v
v4.2.1

❯ npm -v
2.14.7

Previous issue: #118

@nnabuuu How many issues are you trying to retrieve? Maybe it's only an issue above a certain number of pages.

from node-zendesk.

callumacrae avatar callumacrae commented on May 24, 2024

@nnabuuu this is blocking me at work, would be really good to see a fix.

I can have a look at fixing it: where would you recommend I start looking? I am completely unfamiliar with this library :)

from node-zendesk.

nnabuuu avatar nnabuuu commented on May 24, 2024

@callumacrae Thank you, I was only trying to retrieve around 5 articles as I as using a new applied account for test.

If you would like to have a look, you may want to start from lib/client.js which is the entrance of node-zendesk, then the network request part is at lib/client/client.js. Most of the rest js files are corresponding to a certain endpoint. Eg, client/helpcenter/article.js is for the article endpoint in helpcenter.

from node-zendesk.

didil avatar didil commented on May 24, 2024

@nnabuuu by the way the issue doesn't have anything to do with articles. I've faced it with various endpoints, I think it's more of a client issue

from node-zendesk.

callumacrae avatar callumacrae commented on May 24, 2024

@nnabuuu I'm taking a look now. It is only an issue with a large number of tickets: if I make a search with only a few results, it works fine.

from node-zendesk.

Zig1375 avatar Zig1375 commented on May 24, 2024

@nnabuuu I use your code, and my result:

node version: v5.1.0
operation system: Darwin x64 15.0.0
no error here
{ [Error: socket hang up] code: 'ECONNRESET' }

from node-zendesk.

callumacrae avatar callumacrae commented on May 24, 2024

I made a detailed issue on the request repo, which is where I think the problem is: request/request#1934

from node-zendesk.

i-am-cjc avatar i-am-cjc commented on May 24, 2024

Not sure if anyone is still looking at this, or the issue linked by @callumacrae

Also having this issue on a production service at the moment, using node 4.2.2, Linux 3.18.

Only seems to be happening for us when retrieving specific Zen Desk tickets. Always seems to fail on the same ones.

from node-zendesk.

kristofmic avatar kristofmic commented on May 24, 2024

Experiencing this issue as well using both the request module (v2.67.0) and the node-zendesk module, which is also relying on request. I tried it on node v4.2.2 and v4.2.3. It works fine with requesting sections from the helpdesk, but when I request articles it sporadically works. This is the error that typically returns:

2015-12-16 22:05:11.251000 [INFO] console - ZENDESK ERROR:  { [Error: socket hang up] code: 'ECONNRESET' }
Error: socket hang up
    at createHangUpError (_http_client.js:203:15)
    at TLSSocket.socketOnEnd (_http_client.js:288:23)
    at emitNone (events.js:72:20)
    at TLSSocket.emit (events.js:166:7)
    at endReadableNT (_stream_readable.js:905:12)
    at doNTCallback2 (node.js:441:9)
    at process._tickDomainCallback (node.js:396:17)

I have very similar code to make requests to other APIs and this is the first that has given me this kind of error.

from node-zendesk.

hereismass avatar hereismass commented on May 24, 2024

Hello, Experiencing the same issue here.

> sw_vers
ProductName:    Mac OS X
ProductVersion: 10.10.5
BuildVersion:   14F1021

> node -v
v5.2.0

It only occurs on articles, but as pointed before it is certainly related to the amount of articles compared to the sections or categories.

So for now the only way around is going back to 0.12 ?

from node-zendesk.

marian2js avatar marian2js commented on May 24, 2024

Hello everyone, I have the same issue.

I reproduced it also with the module https and doing the requests directly to the Zendesk API without this library.

I can only reproduce it doing this 2 requests together, if I only run one of these, they work fine.

I'm using node v4.2.3

// With https
var https = require('https');

var options1 = {
  hostname: 'subdomain.zendesk.com',
  path: '/api/v2/views/active.json',
  method: 'GET',
  auth: 'email/token:key'
};

var options2 = {
  hostname: 'subdomain.zendesk.com',
  path: '/api/v2/search.json?query=type:ticket&per_page=250',
  method: 'GET',
  auth: 'email/token:key'
};

var request1 = https.request(options1, function() {
  var request2 = https.request(options2);
  request2.end();
  request2.on('error', function(e) {
    console.error(e); // { [Error: socket hang up] code: 'ECONNRESET' }
  });
});
request1.end();
// With request (2.61.0)
var request = require('request');

var options1 = {
  url: 'https://subdomain.zendesk.com/api/v2/views/active.json',
  auth: {
    'user': 'email/token',
    'pass': 'key'
  },
  headers: {
    Accept: 'application/json'
  },
  json: true,
  timeout: 30000
};

var options2 = {
  url: 'https://subdomain.zendesk.com/api/v2/search.json?query=type:ticket&per_page=250',
  auth: {
    'user': 'email/token',
    'pass': 'key'
  },
  headers: {
    Accept: 'application/json'
  },
  json: true,
  timeout: 30000
};

request(options1, function() {
  request(options2, function(err, res, body) {
    console.log(err); // { [Error: socket hang up] code: 'ECONNRESET' }
  });
});

from node-zendesk.

i-am-cjc avatar i-am-cjc commented on May 24, 2024

To follow up to my previous comment, the specific tickets I am trying to retrieve have significantly more comments than usual. This goes along with people having issues with getting longer articles.

from node-zendesk.

didil avatar didil commented on May 24, 2024

Indeed I also see this issue with large tickets

from node-zendesk.

callumacrae avatar callumacrae commented on May 24, 2024

So it looks like it could be a problem with node itself? Has anyone looked to see if there is an issue on the node repo?

from node-zendesk.

i-am-cjc avatar i-am-cjc commented on May 24, 2024

Another issue here with only a couple of comments but them being longer comments. Shortening them down and creating a new ticket on Zendesk allows my code to work.

from node-zendesk.

yoshprogrammer avatar yoshprogrammer commented on May 24, 2024

Encountering this same issue with trying to retrieve macros or users.

Node v 5.4.0

app.get('/api/macros', function (req, res) {

        client.macros.list(function (err, req, result) {
            if (err) {
                console.log(err);
                res.status(500).send(err);
            } else {
                console.log('Result: ', result);
                res.json(result);
            }
            //console.log(JSON.stringify(result[0], null, 2, true));//gets the first page
        });

    });

    app.get('/api/users/list', function (req, res) {

        client.users.list(function (err, req, result) {
            if (err) {
                console.log(err);
                res.status(500).send(err);
            } else {

                console.log(JSON.stringify(result.map(function (user) {return user.name;}), null, 2, true));//gets the first page
                console.log("Total Users: "+result.length);
                res.json(result);
            }

        });

    });

Def seems linked to the client itself, probably will have to use the official PHP library if can't get this figured out as rolling back Node won't work for me.

Edit: Downgraded to Node v.0.12 from 5.4.0 and it works, so something between this library and later versions of node do not like each other

from node-zendesk.

didil avatar didil commented on May 24, 2024

Thanks to the example of @marian2js I think I found a fix for this, just opened a PR #120

from node-zendesk.

erikzrekz avatar erikzrekz commented on May 24, 2024

Just mentioning it here again -- but PR #120 appears to fix the socket hang up issue

from node-zendesk.

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.