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

Any help with a trace rename error? Thoughts? #6

Closed
cdbattags opened this issue Feb 1, 2018 · 17 comments
Closed

Any help with a trace rename error? Thoughts? #6

cdbattags opened this issue Feb 1, 2018 · 17 comments

Comments

@cdbattags
Copy link

cdbattags commented Feb 1, 2018

line 209 in bin.js

Error:

Error: ENOENT: no such file or directory, rename 'node_trace.1.log' -> '46525.clinic-doctor/46525.clinic-doctor-traceevent'
    at Error (native)
@dhyasama
Copy link

dhyasama commented Feb 1, 2018

+1 I get the same error

@AndreasMadsen
Copy link
Contributor

What node version are you using? Until node 8.10.0 is release, we recommend you use 9.4.0.

@dhyasama
Copy link

dhyasama commented Feb 2, 2018

I'm back on 6.11. I'll give 9.4 a try. Thanks!

@jiripospisil
Copy link

I'm getting the same thing on Node 9.4.0 (+ macOS 10.13.3, clinic v0.6.2)

/Users/jiripospisil/.nah/versions/release--v9.4.0/lib/node_modules/clinic/bin.js:209
      if (err) throw err
               ^

Error: ENOENT: no such file or directory, rename 'node_trace.1.log' -> '40419.clinic-doctor/40419.clinic-doctor-traceevent'

@jiripospisil
Copy link

Ah, it's because my app catches SIGINT (which I guess should trigger the dump of the trace) and does some clean up. If I remove the signal catching, it works fine.

@AndreasMadsen
Copy link
Contributor

AndreasMadsen commented Feb 3, 2018

@jiripospisil That sounds odd. We collect the data continually and flush the final data on process exit. The flushing part is a bit complicated when the process doesn't exit nicely, and works best when the process exits naturally. Thus I would actually recommend you to add a SIGINT handler that closes everything nicely. See for example our slow-io example: https://github.com/nearform/node-clinic-examples/blob/master/slow-io/index.js#L29

PS: We have already made a few improvement to node.js itself regarding the flushing, such it works better when there is no SIGINT handler. However, it is an ongoing effort.

@jiripospisil
Copy link

jiripospisil commented Feb 3, 2018

@AndreasMadsen Hmm, so the difference seems to be that I use process.once instead of process.on. It works fine if I leave the example as is.

/tmp/tp-20180203201937/node-clinic-examples/slow-io ∴ master gd
diff --git a/slow-io/index.js b/slow-io/index.js
index 079d5dc..26ba90e 100644
--- a/slow-io/index.js
+++ b/slow-io/index.js
@@ -26,7 +26,7 @@ server.get('/', function (req, res, next) {

 server.listen(3000)

-process.on('SIGINT', function () {
+process.once('SIGINT', function () {
   console.error('Caught SIGINT, shutting down.')
   server.close()
 })
/tmp/tp-20180203201937/node-clinic-examples/slow-io ∴ master clinic doctor -- node index.js
Warning: Trace event is an experimental feature and could change at any time.
^C/Users/jiripospisil/.nah/versions/release--v9.4.0/lib/node_modules/clinic/bin.js:209
      if (err) throw err
               ^

Error: ENOENT: no such file or directory, rename 'node_trace.1.log' -> '43741.clinic-doctor/43741.clinic-doctor-traceevent'

@AndreasMadsen
Copy link
Contributor

@jiripospisil Thanks, I can reproduce the issue – it is quite odd. I will have a look on Monday.

@cdbattags
Copy link
Author

Any updates on this? Anything I can do to help?

@AndreasMadsen
Copy link
Contributor

I traced it down to this bug nodejs/node#18600 – We have a workaround for another nodecore bug, that as a side-effect will also workaround this nodecore bug: clinicjs/node-clinic-doctor#100

I will push for it getting landed soon :)

@AndreasMadsen
Copy link
Contributor

We published a new version of @nearform/clinic-doctor, if you update clinic it should work now :)

@mafintosh
Copy link
Contributor

I think this has been fixed. If not please reopen :)

@nithinputhenveettil
Copy link

Getting the same error on Node v6 today! Any help?

@mcollina
Copy link
Contributor

mcollina commented Apr 6, 2018

Node 6 is not supported. Use Node 8.10z

@ahimta
Copy link

ahimta commented Jan 29, 2019

Getting the same error on Node 10.15.0:sweat_smile:.

I'm using it with Mocha so the NPM script is something like clinic doctor -- npm run test:unit. And the test:unit is something like NODE_ENV=test mocha --exit --reporter nyan src/*.spec.js and I tried to remove the --exit flag in case it has some weird process signal handling behavior but it still didn't work:sweat_smile:.

@ahimta
Copy link

ahimta commented Jan 29, 2019

The error doesn't happen anymore when I switched from using yarn run to npm run😅.

@ShivaPrabhakar
Copy link

How can I change the directory where the node_trace.*.log should go

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

No branches or pull requests

9 participants