Skip to content

UploadThing Storage Plugin - Media Creation Fails with Key Extraction Error #12455

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

Open
viniciuslk opened this issue May 20, 2025 · 0 comments
Open
Labels
status: needs-triage Possible bug which hasn't been reproduced yet

Comments

@viniciuslk
Copy link

Describe the Bug

When attempting to create new media files using the UploadThing storage plugin, the system fails with an "unable to extract key from doc" error. This occurs during the initial file upload and creation process in the media collection.

Link to the code that reproduces this issue

https://github.com/viniciuslk/payload-cms-uploadthing-error-reproduction

Reproduction Steps

  1. Set up a Payload CMS project with UploadThing storage plugin
  2. Configure the plugin with the following settings:
uploadthingStorage({
  collections: {
    media: true,
  },
  options: {
    token: process.env.UPLOADTHING_TOKEN,
    acl: 'public-read',
  },
})
  1. Navigate to the admin interface
  2. Go to Media collection
  3. Attempt to upload a new media file
  4. Observe the error in the console

Expected Behavior

The media file should be successfully uploaded and created in the UploadThing storage, with all necessary file transformations (different sizes) being processed correctly.

Actual Behavior

The system throws the following errors during file creation:

[ERROR] Error deleting file: aspect-ratio-9-16-2.jpg - unable to extract key from doc
[ERROR] Error deleting file: aspect-ratio-9-16-2-300x452.jpg - unable to extract key from doc
[ERROR] Error deleting file: aspect-ratio-9-16-2-500x500.jpg - unable to extract key from doc
[ERROR] Error deleting file: aspect-ratio-9-16-2-600x904.jpg - unable to extract key from doc
[ERROR] Error deleting file: aspect-ratio-9-16-2-1200x630.jpg - unable to extract key from doc
[ERROR] There was an error while uploading files corresponding to the collection media with filename aspect-ratio-9-16-3.jpg

Which area(s) are affected? (Select all that apply)

plugin: other

Environment Info

Binaries:
  Node: 22.12.0
  npm: 10.9.0
  Yarn: 1.22.19
  pnpm: 9.15.0
Relevant Packages:
  payload: 3.33.0
  next: 15.3.0
  @payloadcms/email-nodemailer: 3.33.0
  @payloadcms/graphql: 3.33.0
  @payloadcms/live-preview: 3.33.0
  @payloadcms/live-preview-react: 3.33.0
  @payloadcms/next/utilities: 3.33.0
  @payloadcms/payload-cloud: 3.33.0
  @payloadcms/plugin-cloud-storage: 3.38.0
  @payloadcms/plugin-form-builder: 3.33.0
  @payloadcms/plugin-nested-docs: 3.33.0
  @payloadcms/plugin-redirects: 3.33.0
  @payloadcms/plugin-search: 3.33.0
  @payloadcms/plugin-seo: 3.33.0
  @payloadcms/richtext-lexical: 3.33.0
  @payloadcms/storage-uploadthing: 3.38.0
  @payloadcms/translations: 3.33.0
  @payloadcms/ui/shared: 3.33.0
  react: 19.1.0
  react-dom: 19.1.0
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.3.0: Thu Jan  2 20:24:16 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6000
  Available memory (MB): 16384
  Available CPU cores: 8
@viniciuslk viniciuslk added status: needs-triage Possible bug which hasn't been reproduced yet validate-reproduction Auto-added tag on create to tell bot to check recreation URL, removed after check. labels May 20, 2025
@github-actions github-actions bot removed the validate-reproduction Auto-added tag on create to tell bot to check recreation URL, removed after check. label May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs-triage Possible bug which hasn't been reproduced yet
Projects
None yet
Development

No branches or pull requests

1 participant