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

2.0: Copy file doesn't rename the file #646

Closed
lespadon opened this issue Feb 7, 2014 · 6 comments
Closed

2.0: Copy file doesn't rename the file #646

lespadon opened this issue Feb 7, 2014 · 6 comments
Labels
Milestone

Comments

@lespadon
Copy link

lespadon commented Feb 7, 2014

Hi,

I just tried the new file copy en rundeck 2.0.0, the file is dispatched by ssh to the server in the remote file path (/var/tmp) but isn't moved to the folder i ask for:

i ask for a copy of /home/rundeck/scripts/XISO_Upgrade.ksh -> /HOME/teamxiso/XISO_Upgrade.ksh

i found the file /var/tmp/dispatch2779041810538993679.tmp but not the target

a trace in debug mode

[workflow] beginExecuteNodeStep(ualcjvr01): NodeDispatch: com.dtolabs.rundeck.execution.PluginNodeStepExecutionItemImpl@3269f7d1
Begin copy 3699 bytes to node ualcjvr01: /home/rundeck/scripts/XISO_Upgrade.ksh -> /HOME/teamxiso/XISO_Upgrade.ksh
[script-copy] executing: /usr/bin/scp -o StrictHostKeyChecking=no -o ConnectTimeout=5 -o NumberOfPasswordPrompts=0 /home/rundeck/product/2.0/var/tmp/dispatch2779041810538993679.tmp teamxiso@ualcjvr01\:/var/tmp
Copied: /var/tmp/dispatch2779041810538993679.tmp
[workflow] finishExecuteNodeStep(ualcjvr01): NodeDispatch: Step successful
1: Workflow step finished, result: Dispatch successful (1 nodes)
[workflow] Finish step: 1,NodeDispatch
[workflow] Begin step: 2,NodeDispatch

may be i do a wrong thing?

Thanks for your help

Mat

@gschueler
Copy link
Member

Hi Mat,

It looks like you are using the script-copy plugin.

I think the script-copy file copier plugin doesn't support renaming the file yet... that is a bug.

@gschueler gschueler added this to the 2.0.1 milestone Feb 7, 2014
@gschueler gschueler added the bug label Feb 7, 2014
gschueler added a commit that referenced this issue Feb 8, 2014
* script-copy attribute must be modified to include
  ${file-copy.destination}
@gschueler
Copy link
Member

script-copy plugin should warn or fail if script-copy-remote-filepath is not set but a script is being copied

@gschueler
Copy link
Member

documentation needs re-merge

@lespadon
Copy link
Author

Hi,

just tried new version 2.0.1 but there is still a problem, files are renamed but not moved to destination folder

now files are copied to dispatch folder (/var/tmp) instead of the right folder (here: /HOME/teamxiso/v5.6/Linux/kit/) but are well renamed to the file name

What i've found in /var/tmp with 2.0.1
$ cd /var/tmp
$ ls -rtl
total 200072

-rw-rw-r-- 1 teamxiso grp_xiso 32080897 Feb 17 16:08 DUS560.taz
-rw-rw-r-- 1 teamxiso grp_xiso 26935165 Feb 17 16:08 FX25010.taz


What i've found in /var/tmp with 2.0.0
$ cd /var/tmp
$ ls -rtl
total 200072
-rwxrw-r-- 1 teamxiso grp_xiso 3699 Feb 7 16:46 dispatch4970078975612183285.tmp
-rwxrw-r-- 1 teamxiso grp_xiso 32080897 Feb 17 15:55 dispatch5156333236537873595.tmp
-rwxrw-r-- 1 teamxiso grp_xiso 32080897 Feb 17 16:01 dispatch1833165959789143801.tmp
-rwxrw-r-- 1 teamxiso grp_xiso 26935165 Feb 17 16:01 dispatch2882961201507432553.tmp


Debug Trace:

16:13:47 usocjvr03 4. mkdir Rep de dépot des fichiers [workflow] beginExecuteNodeStep(usocjvr03): NodeDispatch: com.dtolabs.rundeck.execution.ExecutionItemFactory$4@3cd16263
16:13:47 [script-exec] executing: /usr/bin/ssh -o StrictHostKeyChecking=no -o ConnectTimeout=5 -o NumberOfPasswordPrompts=0 teamxiso@usocjvr03 mkdir -p /HOME/teamxiso/v5.6/Linux/fix/ /HOME/teamxiso/v5.6/Linux/kit/
16:13:48 [script-exec]: result code: 0, success: true
16:13:48 u000ort02 4. mkdir Rep de dépot des fichiers [workflow] finishExecuteNodeStep(usocjvr03): NodeDispatch: Succeeded
16:13:48 4: Workflow step finished, result: Dispatch successful (1 nodes)
16:13:48 [workflow] Finish step: 4,NodeDispatch
16:13:48 5. Copie kit/DUS560.taz [workflow] Begin step: 5,NodeDispatch
16:13:48 5: Workflow step executing: com.dtolabs.rundeck.execution.PluginNodeStepExecutionItemImpl@569270c6
16:13:48 preparing for sequential execution on 1 nodes
16:13:48 Executing command on node: usocjvr03, NodeEntryImpl{tags=[HorsProd, schedul, jvr, soc], attributes={tags=HorsProd, jvr, schedul, soc, osFamily=unix, username=teamxiso, osArch=x86_64, description=, hostname=usocjvr03, nodename=usocjvr03, type=Node, osName=Linux}, project='null'}
16:13:48 usocjvr03 5. Copie kit/DUS560.taz [workflow] beginExecuteNodeStep(usocjvr03): NodeDispatch: com.dtolabs.rundeck.execution.PluginNodeStepExecutionItemImpl@569270c6
16:13:48 Begin copy 32080897 bytes to node usocjvr03: /net/teamxiso/du/src/v5.6/Linux/kit/DUS560.taz -> /HOME/teamxiso/v5.6/Linux/kit/DUS560.taz
16:13:48 [script-copy] executing: /usr/bin/scp -o StrictHostKeyChecking=no -o ConnectTimeout=5 -o NumberOfPasswordPrompts=0 /net/teamxiso/du/src/v5.6/Linux/kit/DUS560.taz teamxiso@usocjvr03:/var/tmp
16:13:50 Copied: /HOME/teamxiso/v5.6/Linux/kit/DUS560.taz
16:13:50 u000ort02 5. Copie kit/DUS560.taz [workflow] finishExecuteNodeStep(usocjvr03): NodeDispatch: Step successful
16:13:50 5: Workflow step finished, result: Dispatch successful (1 nodes)
16:13:50 [workflow] Finish step: 5,NodeDispatch
16:13:50 6. Copy File [workflow] Begin step: 6,NodeDispatch
16:13:50 6: Workflow step executing: com.dtolabs.rundeck.execution.PluginNodeStepExecutionItemImpl@282a0391
16:13:50 preparing for sequential execution on 1 nodes
16:13:50 Executing command on node: usocjvr03, NodeEntryImpl{tags=[HorsProd, schedul, jvr, soc], attributes={tags=HorsProd, jvr, schedul, soc, osFamily=unix, username=teamxiso, osArch=x86_64, description=, hostname=usocjvr03, nodename=usocjvr03, type=Node, osName=Linux}, project='null'}
16:13:50 usocjvr03 6. Copy File [workflow] beginExecuteNodeStep(usocjvr03): NodeDispatch: com.dtolabs.rundeck.execution.PluginNodeStepExecutionItemImpl@282a0391
16:13:50 Begin copy 26935165 bytes to node usocjvr03: /net/teamxiso/du/src/v5.6/Linux/fix/FX25010.taz -> /HOME/teamxiso/v5.6/Linux/fix/FX25010.taz
16:13:50 [script-copy] executing: /usr/bin/scp -o StrictHostKeyChecking=no -o ConnectTimeout=5 -o NumberOfPasswordPrompts=0 /net/teamxiso/du/src/v5.6/Linux/fix/FX25010.taz teamxiso@usocjvr03:/var/tmp
16:13:52 Copied: /HOME/teamxiso/v5.6/Linux/fix/FX25010.taz
16:13:52 u000ort02 6. Copy File [workflow] finishExecuteNodeStep(usocjvr03): NodeDispatch: Step successful
16:13:52 6: Workflow step finished, result: Dispatch successful (1 nodes)
16:13:52 [workflow] Finish step: 6,NodeDispatch
16:13:52 7. Copie des sources [workflow] Begin step: 7,NodeDispatch
16:13:52 7: Workflow step executing: com.dtolabs.rundeck.execution.ExecutionItemFactory$1@5e503930
16:13:52 preparing for sequential execution on 1 nodes
16:13:52 Executing command on node: usocjvr03, NodeEntryImpl{tags=[HorsProd, schedul, jvr, soc], attributes={tags=HorsProd, jvr, schedul, soc, osFamily=unix, username=teamxiso, osArch=x86_64, description=, hostname=usocjvr03, nodename=usocjvr03, type=Node, osName=Linux}, project='null'}
16:13:52 usocjvr03 7. Copie des sources [workflow] beginExecuteNodeStep(usocjvr03): NodeDispatch: com.dtolabs.rundeck.execution.ExecutionItemFactory$1@5e503930
16:13:52 [script-copy] executing: /usr/bin/scp -o StrictHostKeyChecking=no -o ConnectTimeout=5 -o NumberOfPasswordPrompts=0 /home/rundeck/product/2.0/var/tmp/dispatch3762257267216513675.tmp teamxiso@usocjvr03:/var/tmp
16:13:53 [script-exec] executing: /usr/bin/ssh -o StrictHostKeyChecking=no -o ConnectTimeout=5 -o NumberOfPasswordPrompts=0 teamxiso@usocjvr03 chmod +x /var/tmp/dispatch3762257267216513675.tmp
16:13:53 [script-exec]: result code: 0, success: true
16:13:53 [script-exec] executing: /usr/bin/ssh -o StrictHostKeyChecking=no -o ConnectTimeout=5 -o NumberOfPasswordPrompts=0 teamxiso@usocjvr03 sudo su - schedul < /var/tmp/dispatch3762257267216513675.tmp
16:13:54
16:13:54 Start of installation of a Dollar Universe Application Server 5.3 (installation kit 533 2011/05/26 18:12)
16:13:54 End of installation of a Dollar Universe Application Server 5.3 (installation kit 533 2011/05/26 18:12)
16:13:54 cp: cannot stat `/HOME/teamxiso/v5.6/Linux/kit/DUS560.taz': No such file or directory

@gschueler
Copy link
Member

Hi, what is your project configuration for the "Script Execution" file copy plugin?

notice this line:

16:13:48 [script-copy] executing: /usr/bin/scp -o StrictHostKeyChecking=no -o ConnectTimeout=5 -o NumberOfPasswordPrompts=0 /net/teamxiso/du/src/v5.6/Linux/kit/DUS560.taz teamxiso@usocjvr03:/var/tmp

Your "/usr/bin/scp" is copying to :/var/tmp.

you need to change your configuration to include ${file-copy.destination}. See the updated documentation here http:https://rundeck.org/2.0.1/plugins-user-guide/script-plugins.html#defining-the-script-copy-command

@lespadon
Copy link
Author

many thanks,

just changer my Default File Copier to
The File Copier is responsible for copying scripts as files to remote nodes before they are executed.
Script Execution Delegates file copying to an external script. Can be configured project-wide or on a per-node basis.
Command: /usr/bin/scp -o StrictHostKeyChecking=no -o ConnectTimeout=5 -o NumberOfPasswordPrompts=0 ${file-copy.file} ${job.username}@${node.hostname}:${file-copy.destination} Remote Filepath: /var/tmp/${file-copy.filename}

many thanks !!!

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

No branches or pull requests

2 participants