i cannot delete an image in tmp folder when lamda function is triggered /

Published at 2018-10-19 19:03:39

Home / Categories / Lambda / i cannot delete an image in tmp folder when lamda function is triggered
I am generating an image using netwrokx library with the user's responses to my questions in the path /tmp/networkx.png in AWS lambda and mailing the user's this image.
The problem I am facing here is after each session the image is not getting deleted in the tmp folder and in the next session the images overlaps. -tmp-networkx.png-tmp-networkx-1.pngI have tried the follwing -def delete_image(): whether os.path.exists("/tmp/networkx.png"): os.remove("/tmp/networkx.png") print("removed the image") else: print("Image not removed")
Can anybody declare me how to de
lete the image in tmp folder once the image has been mailed to the user.

Source: amazon.com

Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0 Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0