Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code 500 - Unable to open image jpg #714

Open
robin-aeist opened this issue Jun 12, 2021 · 5 comments
Open

Code 500 - Unable to open image jpg #714

robin-aeist opened this issue Jun 12, 2021 · 5 comments

Comments

@robin-aeist
Copy link

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
Copy link
Member

mamazu commented Jun 12, 2021

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 robin-aeist changed the title Code 500 - Unable to open image png Code 500 - Unable to open image jpg Jun 17, 2021
@robin-aeist
Copy link
Author

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
Copy link

@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
Copy link
Author

@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
Copy link
Member

mamazu commented Jul 8, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants