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

response incomplete json data #870

Closed
rickywu opened this issue Oct 17, 2017 · 5 comments
Closed

response incomplete json data #870

rickywu opened this issue Oct 17, 2017 · 5 comments

Comments

@rickywu
Copy link

rickywu commented Oct 17, 2017

The version info: "express": "~4.15.2", "express-session": "^1.15.5",

I use this code send large json data to client:

   router.get('/exportAllData',function(req,res,next){
    async function getData(){
    let sql="SELECT * FROM int_information "
    let rows=await query(sql);
    let data=await JSON.stringify(rows);
    return JSON.parse(data);
  }
  getData().then(data=>res.send({flag:1,data:data})).catch(error=>{
    res.send({flag:0,err:error});
  });  
})

I tried wget localhost on server and can get full data, But the remote client got broken json data and different each time refresh. Where is the problem? Seems response closed before get all data.

@crandmck
Copy link
Member

I don't think this is a doc issue...?

If I'm right, then we should move it to express repo, if it's a valid issue. @dougwilson LMK.

@dougwilson
Copy link
Contributor

Yea, it's not a doc issue, but if the user is using Node.js 8.x, they are describing an open Node.js bug that was introduced in 8.0.0

@rickywu
Copy link
Author

rickywu commented Oct 18, 2017

Sorry opned in the wrong place, but where is the open bug, could you send me a link?

@dougwilson
Copy link
Contributor

There are quite a few, with some say fixed, some not. I'm also not clear what fixes were atrempted when. Here is one that also includes a lot of links to others at the bottom: nodejs/node#13391

If you're still not sure, please feel free to file a new issue in the main Express repo as well and we can help you validate if it is an Express issue or Node.js issue. But if downgrading to 6.x or 7.x fixes it, I'm 100% sure you are seeing the Node.js 8.x timeout bug, because it manifests exactly as you described.

@rickywu
Copy link
Author

rickywu commented Oct 18, 2017

I revert back to node 7.10.1 and solved this problem, this issue should be closed.
Thank you so much.

This issue still happen in node js 8.7.0

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

3 participants