CDLUC3 / dmptool

DMPTool version of the DMPRoadmap codebase
https://dmptool.org
MIT License
56 stars 13 forks source link

Can't upload logos for organizations #620

Open bofstein opened 4 days ago

bofstein commented 4 days ago

Describe the bug Unable to add a logo to organization. After adding an eligible image, it fails to save with an error message that it's not the right file type.

To Reproduce

  1. Log in to DMPTool as a superadmin
  2. Open any organization without a logo
  3. Try to add an eligible file (correct format, reasonable size)
  4. Click Save at the bottom
  5. Observe an error message at the top that it's not the right file size

Expected behavior Can upload a JPG or PNG as an org logo

Screenshots image

Additional context Reported by a new user trying to add a logo

briri commented 4 days ago

Server logs report:

D, [2024-06-28T09:53:25.913903 #310147] DEBUG -- : [49c6262b-6e00-4f00-a57b-c8e6e4330475] DRAGONFLY: shell command: identify -ping -format \%m\ \%w\ \%h /tmp/RackMultipart20240628-310147-43ajt3.png
W, [2024-06-28T09:53:25.916299 #310147]  WARN -- : [49c6262b-6e00-4f00-a57b-c8e6e4330475] DRAGONFLY: validation of property format of logo failed with error Command failed: identify -ping -format \%m\ \%w\ \%h /tmp/RackMultipart20240628-310147-43ajt3.png, exit status: 127, error: sh: line 1: identify: command not found

D, [2024-06-28T09:53:25.917440 #310147] DEBUG -- : [49c6262b-6e00-4f00-a57b-c8e6e4330475]   TRANSACTION (0.9ms)  ROLLBACK

@jupiter007 reports that it is working locally which means that it may be related to the servers. We store the logos in S3 in both stage and prod.

bofstein commented 4 days ago

Still happens if I remove space from the file name to rule that out as an issue

briri commented 4 days ago

The server log shows the error is with /tmp/RackMultipart20240628-310147-43ajt3.png which is an interim file used to process the image before the final fiel is stored in S3. Dragonfly takes the uploaded file and resizes if necessary. I suspect that it is having trouble writing to disk perhaps and is flagging it as the wrong format because the file is empty. This is probably related to the new OS.