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

Download file from Cloudflare storage is not working #240

Open
kaichaosun opened this issue Feb 8, 2023 · 1 comment
Open

Download file from Cloudflare storage is not working #240

kaichaosun opened this issue Feb 8, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@kaichaosun
Copy link
Contributor

kaichaosun commented Feb 8, 2023

In ad4m app, when downloading file from Cloudflare storage, it first gets the presigned url from cloudflare worker, the url looks like this,

https://c47108641b30e868d9950f1adf09c9b1.r2.cloudflarestorage.com/centralized-bootstrap-store/QmZ16K5HG2RgE6Q8xCC5784HG2KGyKPKtkNmGiDb9YQKZg?X-Amz-Date=20230221T014811Z&X-Amz-Expires=86400&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=38a4e3dfb132248c1b6e07389f77691e%2F20230221%2Fauto%2Fs3%2Faws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=33fe05ee13446cc277fb65691da0791f2a5c8600190deae246d8c006a73be0c1

It works when I open the above link in browser, but with Nodejs it's broken with ECONNRESET error.

with node-fetch lib, the error is,

FetchError: Invalid response body while trying to fetch https://c47108641b30e868d9950f1adf09c9b1.r2.cloudflarestorage.com/centralized-bootstrap-store/QmZ16K5HG2RgE6Q8xCC5784HG2KGyKPKtkNmGiDb9YQKZg?X-Amz-Date=20230208T172826Z&X-Amz-Expires=86400&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=dbf72009eacc00a2e739260e0105fe65%2F20230208%2Fauto%2Fs3%2Faws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=58d40edc56f47946c905bebb871e7f826fdf5673d8e01a679dc4b56ff27fb9ea: Premature close
    at Gunzip.<anonymous> (/Users/kaichaosun/github/flux/language-persistence/node_modules/node-fetch/lib/index.js:400:12)
    at Gunzip.emit (node:events:525:35)
    at Gunzip.emit (node:domain:489:12)
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  type: 'system',
  errno: 'ERR_STREAM_PREMATURE_CLOSE',
  code: 'ERR_STREAM_PREMATURE_CLOSE'
}

with axios lib, the error is,

cause: Error: aborted
      at connResetException (node:internal/errors:705:14)
      at TLSSocket.socketCloseListener (node:_http_client:454:19)
      at TLSSocket.emit (node:events:525:35)
      at TLSSocket.emit (node:domain:489:12)
      at node:net:301:12
      at TCP.done (node:_tls_wrap:588:7) {
    code: 'ECONNRESET'
  }

Reproduce steps,

Potential related issues,
serverless-dns/serverless-dns#115
axios/axios#5267

@kaichaosun kaichaosun added the bug Something isn't working label Feb 8, 2023
@lucksus
Copy link
Member

lucksus commented Feb 8, 2023

I had similar weird connection problems to AD4M executor localhost in the JS integration tests. localhost worked but 127.0.0.1 did not (or other way round). The culprit was my VPN. Deactivating the VPN and restarted fixed that. Maybe similar problem here?

Either way, I hope we can get rid of the centralised bootstrap languages soon. We have the large file storage on Holochain in the current sprint..

@tomisparker tomisparker added this to the AD4M is stable and ready for Alpha testing milestone Feb 9, 2023
@lucksus lucksus moved this to Backlog in AD4M development Feb 20, 2023
@kaichaosun kaichaosun changed the title Central bootstrap store with worker is not working stably Download file from Cloudflare storage is not working Feb 21, 2023
@leifriksheim leifriksheim modified the milestones: AD4M is stable and ready for Alpha testing, AD4M Launcher V1 Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

4 participants