0

so I just deployed my symfony application on heroku + ClearDB Mysql and I have a problem with my images. Once the application is deployed I go to the back office via easyAdmin, and I fill in some "products with images" information, everything works perfectly well at the time, my images are displayed correctly in the easyAdmin as on my site . However after a very short turn of time "I would say 1 hour" my images no longer work, they no longer appear on the site and in the easyadmin either "they appear broken, impossible to read". I would therefore like to point out that locally everything works perfectly well and that deploying the first hour there is no problem. So I head to the stackoverflow community for help, I can't figure it out, I tested the operation several times and the result is the same each time ... I also deploy a similar application with heroku postgres and no problem but I would like to understand what is wrong with the heroku clearDB Mysql case. Thank you

Le Berre
  • 1
  • 1
  • anything in your logs? Do you hit a limit of your clear-db plan? – simon.ro Jan 18 '21 at 13:46
  • So I am working with postgres now, I have exactly the same problem, I only put an image to test so storage level I have room. It works for about an hour and after 404 ... I read something about heroku where it is explained that the upload is ephemeral. So I save the images directly in my repo before deploying it and it works for one of my repo but not for the other, I use vich uploader and liip imagine and it seems that heroku is capricious depending on the use of certain bundle. – Le Berre Jan 19 '21 at 18:30
  • Ok, then, that information makes it clear. Your problem is not at all related to the database. Your problem is that you try to store images on the ephemeral filesystem of your heroku dyno. Whenever your dyno restarts, all images are lost. You need to use a stable filesystem, e.g. an s3 heroku addon. – simon.ro Jan 19 '21 at 20:02
  • I recommend you to close this question. If it doesn't work with a different filesystem, you can try to formulate a new question. It should be as focused as possible and should include the relevant code and configuration snippets so that the problem can be reproduced. – simon.ro Jan 19 '21 at 20:05

0 Answers0