andrinheusser
andrinheusser
DDeno
Created by andrinheusser on 9/23/2023 in #help
Troubleshooting deno.land downloads
I have docker containers, within a minikube cluster, that have trouble downloading https://deno.land/ sources. Files at raw.githubusercontent.com work fine, but files at deno.land result in "Connection reset by peer". Any ideas what's going on? I also observed this behavior when running a container directly: (Seems downloading from raw.githubusercontent.com works just fine, but then downloading from deno.land doesn't)
nrk@SAMWAF:~$ docker run -it --init denoland/deno:1.37.0 repl
[WARN tini (7)] Tini is not running as PID 1 and isn't registered as a child subreaper.
Zombie processes will not be re-parented to Tini, so zombie reaping won't work.
To fix the problem, use the -s option or set the environment variable TINI_SUBREAPER to register Tini as a child subreaper, or run Tini as PID 1.
Deno 1.37.0
exit using ctrl+d, ctrl+c, or close()
> import { assert } from "https://deno.land/std/assert/mod.ts"
✅ Granted net access to "deno.land".
Uncaught TypeError: Import 'https://deno.land/std/assert/mod.ts' failed: error sending request for url (https://deno.land/std/assert/mod.ts): error trying to connect: Connection reset by peer (os error 104)
at async <anonymous>:2:20
> import * as amqp from "https://raw.githubusercontent.com/lenkan/deno-amqp/master/mod.ts"
✅ Granted net access to "raw.githubusercontent.com".
Uncaught TypeError: Import 'https://deno.land/std@0.165.0/io/mod.ts' failed: error sending request for url (https://deno.land/std@0.165.0/io/mod.ts): error trying to connect: Connection reset by peer (os error 104)
at https://raw.githubusercontent.com/lenkan/deno-amqp/master/deps.ts:1:35
at async <anonymous>:2:14
>
nrk@SAMWAF:~$ docker run -it --init denoland/deno:1.37.0 repl
[WARN tini (7)] Tini is not running as PID 1 and isn't registered as a child subreaper.
Zombie processes will not be re-parented to Tini, so zombie reaping won't work.
To fix the problem, use the -s option or set the environment variable TINI_SUBREAPER to register Tini as a child subreaper, or run Tini as PID 1.
Deno 1.37.0
exit using ctrl+d, ctrl+c, or close()
> import { assert } from "https://deno.land/std/assert/mod.ts"
✅ Granted net access to "deno.land".
Uncaught TypeError: Import 'https://deno.land/std/assert/mod.ts' failed: error sending request for url (https://deno.land/std/assert/mod.ts): error trying to connect: Connection reset by peer (os error 104)
at async <anonymous>:2:20
> import * as amqp from "https://raw.githubusercontent.com/lenkan/deno-amqp/master/mod.ts"
✅ Granted net access to "raw.githubusercontent.com".
Uncaught TypeError: Import 'https://deno.land/std@0.165.0/io/mod.ts' failed: error sending request for url (https://deno.land/std@0.165.0/io/mod.ts): error trying to connect: Connection reset by peer (os error 104)
at https://raw.githubusercontent.com/lenkan/deno-amqp/master/deps.ts:1:35
at async <anonymous>:2:14
>
6 replies
DDeno
Created by andrinheusser on 3/3/2023 in #help
Sequentially write to TPC connection
Hey, I experience errors when multiple async functions write to a TCP (Deno.Conn) connection. How can I make sure my data is sent fully, even if it can't be written to the send buffer in one function call? Using this code, I observed data (buf) being written partially, then data from other async functions being written before the remainder of the partially written data is written.
const id = (Math.random() + 1).toString(36).substring(7);
let nwritten = 0;
let pass = 0;
while (nwritten < buf.byteLength) {
console.log(id, pass - 1, 'starting pass ', pass, { nwritten, length: buf.byteLength })

nwritten += await this.#conn.write(buf.subarray(nwritten));

console.log(id, pass, ' written: ' + `${nwritten} / ${buf.byteLength}`);
pass++;
}
console.log(id, pass, ' fininshed writing: ' + nwritten + ' / ' + buf.length)
const id = (Math.random() + 1).toString(36).substring(7);
let nwritten = 0;
let pass = 0;
while (nwritten < buf.byteLength) {
console.log(id, pass - 1, 'starting pass ', pass, { nwritten, length: buf.byteLength })

nwritten += await this.#conn.write(buf.subarray(nwritten));

console.log(id, pass, ' written: ' + `${nwritten} / ${buf.byteLength}`);
pass++;
}
console.log(id, pass, ' fininshed writing: ' + nwritten + ' / ' + buf.length)
3 replies