Image Uploads Not Appearing In /shared/uploads directory


(Steven Arnott) #1

Hi, I was using the ‘Assets for the site design’ topic to upload images for the site logos.

<img src="/uploads/default/original/1X/425578b89a5f78a4a84c7975d00e1566e0e274f8.png" width="66" height="66"> <img src="/uploads/default/original/1X/0f9d4dbe08a1236703185ca94e278042a7c40b53.png" width="366" height="99"> 

The upload seems to work however the link that I get back is broken and files is not present in the /shared/uploads directory.

root@devops701-dev2:/shared/uploads/default/original/1X# ls

923205436d3568bc15098f99918bae56f79614a5.jpg

I tried chmod’ing the /shared/uploads directory to all write but it made not difference.

Uploading a new avatar does work as can been seen by the asset present.

/shared is a host volume mount from the host.

Any advice on what I should check?


(Jeff Atwood) #2

I think you have a broken Discourse install – how was it installed? Looks like some of the bootstrap settings around hostname are wrong.


(Steven Arnott) #3

I’m currently working in a dev environment so I don’t have a ‘real’ DNS name. Also we intend to have a /shared volume on a NFS share between two host. We therefore build our disource_base that has the ‘discourse’ user fixed to a pre-determined UID that also exists on the hosts and NFS servers.


(Steven Arnott) #4

I change the container/agg.yml to not mount the host shares and still not uploading images.

UPDATE:

I cleared the DB, which had a upload from our old instance, rebuilt the image with the public discourse_base and the uploads worked…

Is there some caching table in the DB that it checks the uploaded images and see that it’s seen it before and therefore does not save it to disk???


(Kane York) #5

Yes, if an uploaded file has the same SHA1 as an entry in the database, it assumes the file is already on the disk.


(Steven Arnott) #6

That would explain it…

So would it be better to restore my migration backup first then upload new graphics?