I am not sure if this post should be posted here on Server Fault site, but I saw some posts about AWS here on Stack Overflow, so I hope this one fits here too.
I got the following problem when zipping and uploading files written in Python and Windows 10 not Ubuntu to AWS lambda function:
[Errno 13] Permission denied
I tried chmod 644 on files before zipping them, but I still have the same issue. All files that I upload to AWS through zipping will have permission denied issue, any solution?
I checked as well other posts about this where they discussed using chmod on files before zipping them, but I got the same problem as well:
Post 1: https://github.com/aws/aws-cli/issues/3235
Post 2: https://forums.aws.amazon.com/thread.jspa?messageID=742422
Post 3: PermissionError: [Errno 13] Permission denied when accessing to aws ec2 accessing-to-aws-ec2
Any suggestions?
Related
I am having permission denied for Jupyter notebook running on Ubuntu, AWS E2 instance. Below is the image for the error
I have tried to use other browser, reinstall it and clear cache. None of it works.
If your notebook is configured with some auth code (generated by notebook by default), and you've cleared your cache, and cookies, you will get the screen similar to below:
Here you can use the token shown in terminal, while running the notebook, the log will be similar to the below:
To access the notebook, open this file in a browser:
file:///home/ubuntu/.local/share/jupyter/runtime/nbserver-19740-open.html
Or copy and paste one of these URLs:
http://ip-123-1-1-123:8888/?token=abcdefghijl
or http://127.0.0.1:8888/?token=abcdefghijl
and if you want to run notebook without authentication you can run the below command:
jupyter notebook --ip='0.0.0.0' --NotebookApp.token='' --NotebookApp.password=''
Also try creating a new notebook, instead of accessing the Test.ipynb again, so that you can figure out if the issue is from the specific file or whole server.
The main reason is i don't have the permission to overwrite the file. First of all, i create the file at /home/ubuntu, which I don't have permission of. So i create a folder to store the file inside it. Other than that, i also done quite a lot modifications including adding the inbound rules and the permissions, i think some of it did help. I list out some of the website i think is very useful in tackling this issue:
PermissionError: [Errno 13] Permission denied: Cannot open Jupyter on Browser despite running correctly on AWS EC2 instance
https://stackoverflow.com/questions/53097180/permissionerror-errno-13-permission-denied-when-accessing-to-aws-ec2#:~:text=Make%20sure%20you%20type%20https,with%20version%2070%20or%20newer.
I have the following CI/CD setup with Gitlab for deploying my lambda function
When it runs no error happens but when I try executing the function I receive the "failed with error [Errno 13] Permission denied: '/var/task/lambda_function.py" error. Is there any way to solve this? I've found this article in which aws suggests using chmod to give file permissions, but it didn't help.
BTW: I've ran the same commands locally in my machine and no error happens when running the function
Thanks in advance for any answer.
UPDATE: CloudWatch Logs below
I think you have similar trouble like this one and another here on stackoverflow as well.
You have to manually set the permissions of the zip file.
quoting from the bug
The zip archive preserves file permissions, so if you have a 644
permissions file, deflate it and inflate it back up, you get 644
permissions for that file.
So to fix the issue, simply set the expected permissions
before deflation, in Lambda's case, something like 755 will do.
I was trying to do
C:\Python27\python s3cmd sync -r K:\a\ s3://test-bucket/test/
on windows. It gives an error
ERROR: S3 error: 403(Access Denied):Access Denied
But the problem is on a different machine with same config for s3cmd, I can push any folder. Only difference is it's linux.
Moreover on earlier machine,
C:\Python27\python s3cmd ls
works fine. Is this a Path problem, then why am I getting access denied? I am logged in as root in both windows (1st machine) and ubuntu(2nd machine).
My bad. I didn't run the command prompt as administrator. I assumed as I was logged in as admin, it does that automatically.
Access Denied was from my end I am assuming for now.
I am logging into my amazon aws production box using WinSCP and i have successfully setup Tomcat 6. But in webapps folder when i transfer some webservice i get error as:
Permission denied.
Error code: 3
Error message from server: Permission denied
Please help me out to resolve this issue
You haven't mentioned what instance type you are using, but it sounds like you are on some flavor of Linux. You need to chmod or chown the webapps directory so you can place files there, or you can place them elsewhere (like your home directory), then log in and use sudo mv to move it in place.
When I try to upload an Image, I am getting an error:
OSError at /
[Errno 13] Permission denied: '/home/ubuntu/project/django-user-activities/django_user_activities/static/media/uploaded_files/1422722471_11_Tulips.jpg'
I think its related with user permission. But since I am a windows user, and I am hosting this in a ubuntu 14.04 OS, I have no idea how to solve this. How do I resolve this problem/error? I would be very much grateful if you could help me. Thank you.
The shotgun command for all permission problems:
sudo chmod -R 777 /home/ubuntu/project/django-user-activities/django_user_activities/static/media/
Please note though that this is almost never a good idea...
Read this if you want to do it properly: https://superuser.com/questions/19318/how-can-i-give-write-access-of-a-folder-to-all-users-in-linux