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

handlemultipartupload seems to no work #314

Closed
germsb opened this issue Oct 10, 2024 · 11 comments · Fixed by #318
Closed

handlemultipartupload seems to no work #314

germsb opened this issue Oct 10, 2024 · 11 comments · Fixed by #318
Labels
bug Something isn't working

Comments

@germsb
Copy link

germsb commented Oct 10, 2024

Describe the bug
handlemultipartupload systematically returns an error

https://localhost:3000/api/files/multipart/create/google-chrome-stable_current_amd64.deb 400 (Bad Request)
Uncaught (in promise) FetchError: [POST] "/api/files/multipart/create/google-chrome-stable_current_amd64.deb": 400 Bad Request
    at async $fetch2 (ofetch.4747642d.mjs?v=d7c0ec42:304:15)

Steps to reproduce
Example in the doc or in the playground

PS: I use remote storage for dev, and everything works normally apart from this

@atinux
Copy link
Contributor

atinux commented Oct 11, 2024

I cannot reproduce your issue, tested on:

  • pnpm dev
  • pnpm dev --remote
  • deployed playground
CleanShot.2024-10-11.at.14.59.23.mp4

@germsb
Copy link
Author

germsb commented Oct 11, 2024

I copied and pasted the different APIs as well as the content of the blob.vue page into my project, and I’m still get the same error. I admit I don’t understand.

Capture d’écran du 2024-10-11 20-21-13

Capture d’écran du 2024-10-11 20-22-20

Capture.video.du.2024-10-11.20-41-37.webm

chrome devtool response

{
    "url": "/api/blob/multipart/create/GX010179.MP4",
    "statusCode": 400,
    "statusMessage": "",
    "message": "[POST] \"https://XXXXXXXXXXXXX.pages.dev/api/_hub/blob/multipart/GX010179.MP4\": 404 Page not found: /api/_hub/blob/multipart/GX010179.MP4",
    "stack": "<pre><span class=\"stack internal\">at createError (./node_modules/h3/dist/index.mjs:78:15)</span>\n<span class=\"stack internal\">at createHandler (./node_modules/@nuxthub/core/dist/runtime/blob/server/utils/blob.js:302:13)</span>\n<span class=\"stack internal\">at process.processTicksAndRejections (node:internal/process/task_queues:95:5)</span>\n<span class=\"stack internal\">at handler (./node_modules/@nuxthub/core/dist/runtime/blob/server/utils/blob.js:369:15)</span>\n<span class=\"stack internal\">at Object.handleMultipartUpload (./node_modules/@nuxthub/core/dist/runtime/blob/server/utils/blob.js:393:20)</span>\n<span class=\"stack\">at Object.handler (./server/api/blob/multipart/[action]/[...pathname].ts:2:1)</span>\n<span class=\"stack internal\">at async ./node_modules/h3/dist/index.mjs:1978:19</span>\n<span class=\"stack internal\">at async Object.callAsync (./node_modules/unctx/dist/index.mjs:72:16)</span>\n<span class=\"stack internal\">at async Object.callAsync (./node_modules/unctx/dist/index.mjs:72:16)</span>\n<span class=\"stack internal\">at async Server.toNodeHandle (./node_modules/h3/dist/index.mjs:2270:7)</span></pre>"
}

EDIT: After some investigation,

  • it works with 'npx nuxthub preview' (local storage)
  • it works after deploy (push commit on the edge)
    ( despite concurrent set to 10, the upload speed is rather low, 128mb/s while my connection allows 2300mb/s )
  • It does not work with 'npm run dev' despite remote set to true
    ( other blobhub methods like list serve handleupload ... work fine)
$development: {
        hub: {
            remote: true
        }
    },

Wouldn't it be a url malformation error? what is /_hub/ of
"[POST] \"https://XXXXXXXXXXXXX.pages.dev/api/_hub/blob/multipart/GX010179.MP4\"

Copy link
Contributor

atinux commented Oct 13, 2024

Thank you so much for being so helpful on it, I can reproduce, will fix it quickly! Sorry about this!

@atinux atinux added the bug Something isn't working label Oct 13, 2024
@atinux
Copy link
Contributor

atinux commented Oct 13, 2024

Hey @germsb

Could you try with:

pnpm add https://pkg.pr.new/nuxt-hub/core/@nuxthub/core@318

Then try again with nuxi dev --remote and confirm me that it fixes it? (no need to deploy anything normally)

@germsb
Copy link
Author

germsb commented Oct 14, 2024

Hello @atinux
Everything works perfectly now with this version @nuxthub/core@0.7.28-20241014-100530-cb2eb4e
Thank you very much for your responsiveness.

Capture.video.du.2024-10-14.12-23-04.webm

@atinux
Copy link
Contributor

atinux commented Oct 14, 2024

Awesome ❤️

@zaosoula
Copy link

Hi @atinux, while using "@nuxthub/core": "^0.7.33" I got the exact same problem

@zaosoula
Copy link

Without enabling remote, the error message is more complete :

{
    "url": "/api/files/multipart/upload/Screenshot%202024-10-17%20at%2016.18.24.png?uploadId=tsRqrV0JSsAz-KU9YJsFbkkxmrrDF7fZa1MbfzYYw4ejgq8ynzD2oh0GaL3YCbacxZ1Q6fRXMMe7IE1rn9-h4PVdBqDQT2L6WgMyodS62Pg5TMulzscZJCTfu9N2Qf2Ea94X7Kcvng1LECbdZp0lPJZv0fAFc3WxOpVFVCTcXr0&partNumber=1",
    "statusCode": 400,
    "statusMessage": "",
    "message": "uploadPart: The specified multipart upload does not exist. (10024)",
    "stack": "<pre><span class=\"stack internal\">at createError (./node_modules/h3/dist/index.mjs:78:15)</span>\n<span class=\"stack internal\">at uploadHandler (./node_modules/@nuxthub/core/dist/runtime/blob/server/utils/blob.js:345:13)</span>\n<span class=\"stack internal\">at process.processTicksAndRejections (node:internal/process/task_queues:95:5)</span>\n<span class=\"stack internal\">at handler (./node_modules/@nuxthub/core/dist/runtime/blob/server/utils/blob.js:397:15)</span>\n<span class=\"stack internal\">at Object.handleMultipartUpload (./node_modules/@nuxthub/core/dist/runtime/blob/server/utils/blob.js:415:20)</span>\n<span class=\"stack\">at Object.handler (./server/api/files/multipart/[action]/[...pathname].ts:2:1)</span>\n<span class=\"stack internal\">at async ./node_modules/h3/dist/index.mjs:1975:19</span>\n<span class=\"stack internal\">at async Object.callAsync (./node_modules/unctx/dist/index.mjs:72:16)</span>\n<span class=\"stack internal\">at async Object.callAsync (./node_modules/unctx/dist/index.mjs:72:16)</span>\n<span class=\"stack internal\">at async Server.toNodeHandle (./node_modules/h3/dist/index.mjs:2266:7)</span></pre>"
}

Screenshot 2024-10-18 at 12 04 47

@zaosoula
Copy link

🙌 The error only appends when the filename contains spaces (ex: Screenshot 2024-10-15 at 16.05.37.png)

Copy link
Contributor

atinux commented Oct 19, 2024

Could you test with 0.7.34 please?

@zaosoula
Copy link

@atinux Problem solved thank you!

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
None yet
Development

Successfully merging a pull request may close this issue.

3 participants