eb.exe deploy": Errno 13 Permission denied: './pagefile.sys' - python

I am compiling a website using TeamCity on a server and need to deploy the compiled website to AWS.
As my last build step, I use the Elastic Beanstalk CLI to deploy: "C:\Python34...\eb.exe deploy".
eb init has already been run...but whenever I run "eb deploy", (even when I run it from the command line in an empty directory--which should deploy a default project to AWS), an error appears saying:
Error: PermissionError :: [Errno 13] Permission denied: './pagefile.sys'
I have already run the command on my local machine without any problems; I receive the error on the server regardless of whether I am running the command line as an administrator.
I am wondering if this is a permissions issue with the server, or something else? I haven't been able to achieve much insight from the other questions, because they seem to have been solved on a case-by-case basis.

pagefile.sys is the Windows swap file.
It is a special file which cannot be written or manipulated. Whatever your command is doing you need to fix your command so it that doesn't touch this file and ignores it.

Related

Permission denied when trying to link pycharm to dockerized django venv

I'm trying to connect pycharm to the django dockerized venv but pycharm get an error about permission denied. "Error response from daemon: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "/usr/src/qatrackplus/deploy/docker/user-data/.venv": permission denied: unknown"
I already tried to chmod +777 the venv folder in case of rights problem but, pycharm still can't access it...
The solution was to point .../.venv/bin/python and not just .../.venv/ (int the docker file system btw). Why pycharm returned me permission error still haunt my mind but that works now :).

Why am I getting PermissionError [Errno 13] when attempting to write to log in Flask hosted by Apache?

I am running Flask 1.1.4 via Python 3.5.3, hosted via an Apache 2 server on Debian Stretch. I am attempting to log various messages from the program, using the python logging module. This works normally. However, if I restart the Apache server using sudo service apache2 restart, the Flask application errors out with PermissionError: [Errno 13] Permission denied: (log file name). Is this an issue anyone else has run into?
If it is not a permissions issue, this usually happens (happened to me a few times) if you are using a relative path for the log file.
The current working directory for an app running with mod_wsgi is not the directory the the app is in. If you are using a relative path for the log file you can try to use absolute path instead.
More info here: https://modwsgi.readthedocs.io/en/master/user-guides/application-issues.html#application-working-directory
It turns out that there was a cron process that was editing the ownership of all files in my log folder to root. Once the program was restarted and needed to re-obtain the file reference, it was unable to do so.

Permission Error: [Errno 13] Permission denied: 'traccert/tesseract.exe' while run our flask application

When I run the application on local host, its working fine, but when I run the application on heroku and try to convert the image to text its show an error. You may check the image below.
This is path to tesseract:
pytesseract.pytesseract.tesseract_cmd = 'traccert/tesseract.exe'
1: click here to see the image of an error.
It looks like you're trying to execute a .exe file, which is only runnable on the Windows operating system. Heroku's platform is Linux-based, which means you won't be able to run that .exe file.
If you're willing to do some work, you might be able to get the .exe file running by building a custom Heroku Buildpack that includes wine, but this depends on a lot of variables: what libraries your Windows executable relies on, etc.

Accessing the Host File In A Python Program

I created a program which modifies the hosts file in order to block some websites. But when I am running the programme, I am getting this error.
Btw I have created my Python file using Pycharm IDE and my intention is to run this script everytime open my PC using Task Scheduler. So please kindly do tell me what I should be running as the administrator. Is it like the Pycharm itself? Most importantly how do I give it Admin permissions permanently?
[Errno 13] Permission denied: 'C:\\Windows\\System32\\drivers\\etc\\hosts'
Please kindly tell me a way to fix this.
On Windows create a scheduled task on logon, and configure the task to run under a system account. The task could simply be run as a batch file and within the batch file you may run the below command. Ensure the task is set to run with administrator privileges in the task creation window
C:\PythonFolder\python.exe yourscript.py

Permission to access network drives when running Python CGI?

I have a Python script running on the default OSX webserver, stored in /Library/WebServer/CGI-Executables. That script spits out a list of files on a network drive using os.listdir.
If I just execute this from the terminal, it works as expected, but when I try to access it through a browser (computer.local/cgi-bin/test.py), I get a permissions error:
<type 'exceptions.OSError'>: [Errno 13] Permission denied: '/Volumes/code/code/_sendrender/queue/waiting'
Is there any way to give the script permission to access the network when accessed via CGI?
I don't know much about the default osx webserver, but the webserver process is probably being run as some user, that user needs to be able to access those files. To find out who the user is you can use the ps command. Then depending on the configuration of the network shared drive, you can add this user to the users allowed to access this data.

Categories

Resources