Sylius / ShopApiPlugin

Shop API for Sylius.
https://sylius.com
129 stars 89 forks source link

Code 500 - Unable to open image jpg #714

Open robin-aeist opened 3 years ago

robin-aeist commented 3 years ago

If I request the endpoint http://localhost/shop-api/product-latest/ I got the flowing error

Steps to reproduce:

  1. Installation of sylius [docker] 1.8.6 (I tried with 1.9.3) with sample data
  2. install shopapiplugin
  3. request the endpoint http://localhost/shop-api/product-latest/

code 500 message "Unable to open image /var/www/html/public/media/image/92/44/02315e376fda4f92615c4b0ba574.jpg"

The image exists and the path is correct, I tried chmod to be sure that the API could open it. But the error persist.

Could you help me ?

mamazu commented 3 years ago

Hey, thanks for using ShopApi and reporting this bug. Can you have a look at the logs for this call and maybe provide a stack trace where exactly the error occurs? If the file exists it probably isn't going to be an issue with the file not existing. Maybe the liip image package can't scale the image properly.

robin-aeist commented 3 years ago

Hey, thanks for using ShopApi and reporting this bug. Can you have a look at the logs for this call and maybe provide a stack trace where exactly the error occurs? If the file exists it probably isn't going to be an issue with the file not existing. Maybe the liip image package can't scale the image properly.

Hi,

Sorry, I don't understand about looking at the logs of this call. How could I look at this ? (the command line I need to use ?) I'm a React developper, and I use this api to use sylius with Gatsby.

EmilMassey commented 3 years ago

@robin-aeist The logs are located by default in var/log/dev.log or var/log/prod.log depending on the environment you are using. I'm pretty sure it's dev.log in your case. These logs are a bit extensive so you should search for the records containing the error you got.

robin-aeist commented 3 years ago

@robin-aeist The logs are located by default in var/log/dev.log or var/log/prod.log depending on the environment you are using. I'm pretty sure it's dev.log in your case. These logs are a bit extensive so you should search for the records containing the error you got.

I checked the files on my containers (Because I use docker version of Sylius), I don't have such files, neither dev.log nor prod.log (it's empty).

mamazu commented 3 years ago

Maybe the output of the container is rerouted to docker logs? Then you should be able to do docker logs <container name>