directus / directus

The flexible backend for all your projects 🐰 Turn your DB into a headless CMS, admin panels, or apps with a custom UI, instant APIs, auth & more.
https://directus.io
Other
28.24k stars 3.93k forks source link

[Admin Dashboard] Media Upload with TUS_ENABLED #24056

Closed alexander-lipnitskiy closed 6 days ago

alexander-lipnitskiy commented 1 week ago

Describe the Bug

When TUS_ENABLED=true, it's break upload media file in Admin Dashboard { "stack": "Error: tus: unexpected response while uploading chunk\n at e.value (http://localhost:8055/admin/assets/index.D4bhBgpc.entry.js:65:8383)\n at http://localhost:8055/admin/assets/index.D4bhBgpc.entry.js:65:12103", "message": "tus: unexpected response while uploading chunk, originated from request (method: PATCH, url: http://localhost:8055//files/tus/cdc1d63609ced1c798ff06b9baf31c56, response code: 404, response text: {\"errors\":[{\"message\":\"Route //files/tus/cdc1d63609ced1c798ff06b9baf31c56 doesn't exist.\",\"extensions\":{\"path\":\"//files/tus/cdc1d63609ced1c798ff06b9baf31c56\",\"stack\":\"DirectusError: Route //files/tus/cdc1d63609ced1c798ff06b9baf31c56 doesn't exist.\n at notFound (d:\\Electron\\directus\\api\\src\\controllers\\not-found.ts:34:8)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\",\"code\":\"ROUTE_NOT_FOUND\"}}]}, request id: n/a)", "originalRequest": {}, "originalResponse": {}, "causingError": null }

To Reproduce

  1. TUS_ENABLED=true
  2. Open Dashboard App
  3. Try to upload media files

Directus Version

v11.2.1

Hosting Strategy

Self-Hosted (pnpm localhost)

Database

PostgreSQL16

ComfortablyCoding commented 1 week ago

This looks to be a misconfiguration as the PATCH request has an extra /. What is the public URL set to?

alexander-lipnitskiy commented 6 days ago

Yes, it's help me. Solution: replace PUBLIC_URL="http://localhost:8055/" to PUBLIC_URL="http://localhost:8055"