Image upload issue in production CentOS 7

i need help with opensource version of sharetribe. I have deployed it on CentOS 7. The problem is with images uploading. When i do it from local machine it works perfectly fine but when i upload it from server it uploads it but only original one it does not create thumb, small etc so it is not converting that into diff sizes and uploading to downloading bucket.

Live worker log:

[Worker(host:xde8q4 pid:7056)] Job DownloadListingImageJob (id=278) RUNNING
2017-02-19T18:57:28+0100: [Worker(host:xde8q4 pid:7056)] Job DownloadListingImageJob (id=278) RUNNING
{“tag”:“delayed_job”,“free”:“Running job”,“type”:“running”,“structured”:{“job_name”:“DownloadListingImageJob”,“args”:{“listing_image_id”:48,“url”:“https://willlernen-tmp.s3.amazonaws.com/uploads/listing-images/2017/2/20170219T1756Z-9196103056f717450ddd54e7c703d8aa/0/506-ui-files.png”}}}
Command :: identify -format ‘%wx%h,%[exif:orientation]’ ‘/tmp/2648e61e051b5821e6d7e816c26bf99c20170219-7056-aarqrj.png[0]’ 2>/dev/null
[paperclip] saving images/listing_images/images/48/original/506-ui-files.png
[ActiveJob] Enqueued DelayedPaperclip::ProcessJob (Job ID: df09bb01-8f91-4ca4-a69e-3aa72db959fd) to DelayedJob(paperclip) with arguments: “ListingImage”, 48, “image”
{“tag”:“delayed_job”,“free”:“Job success”,“type”:“success”,“structured”:{“job_name”:“DownloadListingImageJob”,“args”:{“listing_image_id”:48,“url”:“https://willlernen-tmp.s3.amazonaws.com/uploads/listing-images/2017/2/20170219T1756Z-9196103056f717450ddd54e7c703d8aa/0/506-ui-files.png”}}}
[Worker(host:xde8q4 pid:7056)] Job DownloadListingImageJob (id=278) COMPLETED after 6.5852
2017-02-19T18:57:34+0100: [Worker(host:xde8q4 pid:7056)] Job DownloadListingImageJob (id=278) COMPLETED after 6.5852
[Worker(host:xde8q4 pid:7056)] Job ActiveJob::QueueAdapters::DelayedJobAdapter::JobWrapper (id=279) RUNNING
2017-02-19T18:57:36+0100: [Worker(host:xde8q4 pid:7056)] Job ActiveJob::QueueAdapters::DelayedJobAdapter::JobWrapper (id=279) RUNNING
{“tag”:“delayed_job”,“free”:“Running job”,“type”:“running”,“structured”:{“payload”:“#\u003cActiveJob::QueueAdapters::DelayedJobAdapter::JobWrapper:0x0000000a53ed28 @job_data={"job_class"=\u003e"DelayedPaperclip::ProcessJob", "job_id"=\u003e"df09bb01-8f91-4ca4-a69e-3aa72db959fd", "queue_name"=\u003e"paperclip", "arguments"=\u003e["ListingImage", 48, "image"], "locale"=\u003e:en}\u003e”}}
[ActiveJob] [DelayedPaperclip::ProcessJob] [df09bb01-8f91-4ca4-a69e-3aa72db959fd] Performing DelayedPaperclip::ProcessJob from DelayedJob(paperclip) with arguments: “ListingImage”, 48, “image”
[ActiveJob] [DelayedPaperclip::ProcessJob] [df09bb01-8f91-4ca4-a69e-3aa72db959fd] [paperclip] copying images/listing_images/images/48/original/506-ui-files.png to local file /tmp/2648e61e051b5821e6d7e816c26bf99c20170219-7056-1ud9lku.png
[ActiveJob] [DelayedPaperclip::ProcessJob] [df09bb01-8f91-4ca4-a69e-3aa72db959fd] Command :: file -b --mime ‘/tmp/2648e61e051b5821e6d7e816c26bf99c20170219-7056-16lxpqk.png’
[ActiveJob] [DelayedPaperclip::ProcessJob] [df09bb01-8f91-4ca4-a69e-3aa72db959fd] [paperclip]
(image/png from Headers, [“image/png”] from Extension), content type discovered from file command: . See documentation to allow this combination.
[ActiveJob] [DelayedPaperclip::ProcessJob] [df09bb01-8f91-4ca4-a69e-3aa72db959fd] [paperclip] saving images/listing_images/images/48/original/506-ui-files.png
[ActiveJob] [DelayedPaperclip::ProcessJob] [df09bb01-8f91-4ca4-a69e-3aa72db959fd] Performed DelayedPaperclip::ProcessJob from DelayedJob(paperclip) in 2440.35ms
{“tag”:“delayed_job”,“free”:“Job success”,“type”:“success”,“structured”:{“payload”:“#\u003cActiveJob::QueueAdapters::DelayedJobAdapter::JobWrapper:0x0000000a53ed28 @job_data={"job_class"=\u003e"DelayedPaperclip::ProcessJob", "job_id"=\u003e"df09bb01-8f91-4ca4-a69e-3aa72db959fd", "queue_name"=\u003e"paperclip", "arguments"=\u003e["ListingImage", 48, "image"], "locale"=\u003e:en}\u003e”}}
[Worker(host:xde8q4 pid:7056)] Job ActiveJob::QueueAdapters::DelayedJobAdapter::JobWrapper (id=279) COMPLETED after 2.9273
2017-02-19T18:57:39+0100: [Worker(host:xde8q4 pid:7056)] Job ActiveJob::QueueAdapters::DelayedJobAdapter::JobWrapper (id=279) COMPLETED after 2.9273
[Worker(host:xde8q4 pid:7056)] 2 jobs processed at 0.1836 j/s, 0 failed
2017-02-19T18:57:39+0100: [Worker(host:xde8q4 pid:7056)] 2 jobs processed at 0.1836 j/s, 0 failed

i think this is the issue
Content Type Spoof: Filename 506.png

Do you have ImageMagick installed to your system? Try this convert -version if it’s not installed just install it.

yes it is installed

Version: ImageMagick 6.7.8-9 2016-06-16 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP

Okey run which convert (one of the ImageMagick utilities). This will give you the path where that utility is installed. For example, it might return /usr/local/bin/convert.. And then In development mode or Production (it’s depend what you run on), you might add this line to config/environments/development.rb(or production.rb)):

Paperclip.options[:command_path] = "/usr/local/bin/"

If this doesn’t work share your rails logs.

Same code is deployed for my local machine and server both are running in development mode. It’s working on local machine but not working on server.

I solved it by this:

require 'paperclip/media_type_spoof_detector’
module Paperclip
class MediaTypeSpoofDetector
def spoofed?
false
end
end
end