bageren
bageren10mo ago

TypeError [ERR_STREAM_NULL_VALUES]: May not write null values to stream

Our production server has started crashing frequently because of this error. At this point, we have to seriously consider moving back to Node, unless someone here can help. This is all the details we get when the error is thrown: TypeError [ERR_STREAM_NULL_VALUES]: May not write null values to stream at _write (ext:deno_node/_stream.mjs:3869:15) at Socket.Writable.write (ext:deno_node/_stream.mjs:3904:14) at nextWrite (file:///deno-dir/npm/registry.npmjs.org/postgres/3.4.3/src/connection.js:250:22) at eventLoopTick (ext:core/01_core.js:203:13) We are using Deno 1.45.2. I'd be happy to provide more details - just not sure what's relevant.
11 Replies
marvinh.
marvinh.10mo ago
That looks like a bug. Is it possible to create a reproduction case out of this? Like a snippet that is able to reproduce the error on its own?
bageren
bagerenOP10mo ago
Unfortunately I've not been able to find a way to reproduce it. All I know is that our E2E tests can't go all the way through without it happening. :/
Rowin
Rowin18h ago
Just ran into this too:
error: Uncaught TypeError: May not write null values to stream
at _write (ext:deno_node/internal/streams/writable.js:501:11)
at Socket.Writable.write (ext:deno_node/internal/streams/writable.js:555:10)
at nextWrite (file:///C:/Users/User/AppData/Local/deno/npm/registry.npmjs.org/postgres/3.4.5/src/connection.js:250:22)
at ext:deno_web/02_timers.js:35:14
at eventLoopTick (ext:core/01_core.js:213:13)
error: Uncaught TypeError: May not write null values to stream
at _write (ext:deno_node/internal/streams/writable.js:501:11)
at Socket.Writable.write (ext:deno_node/internal/streams/writable.js:555:10)
at nextWrite (file:///C:/Users/User/AppData/Local/deno/npm/registry.npmjs.org/postgres/3.4.5/src/connection.js:250:22)
at ext:deno_web/02_timers.js:35:14
at eventLoopTick (ext:core/01_core.js:213:13)
All I'm doing is a SELECT Works fine when I curl the endpoint, happens sometimes when I spam the endpoint with wrk @bageren what did you end up doing? @marvinh. I am able to reproduce it:
import postgres from "postgres";

const psql = postgres();

Deno.serve({ hostname: "0.0.0.0", port: 8080 }, async () => {
await psql`select * from information_schema.tables limit 1`;
return new Response("Hello!");
});
import postgres from "postgres";

const psql = postgres();

Deno.serve({ hostname: "0.0.0.0", port: 8080 }, async () => {
await psql`select * from information_schema.tables limit 1`;
return new Response("Hello!");
});
Run with: while true; do timeout 2 deno run -A index.ts; done Then run a couple instances of wrk like this: while true; do timeout -s 9 2 wrk http://127.0.0.1:8080/ -t1 -c256; done
Rowin
Rowin18h ago
No description
Rowin
Rowin18h ago
Running the server on Windows Postgres with Docker Desktop wrk with WSL
marvinh.
marvinh.18h ago
@Rowin Nice, perfect! Let's create an issue out of that https://github.com/denoland/deno/issues
Rowin
Rowin17h ago
Will do. Why are these both "CLI"?
No description
marvinh.
marvinh.17h ago
We usually make the distinction between Deno the CLI and Deno Deploy. In the past many users reported Deno Deploy issues in that tracker
Rowin
Rowin17h ago
Ah so CLI = runtime too?
marvinh.
marvinh.17h ago
yeah
bageren
bagerenOP13h ago
@Rowin migrated to Node, issue disappeared after that

Did you find this page helpful?