"Processing uploaded images"

Since upgrading to ST 8.0. We could not upload images to a listing.

Initially the photos were stuck at 0%, we then updated CORS configurations for both our images and images-tmp S3 buckets as follow:
image

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
    <AllowedOrigin>staging.freelensia.com</AllowedOrigin>
    <AllowedMethod>GET</AllowedMethod>
    <AllowedMethod>POST</AllowedMethod>
    <AllowedMethod>PUT</AllowedMethod>
    <AllowedMethod>HEAD</AllowedMethod>
    <MaxAgeSeconds>3000</MaxAgeSeconds>
    <AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>

But after that new image uploads are stuck at “Processing uploaded image…” msg.

Puma log when I upload the photo is as follows:

{"method":"GET","path":"/en/listing_images/1228386/image_status","format":"*/*","controller":"ListingImagesController","action":"image_status","status":200,"duration":36.84,"view":0.14,"db":13.41,"params":{"locale":"en","id":"1228386"},"host":"www.freelensia.com","community_id":40017,"current_user_id":"q0aAwAwUoilEGEdqCE2LXg","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36","referer":"[https://www.freelensia.com/en/listings/388506-test/edit","forwarded_for":"14.161.11.7","request_uuid":"821ad7ea-22c0-4846-a068-6bcfe950049a"}](https://www.freelensia.com/en/listings/388506-test/edit%22,%22forwarded_for%22:%2214.161.11.7%22,%22request_uuid%22:%22821ad7ea-22c0-4846-a068-6bcfe950049a%22%7D)

{"method":"GET","path":"/en/listing_images/1228387/image_status","format":"*/*","controller":"ListingImagesController","action":"image_status","status":200,"duration":61.28,"view":0.11,"db":12.65,"params":{"locale":"en","id":"1228387"},"host":"www.freelensia.com","community_id":40017,"current_user_id":"q0aAwAwUoilEGEdqCE2LXg","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36","referer":"[https://www.freelensia.com/en/listings/388506-test/edit","forwarded_for":"14.161.11.7","request_uuid":"9cac8ac2-1684-4466-a9a4-9021d8446957"}](https://www.freelensia.com/en/listings/388506-test/edit%22,%22forwarded_for%22:%2214.161.11.7%22,%22request_uuid%22:%229cac8ac2-1684-4466-a9a4-9021d8446957%22%7D)

{"method":"GET","path":"/en/listing_images/1228386/image_status","format":"*/*","controller":"ListingImagesController","action":"image_status","status":200,"duration":52.46,"view":0.11,"db":27.02,"params":{"locale":"en","id":"1228386"},"host":"www.freelensia.com","community_id":40017,"current_user_id":"q0aAwAwUoilEGEdqCE2LXg","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36","referer":"[https://www.freelensia.com/en/listings/388506-test/edit","forwarded_for":"14.161.11.7","request_uuid":"966975a5-4b76-4bd8-889a-fe50c9247e43"}](https://www.freelensia.com/en/listings/388506-test/edit%22,%22forwarded_for%22:%2214.161.11.7%22,%22request_uuid%22:%22966975a5-4b76-4bd8-889a-fe50c9247e43%22%7D)

{"method":"GET","path":"/en/listing_images/1228387/image_status","format":"*/*","controller":"ListingImagesController","action":"image_status","status":200,"duration":51.85,"view":0.09,"db":17.37,"params":{"locale":"en","id":"1228387"},"host":"www.freelensia.com","community_id":40017,"current_user_id":"q0aAwAwUoilEGEdqCE2LXg","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36","referer":"[https://www.freelensia.com/en/listings/388506-test/edit","forwarded_for":"14.161.11.7","request_uuid":"832d7cf2-9a1b-46a3-aabe-6eb99bdde72b"}](https://www.freelensia.com/en/listings/388506-test/edit%22,%22forwarded_for%22:%2214.161.11.7%22,%22request_uuid%22:%22832d7cf2-9a1b-46a3-aabe-6eb99bdde72b%22%7D)

@thomasmalbaux @karibu

@freelensia I have faced the similar issue. That was due to the imagemagic. I have uninstalled imagemagic and reinstalled it again and issue has been fixed.

@freelensia, This is small issue, freelensia is a Sharetribe GO development service providers right ?

1 Like

Yup we are on Sharetribe Go.

We could not resolve this problem still…

We tried to

  1. reinstall imagemagick:
    sudo apt remove --purge imagemagick
    sudo apt install imagemagick
  2. restart sidekiq
    this is because our project is using paperclip with sidekiq. We restarted sidekiq but it does not work.
    image
  3. We tried to check sidekiq when we upload the images, job sidekiq says “Processed” but the image is stuck in “Processing…”
  4. we tried to reinstall imagemagick and updated environment config:
    Paperclip.options[:command_path] = “/usr/bin/”
    Still no luck…

I have to say that this bug only happens with listing photos (both user self-uploads and admin uploads on behalf of user). With profile photo we do not have this problem at all. The photos upload fine.

Do you know where else should we check to find the problem’s cause?

Also, how do we clear the “photos processing…” images using sidekiq?
We know that with delayed job we cleared these pending photos with
RAILS_ENV=production bundle exec rake jobs:work
But now this command does not work with sidekiq.

Thanks!

May be we need to reinitiate permissions for public folder or need to run following command
RAILS_ENV=production NODE_ENV=production bundle exec rake assets:precompile

@freelensia

  1. Check what is in field listing_images.error for those listing images?
  2. Comment line in app/models/listing_image.rb
  # process_in_background :image, :processing_image_url => "/assets/listing_image/processing.png", :priority => 1

then from RAILS_ENV=production bundle exec rails console try to create new listing image and check what is in logs when processing:

    ListingImage.create(image: File.new("a.jpg"))

Thanks @vivekraj @zenik pls let me try.

Hi all, just wanna thank you all and update the situation. We found the bug. It was paperclip that needed to update to be compatible. Thanks for your help!