Python - permission denied remotely - python

I'm using a program called SPAdes-3.50-Darwin and while running it on a server (one which I do not have root access to), I get the following error even though on my local computer it runs fine:
== Running read error correction tool: /export/home/james/Tools/SPAdes-3.5.0-Darwin/bin/hammer /export/home/james/package/output/pg/assembly_files/NA12877_S1_chr14_105900000-107300000/spades_files/3-49/corrected/configs/config.info
[Errno 13] Permission denied
Traceback (most recent call last):
File "/export/home/james/Tools/SPAdes-3.5.0-Darwin/bin/spades.py", line 586, in main
ext_python_modules_home, log)
File "/export/home/james/Tools/SPAdes-3.5.0-Darwin/share/spades/spades_pipeline/hammer_logic.py", line 128, in run_hammer
support.sys_call(command, log)
File "/export/home/james/Tools/SPAdes-3.5.0-Darwin/share/spades/spades_pipeline/support.py", line 181, in sys_call
proc = subprocess.Popen(cmd_list, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=cwd)
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
OSError: [Errno 13] Permission denied
Does this have to do with not having root permission?

Related

Cell.all() python gives OSError

I am trying to get the output of Cell.all() function from the wifi module but it shows:
Traceback (most recent call last):
File "yea.py", line 3, in <module>
cell = Cell.all('wlp0s20u2')
File "/usr/lib/python2.7/site-packages/wifi/scan.py", line 39, in all
stderr=subprocess.STDOUT)
File "/usr/lib/python2.7/subprocess.py", line 212, in check_output
process = Popen(stdout=PIPE, *popenargs, **kwargs)
File "/usr/lib/python2.7/subprocess.py", line 390, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
I have been searching for a fix for a couple of hours now, and everything I found is related to the subprocess module. Is there a way to fix this (pass a shell=True argument) or does anybody know a module similar to wifi that i could use for a simple wifi mapping script?
P.S. If it is relevant I'm using Solus 3 linux distro.

Getting error with subprocess while running aws s3 cp: [Errno 2] No such file or directory: 'aws'

I am able to execute this command successfully from command line and it copies the desired csv to the s3 bucket aws s3 cp /Users/kaswani/tips.csv s3://dplearn/
But, when I try to run the same from within python using subprocess it throws error:
subprocess.check_output(['aws','s3','cp','/Users/kaswani/tips.csv','s3://dplearn/'])
Error:
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Users/kaswani/anaconda/envs/aws/lib/python3.5/subprocess.py", line 626, in check_output
**kwargs).stdout
File "/Users/kaswani/anaconda/envs/aws/lib/python3.5/subprocess.py", line 693, in run
with Popen(*popenargs, **kwargs) as process:
File "/Users/kaswani/anaconda/envs/aws/lib/python3.5/subprocess.py", line 947, in __init__
restore_signals, start_new_session)
File "/Users/kaswani/anaconda/envs/aws/lib/python3.5/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'aws'
I have not been able to debug it. Subprocess works just fine for basic commands like ls etc
Using, shell=True makes is work, i.e. subprocess.check_output(['aws','s3','cp','/Users/kaswani/tips.csv','s3://dplearn/'], shell=True)

can any body help? I get this error, and I cant solve it?

I am tring to run a python file and it start but after that give me this error. What I have to do to fixed this error, I am beginner with python.
Traceback (most recent call last):
File "./mininet_multicast_pox.py", line 318, in <module>
mcastTest(topo, False, hosts)
File "./mininet_multicast_pox.py", line 53, in mcastTest
pox_process = Popen(pox_arguments, stdout=fnull, stderr=fnull, shell=False, close_fds=True)
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
You have to provide an absolute path to you file.
Without that, the subprocess module can't find it.
The os module provides routine for that.

Airflow HiveOperator not working

I am trying to use a hive operator in airflow. I have all the dependencies installed (pyhs2, pyhive, and ran pip install airflow[hive]).
However when I use the code below
t1 = HiveOperator(
task_id='simple_query',
hql='select * from cities',
dag=dag)
I get this error. I am not sure what it means
[2016-01-06 03:26:39,500] {models.py:1017} ERROR - [Errno 2] No such file or directory
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/airflow/models.py", line 977, in run
result = task_copy.execute(context=context)
File "/usr/local/lib/python2.7/dist-packages/airflow/operators/hive_operator.py", line 65, in execute
self.hook.run_cli(hql=self.hql, schema=self.schema)
File "/usr/local/lib/python2.7/dist-packages/airflow/hooks/hive_hooks.py", line 110, in run_cli
cwd=tmp_dir)
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
[2016-01-06 03:26:39,512] {models.py:1053} ERROR - [Errno 2] No such file or directory
This error occurs when the hive command line interface (CLI) isn't available in your system path.

Script giving error of permission denied OSerror 13 from cronjob?

I have written a script from the Python to automate scan. I have used nessus for that and used subprocess module in python. Problem is this it's running from the cli bash, but when I put that script to launch through by cron job. It gives following error
Traceback (most recent call last):
File "/root/nessusscan.py", line 9, in <module>
subprocess.call(['nessus','-q','-x','-T','nessus','127.0.0.1','1241','user','password','ip.txt','res'])
File "/usr/lib/python2.7/subprocess.py", line 493, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
raise child_exception
OSError: [Errno 13] Permission denied
The script is
subprocess.call(['nessus','-q','-x','-T','nessus','127.0.0.1','1241','user','password','ip.txt','res'])
Command for cron job
16 14 * * * cd /root/nessus; ./nessusscan.py
The error means that the program is found by subprocess but the user running the "nessusscan.py" does not have permissions to run it.
Check ownership of the nessus file and the permissions on it.

Categories

Resources