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

🐛 BUG: r2 object put with --file not work #6642

Open
shama265 opened this issue Sep 6, 2024 · 2 comments
Open

🐛 BUG: r2 object put with --file not work #6642

shama265 opened this issue Sep 6, 2024 · 2 comments
Labels
bug Something that isn't working r2 Relating to R2

Comments

@shama265
Copy link

shama265 commented Sep 6, 2024

Which Cloudflare product(s) does this pertain to?

R2

What version(s) of the tool(s) are you using?

3.74.0

What version of Node are you using?

v20.17.0

What operating system and version are you using?

Debian 12

Describe the Bug

Observed behavior

r2 object put is failure, cause error fetch failed.
The file is not uploaded to bucket.

Expected behavior

Upload to my bucket

Steps to reproduce

  • yarn wrangler r2 object put some-bucket/somefile.txt --file=somefile.txt

Appendix

Instead of using --pipe, upload is complete.

$ cat backup.sh | yarn wrangler r2 object put sample-st/backup.sh --pipe

 ⛅️ wrangler 3.74.0
-------------------

Creating object "backup.sh" in bucket "sample-st".
Upload complete.

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

(shell)

$ yarn wrangler r2 object put mc-backup/backup.sh --file=backup.sh

 ⛅️ wrangler 3.74.0
-------------------

Creating object "backup.sh" in bucket "mc-backup".

✘ [ERROR] fetch failed

(log)

--- 2024-09-06T04:57:07.553Z debug
🪵  Writing logs to "/home/******/.config/.wrangler/logs/wrangler-2024-09-06_04-57-07_378.log"
---

--- 2024-09-06T04:57:07.553Z debug
Failed to load .env file ".env": Error: ENOENT: no such file or directory, open '.env'
    at Object.openSync (node:fs:573:18)
    at NodeFS.openSync (/home/******/mc-backup-tool/.pnp.cjs:3559:24)
    at makeCallSync.subPath.subPath (/home/******/mc-backup-tool/.pnp.cjs:4035:26)
    at ZipOpenFS.makeCallSync (/home/******/mc-backup-tool/.pnp.cjs:4687:14)
    at ZipOpenFS.openSync (/home/******/mc-backup-tool/.pnp.cjs:4034:17)
    at VirtualFS.openSync (/home/******/mc-backup-tool/.pnp.cjs:3292:24)
    at PosixFS.openSync (/home/******/mc-backup-tool/.pnp.cjs:3292:24)
    at NodePathFS.openSync (/home/******/mc-backup-tool/.pnp.cjs:3292:24)
    at Object.readFileSync (node:fs:452:35)
    at NodeFS.readFileSync (/home/******/mc-backup-tool/.pnp.cjs:3872:24) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '.env'
}
---

--- 2024-09-06T04:57:07.562Z log

 ⛅️ wrangler 3.74.0
�[38;5;214m-------------------�[39m

---

--- 2024-09-06T04:57:07.563Z debug
No experimental flag store instantiated
---

--- 2024-09-06T04:57:07.563Z debug
Attempted to use flag "JSON_CONFIG_FILE" which has not been instantiated
---

--- 2024-09-06T04:57:07.568Z log
Creating object "hoge.txt" in bucket "sample-st".
---

--- 2024-09-06T04:57:07.874Z log

---

--- 2024-09-06T04:57:08.037Z error
�[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mfetch failed�[0m


---

--- 2024-09-06T04:57:08.038Z log
�[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose�[0m
---

--- 2024-09-06T04:57:09.720Z debug
Sentry: Capturing exception TypeError: fetch failed
---

(log, using --pipe)


--- 2024-09-06T04:46:14.119Z debug
🪵  Writing logs to "/home/******/.config/.wrangler/logs/wrangler-2024-09-06_04-46-13_946.log"
---

--- 2024-09-06T04:46:14.119Z debug
Failed to load .env file ".env": Error: ENOENT: no such file or directory, open '.env'
    at Object.openSync (node:fs:573:18)
    at NodeFS.openSync (/home/******/mc-backup-tool/.pnp.cjs:3559:24)
    at makeCallSync.subPath.subPath (/home/******/mc-backup-tool/.pnp.cjs:4035:26)
    at ZipOpenFS.makeCallSync (/home/******/mc-backup-tool/.pnp.cjs:4687:14)
    at ZipOpenFS.openSync (/home/******/mc-backup-tool/.pnp.cjs:4034:17)
    at VirtualFS.openSync (/home/******/mc-backup-tool/.pnp.cjs:3292:24)
    at PosixFS.openSync (/home/******/mc-backup-tool/.pnp.cjs:3292:24)
    at NodePathFS.openSync (/home/******/mc-backup-tool/.pnp.cjs:3292:24)
    at Object.readFileSync (node:fs:452:35)
    at NodeFS.readFileSync (/home/******/mc-backup-tool/.pnp.cjs:3872:24) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '.env'
}
---

--- 2024-09-06T04:46:14.132Z log

 ⛅️ wrangler 3.74.0
�[38;5;214m-------------------�[39m

---

--- 2024-09-06T04:46:14.133Z debug
No experimental flag store instantiated
---

--- 2024-09-06T04:46:14.133Z debug
Attempted to use flag "JSON_CONFIG_FILE" which has not been instantiated
---

--- 2024-09-06T04:46:14.138Z log
Creating object "backup.sh" in bucket "sample-st".
---

--- 2024-09-06T04:46:15.650Z log
Upload complete.
---
@shama265 shama265 added the bug Something that isn't working label Sep 6, 2024
@cloudcreatr
Copy link

/workspaces/uni-saas/node_modules/wrangler/wrangler-dist/cli.js:29768
            throw a;
            ^

Error [AssertionError]: false == true
    at new AssertionError (node-internal:internal_assertionerror:427:15)
    at assert (node-internal:internal_assert:49:15)
    at Native (file:///workspaces/uni-saas/node_modules/wrangler/node_modules/miniflare/src/workers/core/proxy.worker.ts:141:4)
    at hydrate (file:///workspaces/uni-saas/node_modules/wrangler/node_modules/.pnpm/[email protected]/node_modules/devalue/src/parse.js:60:32)
    at unflatten (file:///workspaces/uni-saas/node_modules/wrangler/node_modules/.pnpm/[email protected]/node_modules/devalue/src/parse.js:132:9)
    at parse (file:///workspaces/uni-saas/node_modules/wrangler/node_modules/.pnpm/[email protected]/node_modules/devalue/src/parse.js:16:9)
    at #fetch (file:///workspaces/uni-saas/node_modules/wrangler/node_modules/miniflare/src/workers/core/proxy.worker.ts:220:43)
    at ProxyServer.fetch (file:///workspaces/uni-saas/node_modules/wrangler/node_modules/miniflare/src/workers/core/proxy.worker.ts:164:22) {
  [cause]: undefined
}

Node.js v20.16.0
error: script "dev" exited with code 7

i cant even do multi part upload locally, looks like some issue locally

@edmundhung edmundhung added the r2 Relating to R2 label Sep 16, 2024
@edmundhung
Copy link
Member

edmundhung commented Sep 16, 2024

Hi @shama265

Thanks for reporting this issue! I tried to reproduce the problem on my end, but it seems to be working fine. Could you please try running the command again with WRANGLER_LOG="debug" set in your environment? This will provide more detailed logs that might help us troubleshoot the issue further.

Let me know if you notice anything unusual in the debug output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working r2 Relating to R2
Projects
Status: Untriaged
Development

No branches or pull requests

3 participants