genxbe / kirby3-instagram

Fetch instagram photos without the need for app aproval
MIT License
50 stars 1 forks source link

Error message on running cron job #6

Closed MikeHarrison closed 2 years ago

MikeHarrison commented 2 years ago

Hi,

Sorry me again!

I am getting the following error when running the cron job to fetch the instagram posts:

Whoops\Exception\ErrorException: unlink(/home/xxxxxx/public_html/assets/instagram/media17860440146772998.jpg): No such file or directory in file /home/xxxxxx/public_html/site/plugins/kirby3-instagram/classes/Instagram.php on line 188
Stack trace:
1. Whoops\Exception\ErrorException->() /home/xxxxxx/public_html/site/plugins/kirby3-instagram/classes/Instagram.php:188
2. unlink() /home/xxxxxx/public_html/site/plugins/kirby3-instagram/classes/Instagram.php:188
3. X\Instagram->fetch() /home/xxxxxx/public_html/site/plugins/kirby3-instagram/fetch.php:27

It looks like there is a slash missing on the url between media and the filename. Oddly I didn't have this issue when running the site locally, it is only cropping up on the live site.

If you have any thoughts, or ideas of things to try, that would be great. Thanks!

samzzi commented 2 years ago

@MikeHarrison Very odd that I haven't never run into this problem but if I look at the code it does make sense that you get this error 🤔 I've, presumably, fixed it but since I can't test it (because it just works for me 😛 )... Can you let me know of adding the extra separator helped?

Cheers!

MikeHarrison commented 2 years ago

@samzzi that has done the trick, thank you so much for your quick response. It worked fine on my local environment too, it must be a quirk with my production setup somewhere.