I am trying to update modification time of a file on a nfs remote server in python, but got the following error:
os.utime(binary_path, (now_ts, now_ts))
PermissionError: [Errno 1] Operation not permitted
Is this currently not supported in python3?
You could try (from the command line, but I'm sure there's a syntax in python):
sudo chown `your_username:your_groupname filename`
Note: The group is usually just your username.
I think this will fix your issue.
Related
I have this error. I have days trying to solve it but I can not find the answer, if someone something similar happened I would appreciate your help.
ERROR: problem running ufw-init
iptables-restore v1.8.4 (legacy): Couldn't load match `limit':No such file or directory
Error occurred at line: 63
Try iptables-restore -h' or 'iptables-restore --help' for more information. iptables-restore v1.8.4 (legacy): Couldn't load match limit':No such file or directory
Error occurred at line: 8
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
Problem running '/etc/ufw/before.rules'
Problem running '/etc/ufw/user.rules'
ERROR: problem running ufw-init
Adding a firewall to wsl2 might not be very useful because you can gain root access to wsl2 with a simple command: "wsl -u root".
Check this (https://superuser.com/a/1626513) post out for more details.
note: backend error output: -v: -c: line 0: unexpected EOF while looking for matching `''
-v: -c: line 1: syntax error: unexpected end of file
ConEmuC: Root process was alive less than 10 sec, ExitCode=0.
Press Enter or Esc to close console...
This is error i am getting.
Also i have set the fish shell as default shell in WSL.
For WSL1 on windows 10 build later than 1909 (yes wsl2 is available to me but for corporate reasons i cant use it)
Try setting your command to wsl.exe -new_console:d:C:\_stuff\code -cur_console:p5 and the task parameters to /dir "c:/_stuff/code" /icon "c:/_distros/ubuntu/ubuntu1804.exe"
You may need to change the file locations to make the command and parameters suitable for your setup. c:/_stuff/code is where i keep all my repositories and c:/_distros/ubuntu is where i have installed ubuntu.
I'am trying to create a package for iOS with kivy.:https://kivy.org/docs/guide/packaging-ios.html
I try to run: ./toolchain.py build kivy in terminal on mac.
Error: sudo: unable to execute ./toolchain.py: Permission denied.
My python is setup in anaconda and is running correctly.
In the first line of ./toolchain.py is: #!/anaconda/envs/python2/bin python2.7
Anyone knows how to change the permissions/how to get it to work?
When I set python to default: /usr/bin/env and adjust first line of ./toolchain.py it does execute, but in default python I'am not able to install pip.
Ensure ./toolchain.py got execution bit set (chmod a+x toolchain.py)
When I run 'composer update' I get this error:
Writing lock file
Generating autoload files
[ErrorException]
chmod(): Operation not permitted
*It works just fine with sudo, but then I have to reset the owner & permissions, Which is really annoying...
**I also tried to reset the owner of ~/.composer to www-data with 777, no effect.
***I'm using Ubuntu 16.04 LTS + Apache/2.4.18 & php7.0.26
Any idea?
chmod will only work without sudo if the owner of the file is the same as the one running the composer update command.
The problem is that the error message doesn't tell you which file it's trying to chmod.
This depends on the project.
Running the command in verbose mode will give you more details:
composer update -v
In my case, it gave me a stack trace, showing which file called chmod(), and the line number.
However, it didn't give me the path of the file passed to chmod().
I had to add a simple echo right before the call to chmod() (without forgetting to remove it afterwards).
Once you know which file/folder is responsible for the error message, change its owner with chown.
In my case (Magento 2.3), the culprit was the bin/magento file, which needs to be owned by the user running the composer commands.
I am setting up Apche Hadoop 2.6 for the Psuedo Distributed Operation by following the instructions provided in the link:
http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/SingleCluster.html
I am facing an issue after I execute the command: $ bin/hdfs dfs -put etc/hadoop input
The error message is: put:'input': No such file or directory
How to resolve this?
Also, I have edited the hadoop-env.sh with the statement: export HADOOP_PREFIX=/usr/local/hadoop, but cannot understand that why shell prints out the warning: /usr/local/hadoop/etc/hadoop/hadop-env.sh: line 32: export:='/usr/local/hadoop': not a valid identifier
Thanks for the help.
I have fixed this problem.
I created the directory: $ bin/hdfs dfs -mkdir /user/root and the problem got solved, as I was logged in as the root in ubuntu. Earlier, I was giving wrong username, hence, facing the issue.