flaskamazon-elastic-beanstalkpython-newspaper

Missing temp folder in elastic beanstack with newspaper library


Every once in a while, the temp folder on my deployment server seems to go missing. I am using Flask and Newspaper on AWS elastic beanstalk. I am using the Newspaper library to scrape meta tags from external urls.

Error on the server: {'code_content': 500, 'error': "[Errno 2] No such file or directory: '/tmp/.newspaper_scraper/article_resources'"}

Everything works fine after the server is restared. Is there a config setting that might fix this?


Solution

  • We've had a similar problem using AWS Elastic Beanstalk platform "Java 8 running on 64bit Amazon Linux". There was a daily cron-job (/etc/cron.daily/tmpwatch) running that deletes all files in the /tmp folder that are older than 10 days.

    Try placing the .newspaper_scraper folder somewhere else.