Image upload issue

Hello,

I think this fix https://github.com/discourse/discourse/commit/5deda5ef3ef8763dfe936a313e0dddaa279a1b04 is broke the multiple image upload. If i try to upload 3, ~5-6mb image it will not work, every time it shows this error. I think because of the 20sec timeout.

lib/discourse.rb:93:in 'exec': An error happened when converting from PNG to JPG.

Thank you :slight_smile:

Does this fail on this site? Can you try uploading the image (provided it is kids appropriate)

We need a limit here, we can not push it much beyond 20 seconds

1 Like

Hi Sam,
Last time I tried it faild here too that is why I categorized it as bug but now it uploaded. On my site it every time fail. Size ~6mb / photo

Oh this is tricky, I want to debug locally. Can you upload one of the original images somewhere for me to download so I can test how long the various image magick commands take.

I can consider adding a “longer timeout” site setting, but I am somewhat concerned converting this simple image from png → jpg is taking upwards of 10 seconds.

3 Likes

Thank you! I uploaded some images to Mega 80.42 MB folder on MEGA

Can you confirm you are on a standard docker install.

I just tested one of your images above, we run 2 commands in the container.

timeout -k 10.0 5 identify -format %Q image.jpg

and

timeout -k 40.0 20 convert jpeg:original.jpg -auto-orient -background white -interlace none -flatten -quality 90 jpg:/tmp/target.jpg

The first command takes 0.27 of the allotted 5 seconds on my local system.

The second command takes 1.3 seconds of the allotted 20 seconds.

Can you tell me a bit more about your install, and the particular performance of the server it is running on?

1 Like

Thank you Sam, to checked this. Yes standard docker install. Yesterday I upgraded the server because so much slow down the whole website also… And did a rebuild. With the server upgrade it works fine. Just tested now. Digital Ocean has a new plan about 2 month with Premium Intel CPU and the other which we had the Regular getting much weaker.

The old server :arrow_down_small:
Basic - Shared CPU 2 vCPUs 4 GB 60 GB

The new server :arrow_down_small:
Basic - Premium Intel Shared CPU 2 vCPUs 4 GB 60 GB

Sorry for this topic. 20 seconds is enough. And thank you again! :slightly_smiling_face:

1 Like

Yeah I think we are behaving correctly here.

If we do not timeout there is high risk that these under powered instances could get dominated by users uploading images. 20 seconds is a huge amount of CPU to give people for resizing images.

3 Likes

This topic was automatically closed after 15 hours. New replies are no longer allowed.