python - subprocess failed when used in supervisor -


i have celery task does:

subprocess.check_call([script.sh, 'clean'], cwd=module_folder, stdout=fd_log_out, stderr=fd_log_err) 

when run worker command line ok.

when celery workers started supervisor, in logs:

[2016-05-09 10:31:30,129: error/mainprocess] task project_server.executions.tasks.execution_run[04e6295b-2aa4-4384-9218-fccb111a20df] raised unexpected: typeerror('expect bytes or str, not nonetype',) traceback (most recent call last):   file "/home/benjamin/.virtualenvs/project/lib/python3.4/site-packages/celery/app/trace.py", line 240, in trace_task     r = retval = fun(*args, **kwargs)   file "/home/benjamin/.virtualenvs/project/lib/python3.4/site-packages/celery/app/trace.py", line 438, in __protected_call__     return self.run(*args, **kwargs)   file "/home/benjamin/project/projectserver/project_server/executions/tasks.py", line 88, in execution_run     fd_log_err=fd_log_err)   file "/home/benjamin/project/projectcommon/project_common/generator/__init__.py", line 807, in create_application     fd_log_out, fd_log_err)   file "/home/benjamin/project/projectcommon/project_common/models/extensions.py", line 550, in build_scala_module     subprocess.check_call([script.sh, 'clean'], cwd=module_folder, stdout=fd_log_out, stderr=fd_log_err)   file "/usr/lib/python3.4/subprocess.py", line 556, in check_call     retcode = call(*popenargs, **kwargs)   file "/usr/lib/python3.4/subprocess.py", line 537, in call     popen(*popenargs, **kwargs) p:   file "/usr/lib/python3.4/subprocess.py", line 859, in __init__     restore_signals, start_new_session)   file "/usr/lib/python3.4/subprocess.py", line 1381, in _execute_child     executable = os.fsencode(executable)   file "/home/benjamin/.virtualenvs/project/lib/python3.4/os.py", line 770, in fsencode     raise typeerror("expect bytes or str, not %s" % type(filename).__name__) typeerror: expect bytes or str, not nonetype 

why fail ?

ok got it: script.sh not in $path given supervisor


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -