0

I recently deployed a django app to AWS elastic beanstalk. I have used boto3 to enable storing my videos to the s3 bucket. But i need to convert the video files on the local storage before storing it on S3. I use moviepy and ffmpeg to convert the videos. But when I try to upload the files, I get an error "[errno 32] broken pipe moviepy error: ffmpeg encountered the following error while writing file /home/ec2-user/mount_point/u3files/temp_files/21editedtemp_mpy_wvf_snd.mp3: /home/ec2-user/mount_point/u3files/temp_files/21editedtemp_mpy_wvf_snd.mp3: permission denied".

I have already chmod 777 on the root folder of the volume and 'u3files' folder inside the local storage. Is there anything I am missing? How do I solve this? I am new to AWS beanstalk and any help would be appreciated. Thanks.

mark4391
  • 61
  • 5

1 Answers1

0

Fixed it. Just posting what I did just in case someone else runs into the same problem.

I was using ssh to change the permission of the folder that I wanted to store my files in. And apparently ssh uses a different user(ec2-user) to login. But the app was run by a different user(webapp). So all I had to do was,

sudo su

to switch to root and then change to the webapp user's home directory, add then add a new folder I wanted to store the files in and change the permission of that folder to enable write for that user(webapp). And that fixed it.

Dharman
  • 30,962
  • 25
  • 85
  • 135
mark4391
  • 61
  • 5