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

Can't start on node v7.10.1, Mac Os 10.12.6 #22

Closed
anija opened this issue Oct 31, 2017 · 6 comments
Closed

Can't start on node v7.10.1, Mac Os 10.12.6 #22

anija opened this issue Oct 31, 2017 · 6 comments
Assignees
Labels
Milestone

Comments

@anija
Copy link

anija commented Oct 31, 2017

Hi,

i'm trying to install swagger stats but i get this error when i start the app:

/src/node_modules/prom-client/lib/gauge.js:219
                        throw new TypeError(Value is not a valid number: ${util.format(value)});
                        ^

TypeError: Value is not a valid number: undefined
    at /src/node_modules/prom-client/lib/gauge.js:219:10
    at Gauge.set (/src/node_modules/prom-client/lib/gauge.js:85:31)
    at swsCoreStats.calculateSystemStats (/src/node_modules/swagger-stats/lib/swsCoreStats.js:151:65)
    at swsCoreStats.tick (/src/node_modules/swagger-stats/lib/swsCoreStats.js:121:10)
    at Timeout.swsProcessor.tick (/src/node_modules/swagger-stats/lib/swsProcessor.js:137:20)
    at Timeout.ontimeout [as _repeat] (timers.js:400:34)
    at Timeout.wrapper [as _onTimeout] (timers.js:425:11)
    at tryOnTimeout (timers.js:232:11)
    at Timer.listOnTimeout (timers.js:202:5)

This is the line #151 of swsCoreStats.js:
this.promClientMetrics.nodejs_process_memory_external_bytes.set(this.sys.external);

This is this.sys content:

  rss: 95752192,
  heapTotal: 75632640,
  heapUsed: 46559352,
  external: undefined,
  cpu: 26.9837199868224

And this is the result of process.memoryUsage():

{ rss: 95752192, heapTotal: 75632640, heapUsed: 46559352 }

The external property is missing.

@sv2 sv2 self-assigned this Nov 1, 2017
@sv2 sv2 added the bug label Nov 1, 2017
@sv2
Copy link
Collaborator

sv2 commented Nov 1, 2017

Thank you! will address shortly

sv2 added a commit that referenced this issue Nov 1, 2017
@reuben453
Copy link

reuben453 commented Nov 1, 2017

Hi,

I'm facing a very similar (or exactly same) issue on node v6.2.1, mac v10.12.6.

This is the error I get when I start the app:

/node_modules/prom-client/lib/gauge.js:219
			throw new TypeError(`Value is not a valid number: ${util.format(value)}`);
			^

TypeError: Value is not a valid number: undefined
    at /node_modules/prom-client/lib/gauge.js:219:10
    at Gauge.set (/node_modules/prom-client/lib/gauge.js:85:31)
    at swsCoreStats.calculateSystemStats (/node_modules/swagger-stats/lib/swsCoreStats.js:151:65)
    at swsCoreStats.tick (/node_modules/swagger-stats/lib/swsCoreStats.js:121:10)
    at Timeout.swsProcessor.tick (/node_modules/swagger-stats/lib/swsProcessor.js:137:20)
    at Timeout.ontimeout [as _repeat] (timers.js:392:34)
    at Timeout.wrapper [as _onTimeout] (timers.js:417:11)
    at tryOnTimeout (timers.js:224:11)
    at Timer.listOnTimeout (timers.js:198:5)

Should I create a separate issue?

@reuben453
Copy link

reuben453 commented Nov 1, 2017

Line 151 of /node_modules/swagger-stats/lib/swsCoreStats.js:151 is:
this.promClientMetrics.nodejs_process_memory_external_bytes.set(this.sys.external);

I checked the this.sys content :

this.sys { rss: 115826688,
  heapTotal: 93437952,
  heapUsed: 56715592,
  external: undefined,
  cpu: 11.12675279025026 }

@sv2
Copy link
Collaborator

sv2 commented Nov 1, 2017

@reuben453, yes, I believe it's the same issue. "external" is missing in process.memoryUsage() result; I've added fix to handle this properly, and will release version with this fix shortly. Thanks!

@sv2 sv2 added this to the 0.93.1 milestone Nov 2, 2017
@sv2
Copy link
Collaborator

sv2 commented Nov 2, 2017

addressed in 0.93.1

@sv2 sv2 closed this as completed Nov 2, 2017
@anija
Copy link
Author

anija commented Nov 6, 2017

Thank you!

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

No branches or pull requests

3 participants