Forums

Permission denied

Permission denied return code was 126.

The strange thing is that we have been scheduling the same task from a long time and it never failed earlier.

I must mention that we updated the scheduled task recently and it is a bash script. After reading this https://help.pythonanywhere.com/pages/ScheduledTasks I think the permissions got messed up. Do we need to execute chmod +x /path/to/your.file every time we update the script we are scheduling?

That sounds like it might be the problem. You don't need to chmod the script if you've just edited it (say, from the "Files" tab or using vim from a bash console), but if you delete it and then re-create it, then yes, you need to update the permissions again.

No we didn't delete it. The script was updated via git pull

Hmm, that might be the problem -- git keeps track of the permissions it expects a file to have, so if it thinks that the file should be non-executable, it could well "fix" it when you do the pull.

Is your working repository (as in, the place you git push from) on a Linux machine or a Mac? If so, you can chmod +x it there, then commit that permissions change -- then the repo will have the correct information, and future push/pulls won't break things.

Thanks, have a good one.

Hi, I am having the same issue, but my local dev is on a windows machine, this command is not available what will be the fix for windows users?

I'm afraid we would not be able to help you with your local windows machine.

hi, I having the same problem. I try run my selenium scripts for instagram on always-task, but i take a this error. I trying run "rm -rf /tmp/ /tmp/." in my python code for deleting temp files with the help of "os.system". I have to do this otherwise running out of storage. So, what is the problem?

You can't delete the /tmp directory itself, you should rather delete its contents, by using /tmp/* syntax. See: https://help.pythonanywhere.com/pages/DiskQuota/.