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

Error: Write after end #157

Open
pasquy73 opened this issue Nov 1, 2019 · 8 comments
Open

Error: Write after end #157

pasquy73 opened this issue Nov 1, 2019 · 8 comments

Comments

@pasquy73
Copy link

pasquy73 commented Nov 1, 2019

I found an error when I tried to run my client lwm2m.
My client sends 200 request any 2 seconds and after 125 requests I have this error:
Tried to write to a closed stream.
and I print the error in the console: write after end
I'm using node 10.15.0 and npm 6.4.1.
I attached my test client and my provisioning for IoT Agent.
provisioning.zip
test.zip

@fgalan
Copy link
Member

fgalan commented Nov 6, 2019

Not sure what the cause of the problem can be, but recently @versatildefuy and @dherykw has been working on this libreary. Maybe they can help.

@pasquy73
Copy link
Author

I think I solved this error using "lwm2m-node-lib": "1.0.0" in the package.json of lightweightm2m-iotagent instead of the last version (default it was 1.2.0).
Versions 1.1.0 and 1.2.0 always provided me the "write after end" error.

@dherykw
Copy link

dherykw commented Nov 13, 2019

Hello @pasquy73 ,

Happy to see you arround. I guess the client you're developing is based on the examples that come with the repository.

@pasquy73
Copy link
Author

Hi @dherykw,
I used/created that client provided in the library to test the LWM2M version 0.4.0 in the QA task.
When I used the new version of LWM2M I found that error using the same client. I also provided my zip files, if you want to repeat the test and understand the issue.

@dherykw
Copy link

dherykw commented Nov 13, 2019

I would try with the release/1.3.0

@pasquy73
Copy link
Author

Let me know with the 1.3.0, and please try to use my client to send multiple requests any x seconds

@dherykw
Copy link

dherykw commented Nov 13, 2019

I know that the examples in the v1.3.0 work fine with some minor bugs, but I am almost sure that you can use them to follow the tutorial.

I can't help you beyond that because we don't use this library we just fix the server issues for the compatibility of our devices. I should do the tutorial also 😆

if you wanted the lwM2M client for functional testing I would suggest to you to use our LwM2M virtual device, it is dockerized and documented here feel free to use it 🚀

@fgalan
Copy link
Member

fgalan commented Dec 2, 2019

I think I solved this error using "lwm2m-node-lib": "1.0.0" in the package.json of lightweightm2m-iotagent instead of the last version (default it was 1.2.0).
Versions 1.1.0 and 1.2.0 always provided me the "write after end" error.

That means that the issue was introduced in the 1.0.0 to 1.1.0 step. Here are the difference between both it isn't very useful (too long and complex). Maybe more interesting in the changelog between both versions (https://github.com/telefonicaid/lwm2m-node-lib/releases/tag/1.1.0):

Changes (since 1.0.0):

  • Set Nodejs 6.14.4 as minimum version in packages.json (effectively removing Nodev4 as supported version)
  • Add: npm scripts to execute tests, coverage, watch and clean
  • Fix: Active attributes not working since coap proxy is not being used for lwm2m observations so observations arrives to the device from a different port from the used in the rest of communications (Observations are not using coap proxy #110)
  • Fix: Avoid faster libcoap response: libcoap is not waiting long enough for lightweight-iotagent and lwm2m-node-lib to send the response (Strange LwM2M registration response. #104)
  • Fix: cannot handle update registration from a Wakaama client (cannot handle update registration from a Wakaama client #106)
  • Replace mongoose-auto-increment dependency (unmantained) with mongoose-plugin-autoinc
  • Upgrade: async dependence from 1.5.2 to 2.6.1
  • Upgrade: coap dependence from 0.17.0 to 0.22.0
  • Upgrade: coap-cli dependence from 0.4.0 to 0.5.1
  • Upgrade: mongodb dependence from 2.1.7 to 3.1.9
  • Upgrade: mongoose dependence from 4.4.3 to 5.3.10
  • Upgrade: logops dependence from 0.5.0 to 2.1.0
  • Upgrade: underscore dependence from 1.7.0 to 1.9.1
  • Upgrade: mocha development dependence from 2.4.5 to 5.2.0
  • Upgrade: should development dependece from 8.2.2 to 13.2.3
  • Upgrade: istanbul development dependence from ~0.1.34 to ~0.4.5
  • Upgrade: proxyquire development dependence from 0.5.1 to 2.1.0
  • Ensure precise dependencies (~=) are used in packages.json
  • Remove: old unused development dependencies (closure-linter-wrapper, sinon-chai, sinon, chai, grunt and grunt related modules)

I hope this information can help to find the problem.

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