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

Problem using advanced features of shell plugin on Ubuntu server #728

Open
SprickW opened this issue Mar 8, 2024 · 1 comment
Open

Problem using advanced features of shell plugin on Ubuntu server #728

SprickW opened this issue Mar 8, 2024 · 1 comment

Comments

@SprickW
Copy link

SprickW commented Mar 8, 2024

Summary

After fiddling around with tipps given in the wiki but finally not being successful I started from scratch.

My intent:

In a VM (not LXC) running Ubuntu 22.04 minimal server a regular user shall prepare and test scripts, that later shall bei executed bei Cronicle on a regular basis.

For this I cloned the shell plugin and used the advanced options and specified "Working Direktory (CWD)" and "Run as User (UID)" as home directory and uid of the intended regular user. I considered this as a feature offered by the advanced options.

When running a simple "whoami" I receive

Error: Child spawn error: bin/shell-plugin.js: Child process failed to spawn (Check executable location and permissions?)

In the docs I only found "Cronicle spawns a sub-process for each job, executes a command-line you specify, ..." but no further hints on how to use the advanced features of the shell plugin.

As "whoamin" should not cause excecution and permission problems I need further assistance.

Leaving "Working Direktory (CWD)" empty causes "whoami" to work properly.

But then trying to run a script installed by the user fails with "not found".

Steps to reproduce the problem

Copy shell plugin an use advanced features

  • with working directory and uid
  • with only uid

Your Setup

Single primary Cronicle Server

Operating system and version?

Workers in LXC and VMs in Proxmox cluster, LXC and VM Ubuntu 22.04.3 LTS

Node.js version?

v20.11.1

Cronicle software version?

Version 0.9.30

Are you using a multi-server setup, or just a single server?

Single server.

Are you using the filesystem as back-end storage, or S3/Couchbase?

filesystem

Can you reproduce the crash consistently?

yes

Log Excerpts

Case 1 (working directory and uid specified)

Script:
#!/bin/sh
whoami

Job ID: jlti5n5hf30
Event Title: maddev Test
Hostname: maddev
Date/Time: 2024/03/08 04:26:43 (GMT+0)

Job failed at 2024/03/08 04:26:43 (GMT+0).
Error: Child spawn error: bin/shell-plugin.js: Child process failed to spawn (Check executable location and permissions?)
End of log.

Case 2 (only uid specified)

#!/bin/sh
whoami
files-and-database --help

Job ID: jlti6eblq32
Event Title: maddev Test
Hostname: maddev
Date/Time: 2024/03/08 04:47:50 (GMT+0)

maddev
/tmp/cronicle-script-temp-jlti6eblq32.sh: 3: files-and-database: not found

Job failed at 2024/03/08 04:47:50 (GMT+0).
Error 127: Script exited with code: 127: /tmp/cronicle-script-temp-jlti6eblq32.sh: 3: files-and-database: not found
End of log.

@SprickW
Copy link
Author

SprickW commented Mar 8, 2024

Stupid me:

export PATH=$PATH:/home/maddev/.local/bin

solved the problem not finding the executable.

Which leaves the issues with what "Working Direktory (CWD)" is meant for.

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

1 participant