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

AssertionError [ERR_ASSERTION]: false == true #26351

Closed
dhirendrx opened this issue Feb 28, 2019 · 8 comments
Closed

AssertionError [ERR_ASSERTION]: false == true #26351

dhirendrx opened this issue Feb 28, 2019 · 8 comments
Labels
https Issues or PRs related to the https subsystem.

Comments

@dhirendrx
Copy link

I've had several crashes with the following stack trace:

AssertionError [ERR_ASSERTION]: false == true 
	at TLSSocket.socketOnData (_http_client.js:440:3) 
	at TLSSocket.emit (events.js:182:13) 
	at TLSSocket.EventEmitter.emit (domain.js:441:20) 
	at addChunk (_stream_readable.js:283:12) 
	at readableAddChunk (_stream_readable.js:264:11) 
	at TLSSocket.Readable.push (_stream_readable.js:219:10) 
	at TLSWrap.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)

Additional Data:

{
	"exception": true,
	"process": {
		"pid": 23,
		"uid": 9650,
		"gid": 9650,
		"cwd": "/app",
		"execPath": "/app/.heroku/node/bin/node",
		"version": "v10.15.0",
		"argv": ["/app/.heroku/node/bin/node", "/app/index.js"],
		"memoryUsage": {
			"rss": 46530560,
			"heapTotal": 23314432,
			"heapUsed": 16223184,
			"external": 2192073
		}
	},
	"os": {
		"loadavg": [4.31787109375, 6.36376953125, 7.2197265625],
		"uptime": 450007
	},
	"trace": [
	{"column": 3, "file": "_http_client.js", "function": "TLSSocket.socketOnData", "line": 440, "method": "socketOnData", "native": false},
	{"column": 13, "file": "events.js", "function": "TLSSocket.emit", "line": 182, "method": "emit", "native": false},
	{"column": 20, "file": "domain.js", "function": "TLSSocket.EventEmitter.emit", "line": 441, "method": "emit", "native": false},
	{"column": 12, "file": "_stream_readable.js", "function": "addChunk", "line": 283, "method": null, "native": false},
	{"column": 11, "file": "_stream_readable.js", "function": "readableAddChunk", "line": 264, "method": null, "native": false},
	{"column": 10, "file": "_stream_readable.js", "function": "TLSSocket.Readable.push", "line": 219, "method": "push", "native": false},
	{"column": 17, "file": "internal/stream_base_commons.js", "function": "TLSWrap.onStreamRead [as onread]", "line": 94, "method": "onStreamRead [as onread]", "native": false}
	]
}
@sam-github
Copy link
Contributor

@nodejs/http

I don't have any insight. Too bad the assert(parser && parser.socket === socket); wasn't two seperate asserts. I wonder if parser.socket is the underlying net socket, and not the TLS socket?

@dhirendra24 Reproduction can be difficult, for you as well as us, but it would be helpful to have more information on the app.

@dhirendrx
Copy link
Author

@sam-github

It is a really simple app with a single endpoint using micro and calling an another endpoint using axios. Other than that, it is using dotenv, winston & @sentry/node.
From the logs, it looks like it happens when axios throws an Error.

@sam-github
Copy link
Contributor

Do you have the stacktrace from the error Axios threw? If it was thrown from inside a callback or event listener (which is pretty likely) its possible the error passed up through node.js core js and left its internal state in a mess.

@lpinca lpinca added the https Issues or PRs related to the https subsystem. label Mar 3, 2019
@dhirendrx
Copy link
Author

Stacktrace from axios error is

Error: Request failed with status code 400 
	at createError (/app/node_modules/axios/lib/core/createError.js:16:15) 
	at settle (/app/node_modules/axios/lib/core/settle.js:18:12) 
	at IncomingMessage.handleStreamEnd (/app/node_modules/axios/lib/adapters/http.js:201:11) 
	at IncomingMessage.emit (events.js:187:15) 
	at IncomingMessage.EventEmitter.emit (domain.js:441:20) 
	at endReadableNT (_stream_readable.js:1094:12) 
	at process._tickCallback (internal/process/next_tick.js:63:19)

@jasnell
Copy link
Member

jasnell commented Jun 26, 2020

Without more information this is not actionable. Closing. Can reopen if new information is available.

@jasnell jasnell closed this as completed Jun 26, 2020
@deStMathieu
Copy link

What steps will reproduce the bug?

You just need to run prettier on this file, using the html parser:

<aura:component
controller="Controller"
>
  <img src="test.jpg"> I break</img>
</aura:component>

Notice that there is no space between I break and the invalid </img> tag. Putting a space there or removing the invalid tag resolves the issue. Other tags, such as nesting into a template or html > body do not matter.

What is the expected behavior?

(This is secondary on this repo)
Prettier is otherwise able to run on aura files. I should get either a syntax error or a positive check (need-to-format) on the file, which I get by adding the aforementioned space, but the parser breaks before.
(Primary)
The error raised should be descriptive enough to understand that this is a parsing error. Alternatively, handle the underlying error to continue parsing safely.

What do you see instead?

test.html[error] test.html: AssertionError [ERR_ASSERTION]: false == true
[error]     at printClosingTagStartMarker (static/path/Test-repo/node_modules/prettier/index.js:58525:29)
[error]     at printClosingTagSuffix (static/path/Test-repo/node_modules/prettier/index.js:58475:59)
[error]     at Object.genericPrint$1 [as print] (static/path/Test-repo/node_modules/prettier/index.js:58158:101)
[error]     at callPluginPrintFunction (static/path/Test-repo/node_modules/prettier/index.js:14926:21)
[error]     at mainPrintInternal (static/path/Test-repo/node_modules/prettier/index.js:14864:17)
[error]     at mainPrint (static/path/Test-repo/node_modules/prettier/index.js:14846:14)
[error]     at printChild (static/path/Test-repo/node_modules/prettier/index.js:58276:12)
[error]     at static/path/Test-repo/node_modules/prettier/index.js:58224:14
[error]     at static/path/Test-repo/node_modules/prettier/index.js:14634:23
[error]     at AstPath.each (static/path/Test-repo/node_modules/prettier/index.js:14621:7)

Additional information

I did not register a separate bug because it's not really terrible in my use case, but found very little information online about that error, stumbled upon this post, and thought that you could use more informations on this bug, because I think it is the same bug in both cases. Obviously using prettier I can understand that this is a parsing error, but it will be confusing for other modules, such as in OP's case.

@BridgeAR
Copy link
Member

@deStMathieu your error is independent from the one originally reported here (even though it shares the same message). If you look at the stack trace you can see that it occurred inside prettier. You could as such check prettier's issue tracker.

@deStMathieu
Copy link

Duly noted. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
https Issues or PRs related to the https subsystem.
Projects
None yet
Development

No branches or pull requests

6 participants