Skip to content

AssertionError [ERR_ASSERTION]: false == true #26351

Description

@dhirendra-linq

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}
	]
}

Activity

  1. sam-github commented on Feb 28, 2019

    @sam-github
    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.

  2. dhirendra-linq commented on Mar 1, 2019

    @dhirendra-linq
    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.

  3. sam-github commented on Mar 1, 2019

    @sam-github
    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.

  4. added
    httpsIssues and PRs related to the https subsystem.
    on Mar 3, 2019
  5. dhirendra-linq commented on Mar 4, 2019

    @dhirendra-linq
    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)
    
  6. jasnell commented on Jun 26, 2020

    @jasnell
    Member

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

  7. deStMathieu commented on Jun 23, 2021

    @deStMathieu

    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.

  8. BridgeAR commented on Jun 23, 2021

    @BridgeAR
    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.

  9. deStMathieu commented on Jun 23, 2021

    @deStMathieu

    Duly noted. Cheers!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    httpsIssues and PRs related to the https subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions