Download gae application issue, Can't create directory - python

trying to download the source code from gae developer account.
appcfg.py download_app -A appname /"my folder"/path/appname
When I download the app, it gave me this error:
2013-03-11 14:37:53,807 ERROR appcfg.py:1791 Couldn't create directory "/path-to-folder/admin": [Errno 13] Permission denied: '/path-to-folder'
How to fix this problem?
Edited: Nevermind, I logged in to root and fixed it.

Check if the folder where you try to place the app, has the right permissions set.

Related

Please verify that you have permissions to write to the parent directory

I'm installing Google Cloud SDK from my terminal.
Then, I got an error when I typed ./install.sh.
It shows
WARNING: Could not setup log file in /Users/myname/.config/gcloud/logs, (Error: Could not create directory [/Users/myname/.config/gcloud/logs/2022.06.18]: Permission denied.
Please verify that you have permissions to write to the parent directory..
The configuration directory may not be writable. To learn more, see https://cloud.google.com/sdk/docs/configurations#creating_a_configuration
Though I clicked "Yes" in Do you want to help improve the Google Cloud CLI (y/N)?
It still shows [Errno 13] Permission denied: '/Users/myname/.config/gcloud'
Does anyone meet the same issue? I've found some solution on Stackoverflow and other websites, but none of them are useful for me.
I had this issue. I solved by:
Open Finder
CMD+SHIFT+G
Input ~/.config
If gcloud directory does not exist, create it.
Right Click gcloud directory > Get Info > Sharing & Permissions > Give "Read & Write" to all levels.
I do not know if this is safe, but it allowed installation to complete.

Permission Denied for os.mkdir on ubuntu apache2

I am trying to figure out "To Solve Permission Denied Problem for script.py" python script Hosted on UBUNTU Linux apache2 server. The app is facing problem when I try to use
os.mkdir(os.path.join("/var/www/mysite.com/public_html/uploads", "newfolder"))
Note - app is using mod_wsgi, flask and python 3.x.x version.
This raises an Error 13 Permission denied error. However I tried the same from command line through putty by using
python3
import os
os.mkdir(os.path.join("/var/www/mysite.com/public_html/uploads", "newfolder"))
This created the folder actually. But I don't know why script is failing to create the same in case of execution.
Also Permission is set to "775" for script.py file.

apache server can't write to logs

Not certain if this belongs here or on SU
I'm developing a Django app and I'm having a problem with logfiles. I have a logger configured to write to /var/log/django/django.log. When I try to start the server, I get a 500 error, and the error log says
ValueError: Unable to configure handler 'djangologfile': [Errno 13] Permission denied: '/var/log/django/django.log'
"httpd/error_log" 480L, 61112C
The permissions for both django.log and the django directory are 777. Why can't the server write to the file?
Well, the easy way to test this is to sudo as a user the server is running under and try to ls /var/log/django/django.log. If that fails you might get insight into what the problem is.

Subprocess change folder permission on Picloud (an AMAZON EC2 server)?

In Ubuntu, I use subprocess.Popen to call an executable file, which will save some output files on the hard drive of server (Picloud). The code has been tested successfully on a Local Ubuntu machine. However, it does not work on the server. My approach is listed below:
#create a new folder.
#The permission is drwxrwx--- both locally and on the server end
os.makedirs(folder)
#copy the executable file to this folder.
#The permission is drwxrwx--- both locally and on the server end after copy
shutil.copy("a.exe", folder)
#call this exe file.
#The permission is drwxrwx--- locally but changed to drwxr-x--- on the server end.
#Since I do not have the write permit, my code fails
subprocess.Popen("a.exe")
>>>OSError: [errno 13] permission denied.
I am not sure why subprocess changes my folder permission on the server end. So I try to use sudo mode as:
subprocess.Popen("sudo", "a.exe")
As I expected, this code work locally only.
So can anyone give me some help on why subprocess will remove my write permission?
Thanks!
In windows, you can run it with command:
subprocess.Popen("runas /user:Admin a.exe")

.python-eggs permission denied

I'm getting the following error when trying to create a simple db with Django. I'm the only user on this computer, so I should be an admin. How do I make it so that I have permissions so that Django can just do its thing?
here is some more of the error:
[Errno 13] Permission denied: '/Users/tyre77/.python-eggs/simplejson-2.1.6-py2.7-macosx-10.7-intel.egg-tmp/simplejson/tmpUxM60A.$extract'
The Python egg cache directory is currently set to:
/Users/tyre77/.python-eggs
Perhaps your account does not have write access to this directory? You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory.
Files seem to be owned by root, and members of group staff do not have the rights to write into those files/directories and you're not root.
Try to change the owner of those files : sudo chown -R tyre77 /Users/tyre77/.python-eggs/
Maybe you've installed the module with a sudo command, so the files were created with the root privileges.

Categories