Getting No such file or directory in Ansible

219 views
Skip to first unread message

ankit daruka

unread,
May 25, 2023, 5:40:05 AM5/25/23
to Ansible Project
Hi Team,

I am getting "No such file or directory" in ansible tasks when actually the file is present . Below is the complete error log.

FAILED! => {"changed": true, "cmd": "cd /opt/app;\n HYBRIS_HOME=/opt/ecomm/hybris;\n CONFIG_DIR=$HYBRIS_HOME/config;\n if [ -d \"$CONFIG_DIR\" ]; then\n cd $CONFIG_DIR;\n echo \"\">>local.properties\n cat dev/local.properties>>local.properties\n echo \"\">>local.properties\n cat dev/nodes/node0.properties>>local.properties\n fi", "delta": "0:00:00.067408", "end": "2023-05-25 07:39:36.732515", "msg": "non-zero return code", "rc": 1, "start": "2023-05-25 07:39:36.665107", "stderr": "cat: dev/local.properties: No such file or directory\ncat: dev/nodes/node0.properties: No such file or directory", "stderr_lines": ["cat: dev/local.properties: No such file or directory", "cat: dev/nodes/node0.properties: No such file or directory"], "stdout": "", "stdout_lines": []}

laybook is finished with code 2 2023-05-25 13:09:37 [ERROR] main -> unhandled exception java.lang.IllegalStateException: Process finished with exit code 2 at com.walmartlabs.concord.plugins.ansible.v1.RunPlaybookTask2.run(RunPlaybookTask2.java:128) at com.walmartlabs.concord.plugins.ansible.v1.RunPlaybookTask2.execute(RunPlaybookTask2.java:93) at com.walmartlabs.concord.runner.TaskCallInterceptor.invoke(TaskCallInterceptor.java:88) at com.walmartlabs.concord.runner.engine.EngineFactory$JavaDelegateHandlerImpl.execute(EngineFactory.java:219) at io.takari.bpm.reducers.ExpressionsReducer$DelegateFn.call(ExpressionsReducer.java:131) at io.takari.bpm.reducers.ExpressionsReducer$DelegateFn.call(ExpressionsReducer.java:1) at io.takari.bpm.reducers.ExpressionsReducer.reduce(ExpressionsReducer.java:66) at io.takari.bpm.reducers.CombiningReducer.reduce(CombiningReducer.java:18) at io.takari.bpm.DefaultExecutor.eval(DefaultExecutor.java:61) at io.takari.bpm.AbstractEngine.runLockSafe(AbstractEngine.java:209) at io.takari.bpm.AbstractEngine.resumeLockSafe(AbstractEngine.java:185) at io.takari.bpm.AbstractEngine.resume(AbstractEngine.java:100) at io.takari.bpm.AbstractEngine.resume(AbstractEngine.java:112) at com.walmartlabs.concord.runner.Main.resume(Main.java:310) at com.walmartlabs.concord.runner.Main.executeProcess(Main.java:180) at com.walmartlabs.concord.runner.Main.run(Main.java:145) at com.walmartlabs.concord.runner.Main.main(Main.java:507) 2023-05-25 13:09:39 [ERROR] Process exit code: 1 2023-05-25 13:09:39 [INFO ] Process status: FAILED

Please help me resolve the issue.

Regards,
Ankit Daruka

Dick Visser

unread,
May 25, 2023, 11:14:43 AM5/25/23
to ansible...@googlegroups.com
Hii
I don't know what system this is producing, it seems some Java code?
In any case, if I assume that your Java code eventually runs ansible,
then the error is clear: there is no such file or directory where
ansible expects it.
Note: this seems to happen sometimes because ansible is not run
manually, but by some machine, which may run some container or other
abstraction device internally, and that final ansible execution
environment does not have that file/directory.
In short, if you state "actually the file is present", that may be
correct, but it may be on a different system than where (you think)
ansible runs.

Since you haven't shared any playbook, it's hard to tell what goes on.
So, start by sharing your playbook.
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/98c34ce0-d046-4225-998c-ac0205656420n%40googlegroups.com.

Matt D

unread,
May 25, 2023, 4:36:46 PM5/25/23
to Ansible Project
Check the permissions on the file.

ankit daruka

unread,
May 26, 2023, 12:45:25 AM5/26/23
to ansible...@googlegroups.com
Hi Team, 

The issue is fixed. There was some configuration issue.

Thanks & Regards,
Ankit Daruka

--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/TzqMuU4OYtY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/a5a122ef-2d5e-49c7-8761-2f722859d94dn%40googlegroups.com.

Dick Visser

unread,
May 26, 2023, 6:34:06 AM5/26/23
to ansible...@googlegroups.com
> The issue is fixed. There was some configuration issue.

Hi Ankit, would you be so kind as to help others that have the same
problem, and share what this configuration issue was?
Much appreciated

ankit daruka

unread,
May 26, 2023, 6:37:00 AM5/26/23
to ansible...@googlegroups.com
Hi Dick Visser,

This issue was not ansible related. It was due to some internal project related configuration issue. The package url was incorrect so ansible was not able to download the package and hence the file was missing.

Regards,
Ankit Daruka 

--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/TzqMuU4OYtY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.

David Logan

unread,
May 29, 2023, 5:54:42 PM5/29/23
to ansible...@googlegroups.com
Perhaps check your pathnames?

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/98c34ce0-d046-4225-998c-ac0205656420n%40googlegroups.com.


--
if in trouble, or in doubt
run in circles, scream and shout
Reply all
Reply to author
Forward
0 new messages