-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Fetch returns: Error trying to connect: Connection reset by peer (os error 54) #6197
Comments
The URL Correct me, if I misinterpreted your issue. |
Yes thats correct i would like to do a.statuscode to know the http status code of the request. |
ConnectionReset: Connection reset by peer (os error 104)
|
@bartlomieju |
This error looks to be solved in 1.4:
|
Reopening because we're getting reports of a regression in Discord since at least 1.9, possibly earlier https://discord.com/channels/684898665143206084/689420767620104201/852181010614976533 |
I tried running the same on deno 1.4.0 and I am getting the same error.
|
I encountered this today as well:
and here's the beginning of the verbose
This seemed odd to me:
but I'm guessing it just means the server didn't accept http/2? |
As I said before, This problem is not about Deno itself. Reproduce steps with reqwest + rustls:Cargo.toml: [dependencies]
reqwest = { version = "0.11", default-features = false, features = ["rustls-tls", "json"] }
tokio = { version = "1", features = ["full"] } main.rs #[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let resp = reqwest::get("https://www.co.walton.fl.us/523/Morrison-Springs")
.await?
.text()
.await?;
println!("{:#?}", resp);
Ok(())
} output:
There's no problem if you use |
Hi I had a long running (ie several hours) simple Deno program that just loops a Not sure if it is relevant or related to the similar errors being reported on this issues - so just in case it is of help. Simon error: Uncaught (in promise) TypeError: error sending request for url (https://hacker-news.firebaseio.com/v0/item/28318840.json): connection error: Connection reset by peer (os error 54)
at deno:core/01_core.js:106:46
at unwrapOpResult (deno:core/01_core.js:126:13)
at async mainFetch (deno:ext/fetch/26_fetch.js:265:14) Extract of some of the code that cased the above error: const baseURL = "https://hacker-news.firebaseio.com/v0";
async function getItemByID(id: number): Promise<Item | undefined> {
const endpoint = `${baseURL}/item/${id}.json`;
const res = await fetch(endpoint);
const item = await res.json();
return item ?? undefined;
}
while (true) {
const item = await getItemByID(id);
// If item does not exists - pause
if (!item) {
await delay(60 * 1000);
continue;
}
// NB rest of code not shown as probably not relevant Deno Version:
OS: Apple macOS 'Big Sur' version 11.5.2 |
has anyone had a proper solution on this? actually trying this from postman code snippet: js - fetch but still getting the error above.
appreciate if anyone can help thank you |
I have the same problem
Deno Version:
centos8 |
Verified:
|
I'm having the same issue with firebase. (exact same code works fine with node) Code snippet:
Throws as follows:
As I mentioned, exact same code works fine with node. |
The issue is still unsolved in: deno 1.37.2 (release, aarch64-apple-darwin) Most external https URLs I try to fetch result in the following error:
Curl says:
Almost always I try to start a project with Deno I end up with this, for the past two years, making it impossible to use Deno or Deno Deploy. The same fetch works in Node, Bun, and literally every other runtime/language I tried. |
@louis77, can you provide a snippet? I'm unsure of your use case, but are you aware of |
@iuioiua I've tried with Deno.HttpClient, but it has the same problem. There is nothing wrong with the certificate of the remote, it seems to be a TLS issue that Deno struggles with. It is just a single line of fetch: const resp = await fetch(myUrl, {
headers: {
'Authorization': `Basic ${btoa('[user:pass]')}`,
},
}) With that line, I immediately get the Unfortunately I can't share the remote URL here, but if you are on Discord or somewhere I'd be glad to send you the full fetch line so you can test it on your side. |
I found this same error, and got stuck since I am not able to connect to the provider's API. Exactly same fetch work perfectly fine with Node: deno 1.37.2 (release, aarch64-apple-darwin) error:
curl -v:
|
Came across the same issue yesterday. App has been operating fine then yesterday with no apparent changes, started seeing the same error for calls to external APIs and APIs from apps running in docker on the same machine. |
I am getting this in an import statement:
|
let a = await fetch('https://pictures.vwe.nl'); console.log(a)
Returns "Error trying to connect: Connection reset by peer (os error 54)"
deno --version
The text was updated successfully, but these errors were encountered: