Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run_command.sl - Failed to serialize execution plan #934

Open
FlorianJDF opened this issue Feb 15, 2017 · 3 comments
Open

run_command.sl - Failed to serialize execution plan #934

FlorianJDF opened this issue Feb 15, 2017 · 3 comments

Comments

@FlorianJDF
Copy link
Contributor

Hello,

When I use the operation run_command.sl and the output command is too big I have a stack trace : "Failed to serialize execution plan" and the flow never ends.

Here is the stack trace from the execution.log

15/02/17 14:37:33 [INFO] Worker is up
15/02/17 14:37:37 [INFO] [ 0 - launch_ansible ] EVENT_INPUT_START - Inputs: null, Outputs: null, Result: null, Raw Data: {EXECUTION_ID=101600001, PATH=0, DESCRIPTION=Pre Input binding for FLOW, TIMESTAMP=Wed Feb 15 14:37:37 CET 2017, STEP_TYPE=FLOW, INPUTS=[], STEP_NAME=launch_ansible, TYPE=EVENT_INPUT_START}
15/02/17 14:37:37 [INFO] [ 0 - launch_ansible ] EVENT_INPUT_END - Inputs: {}, Outputs: null, Result: null, Raw Data: {EXECUTION_ID=101600001, PATH=0, BOUND_INPUTS={}, DESCRIPTION=Post Input binding for FLOW, TIMESTAMP=Wed Feb 15 14:37:37 CET 2017, STEP_TYPE=FLOW, STEP_NAME=launch_ansible, TYPE=EVENT_INPUT_END}
15/02/17 14:37:37 [INFO] [ 0.0 - run_the_ansible ] EVENT_STEP_START - Inputs: null, Outputs: null, Result: null, Raw Data: {EXECUTION_ID=101600001, PATH=0.0, DESCRIPTION=beginStep execution step started, TIMESTAMP=Wed Feb 15 14:37:37 CET 2017, STEP_TYPE=STEP, STEP_NAME=run_the_ansible, TYPE=EVENT_STEP_START}
15/02/17 14:37:37 [INFO] [ 0.0 - run_the_ansible ] EVENT_ARGUMENT_START - Inputs: null, Outputs: null, Result: null, Raw Data: {EXECUTION_ID=101600001, PATH=0.0, ARGUMENTS=[command, cwd], DESCRIPTION=Pre argument binding for step, TIMESTAMP=Wed Feb 15 14:37:37 CET 2017, STEP_TYPE=STEP, STEP_NAME=run_the_ansible, TYPE=EVENT_ARGUMENT_START}
15/02/17 14:37:37 [INFO] [ 0.0 - run_the_ansible ] EVENT_ARGUMENT_END - Inputs: null, Outputs: null, Result: null, Raw Data: {EXECUTION_ID=101600001, PATH=0.0, DESCRIPTION=Step inputs resolved, TIMESTAMP=Wed Feb 15 14:37:37 CET 2017, STEP_TYPE=STEP, BOUND_ARGUMENTS={command=ansible-playbook -i hosts configure-machine.yml -u florian, cwd=/home/flo/personal-config/}, STEP_NAME=run_the_ansible, TYPE=EVENT_ARGUMENT_END}
15/02/17 14:37:37 [INFO] [ 0.0 - run_command ] EVENT_INPUT_START - Inputs: null, Outputs: null, Result: null, Raw Data: {EXECUTION_ID=101600001, PATH=0.0, DESCRIPTION=Pre Input binding for OPERATION, TIMESTAMP=Wed Feb 15 14:37:37 CET 2017, STEP_TYPE=OPERATION, INPUTS=[command, cwd], STEP_NAME=run_command, TYPE=EVENT_INPUT_START}
15/02/17 14:37:37 [INFO] [ 0.0 - run_command ] EVENT_INPUT_END - Inputs: {command=ansible-playbook -i hosts configure-machine.yml -u florian, cwd=/home/flo/personal-config/}, Outputs: null, Result: null, Raw Data: {EXECUTION_ID=101600001, PATH=0.0, BOUND_INPUTS={command=ansible-playbook -i hosts configure-machine.yml -u florian, cwd=/home/flo/personal-config/}, DESCRIPTION=Post Input binding for OPERATION, TIMESTAMP=Wed Feb 15 14:37:37 CET 2017, STEP_TYPE=OPERATION, STEP_NAME=run_command, TYPE=EVENT_INPUT_END}
15/02/17 14:37:43 [INFO] Creating python interpreter with [0] dependencies [[]]
15/02/17 14:38:39 [INFO] [ 0.0 - null ] EVENT_ACTION_START - Inputs: null, Outputs: null, Result: null, Raw Data: {EXECUTION_ID=101600001, PATH=0.0, DESCRIPTION=Preparing to run action PYTHON, TIMESTAMP=Wed Feb 15 14:37:37 CET 2017, STEP_TYPE=ACTION, STEP_NAME=null, TYPE=EVENT_ACTION_START, CALL_ARGUMENTS={cwd=/home/flo/personal-config/, command=ansible-playbook -i hosts configure-machine.yml -u florian}}
15/02/17 14:38:39 [INFO] [ 0.0 - null ] EVENT_ACTION_END - Inputs: null, Outputs: null, Result: null, Raw Data: {EXECUTION_ID=101600001, PATH=0.0, DESCRIPTION=Action performed, TIMESTAMP=Wed Feb 15 14:38:39 CET 2017, STEP_TYPE=ACTION, STEP_NAME=null, TYPE=EVENT_ACTION_END}
15/02/17 14:38:39 [ERROR] Error during execution!!!
java.lang.RuntimeException: Failed to serialize execution plan. Error: 
	at io.cloudslang.engine.queue.entities.ExecutionMessageConverter.objToBytes(ExecutionMessageConverter.java:101)
	at io.cloudslang.engine.queue.entities.ExecutionMessageConverter.createPayload(ExecutionMessageConverter.java:46)
	at io.cloudslang.engine.queue.entities.ExecutionMessageConverter.createPayload(ExecutionMessageConverter.java:42)
	at io.cloudslang.worker.management.services.SimpleExecutionRunnable.createInProgressExecutionMessage(SimpleExecutionRunnable.java:475)
	at io.cloudslang.worker.management.services.SimpleExecutionRunnable.isRunningTooLong(SimpleExecutionRunnable.java:418)
	at io.cloudslang.worker.management.services.SimpleExecutionRunnable.shouldStop(SimpleExecutionRunnable.java:182)
	at io.cloudslang.worker.management.services.SimpleExecutionRunnable.executeRegularStep(SimpleExecutionRunnable.java:169)
	at io.cloudslang.worker.management.services.SimpleExecutionRunnable.run(SimpleExecutionRunnable.java:120)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at io.cloudslang.worker.management.services.WorkerThreadFactory$1.run(WorkerThreadFactory.java:33)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.NotSerializableException: org.python.core.io.BinaryIOWrapper
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
	at java.util.concurrent.ConcurrentHashMap.writeObject(ConcurrentHashMap.java:1413)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1028)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496)
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
	at java.util.HashMap.internalWriteEntries(HashMap.java:1785)
	at java.util.HashMap.writeObject(HashMap.java:1362)
	at sun.reflect.GeneratedMethodAccessor243.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1028)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496)
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
	at java.util.HashMap.internalWriteEntries(HashMap.java:1785)
	at java.util.HashMap.writeObject(HashMap.java:1362)
	at sun.reflect.GeneratedMethodAccessor243.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1028)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496)
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
	at io.cloudslang.engine.queue.entities.ExecutionMessageConverter.objToBytes(ExecutionMessageConverter.java:95)
	... 13 more

Regards,

@cohenmax
Copy link

Same issue on my side, this is really blocking for some usecases and prevent me from using it.

Any way to expand the size of the variables ?

Regards

@dongpak
Copy link

dongpak commented Feb 3, 2020

I'm seeing same problem. Is there really a limit to the size?

@GiovanniLR
Copy link

I had exactly the same problem/exception_stack; adding as last line in the script :

...
except Exception as e:
    return_code = -1
    error_message = e
del res   # <- added

works for me.
My guess is that subprocess.Popen is not serializable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants