Copy file working on all nodes except RUnDeck server

727 views
Skip to first unread message

Willem D'Haese

unread,
Jul 26, 2016, 9:51:55 AM7/26/16
to rundeck-discuss
Hello,

I made a job which starts with a step which copies a bash script to the home folder of the user used to connect to the node.

Source:
/var/rundeck/projects/DAF/scripts/daf_linux_functions.sh
Destination
~/daf_linux_functions.sh

This works fine on all my nodes. But when I try to run this on the RunDeck server, it fails. these are the logs:

Begin copy 1218 bytes to node srvrundeck: /var/rundeck/projects/DAF/scripts/daf_linux_functions.sh -> ~/daf_linux_functions.sh
Failed: CopyFileFailed: com.dtolabs.rundeck.core.execution.service.FileCopierException: error writing to tempfile: ~/daf_linux_functions.sh (No such file or directory)
[workflow] finishExecuteNodeStep(srvrundeck): NodeDispatch: CopyFileFailed: com.dtolabs.rundeck.core.execution.service.FileCopierException: error writing to tempfile: ~/daf_linux_functions.sh (No such file or directory)
1: Workflow step finished, result: Dispatch failed on 1 nodes: [srvrundeck: CopyFileFailed: com.dtolabs.rundeck.core.execution.service.FileCopierException: error writing to tempfile: ~/daf_linux_functions.sh (No such file or directory)]

I have no idea why it fails on The RunDeck server. When I try to 'su rundeck' and execute 'scp /var/rundeck/projects/DAF/scripts/daf_linux_functions.sh ~/daf_linux_functions.sh' it works fine.

Any insights are welcome. :)

Grtz

Willem

Alex Honor

unread,
Jul 26, 2016, 10:24:11 AM7/26/16
to rundeck...@googlegroups.com
Hi Willem,

I think the problem might be because the tilde is not substituted in the local case. Does the job dispatch to the local node or is it a local command? Perhaps you can paste the job definition.

--
You received this message because you are subscribed to the Google Groups "rundeck-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rundeck-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rundeck-discuss/6ff62640-6373-4498-b2f2-9b38e90bc2aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Alex Honor

[SimplifyOps, Inc | a...@simplifyops.com ]

Be sure to comment and vote on Rundeck Feature Development!

Willem D'Haese

unread,
Jul 26, 2016, 11:09:50 AM7/26/16
to rundeck-discuss
Alex,

Thanks for your answer. I think the job dispatches to the local node (and remote nodes if selected). This is the job definition:

- description: Manages FireMotD on Linux servers.
  executionEnabled: true
  group: Linux/Templates
  id: 6c970e16-b8c1-46ee-a8f2-f2faae74cca2
  loglevel: DEBUG
  multipleExecutions: true
  name: DAF-Linux-FireMotD
  nodefilters:
    dispatch:
      excludePrecedence: true
      keepgoing: false
      rankOrder: ascending
      threadcount: 1
    filter: 'os-name: Linux'
  nodesSelectedByDefault: false
  scheduleEnabled: true
  sequence:
    commands:
    - configuration:
        destinationPath: ~/daf_linux_functions.sh
        echo: 'true'
        sourcePath: /var/rundeck/projects/DAF/scripts/daf_linux_functions.sh
      description: Copy Linux Functions
      nodeStep: true
      type: copyfile
    - configuration:
        destinationPath: /etc/profile.d/daf_linux_logon.sh
        echo: 'true'
        sourcePath: /var/rundeck/projects/DAF/scripts/daf_linux_logon.sh
      description: 'Copy Logon Script => '
      nodeStep: true
      type: copyfile
    - description: 'Clone and Make => '
      script: |-
        #!/bin/bash
        Verbose=1
        . ~/daf_linux_functions.sh
        WriteLog Output Info "Removing FireMotD folder."
        rm -R FireMotD -f
        WriteLog Output Info "Checking git existence."
        git --version 2>&1 >/dev/null
        GitInstalled=$?
        if [ $GitInstalled -eq 0 ]; then
            WriteLog Output Info "Cloning FireMotD."
            git clone https://github.com/willemdh/FireMotD.git
            cd FireMotD
            WriteLog Output Info "Making FireMotD."
            sudo make all
            exit 0
        else
            WriteLog Output Error "Git not installed."
            exit 2
        fi
        exit 3
    keepgoing: true
    strategy: node-first
  uuid: 6c970e16-b8c1-46ee-a8f2-f2faae74cca2

Willem D'Haese

unread,
Aug 2, 2016, 7:40:46 AM8/2/16
to rundeck-discuss
Alex,

Fyi, the issue must have something to do with the syntax for the homefolder ~/daf_linux_functions.sh. When I attempt a copy to for example /tmp/daf_linux_functions.sh or /var/lib/rundeck/daf_linux_functions.sh it works perfect.

When I cat /etc/passwd the homefolder is /var/lib/rundeck
Permissions seem ok..

Could someone verify if you can execute a file copy to local rundeck node homefolder with target ~/samplefile.test

Tx and grtz

Alex Honor

unread,
Aug 2, 2016, 8:03:01 PM8/2/16
to rundeck-discuss
Yes, I think for the local node, the tilde is not getting expanded.

Willem D'Haese

unread,
Aug 3, 2016, 2:58:21 AM8/3/16
to rundeck-discuss
Alex,

I made a low prio issue for this. Thanks for confirming!

Willem

Peter Garlic

unread,
Aug 23, 2016, 2:58:25 AM8/23/16
to rundeck-discuss
I had the same issue on 2.6.7 because we have some hardenized systems (you can´t run nothing from /tmp or /var ) so I´ve used the tilde as target path with the same issue.
I´ve solved configuring on node list inside resources.xml the rundeck server as localhost.
don´t ask me why, but works on my system :D
-Peter

Maddineni Rakesh

unread,
Dec 11, 2019, 7:22:20 AM12/11/19
to rundeck-discuss
We do have a same type of issue we have a thread count of 10 and we have applied 11 it  works for the 10 and fails for the 11th one but the same job runs successfully for all the 11 nodes when the thread count is set to 1.

Reiner Acuña

unread,
Dec 11, 2019, 8:29:24 AM12/11/19
to rundeck-discuss
Hi Maddineni,

Which Rundeck version are you using? Any example job definition to make some tests? (change any sensitive information).

Thanks

Regards.

Maddineni Rakesh

unread,
Dec 11, 2019, 8:37:47 AM12/11/19
to rundeck-discuss
Hi Reiner,

We are using 2.3.6 

Maddineni Rakesh

unread,
Dec 11, 2019, 8:40:44 AM12/11/19
to rundeck-discuss
and the source and Destination path we have is Source Path: /tmp/run/${job.execid}/temporary_1 Destination Path: C:\Temp\${option.admin-user}.pem

Reiner Acuña

unread,
Dec 11, 2019, 10:28:00 AM12/11/19
to rundeck-discuss
Hi Maddineni,

Seems very similar to this issue (solved since 2.4) :

https://github.com/rundeck/rundeck/issues/1015 (with this kind of consequences: https://github.com/rundeck/rundeck/issues/1055)

Good advice is to test with the latest Rundeck version (3.1.3 at this moment, and 3.2 on the way) on your test environment. The newest version has a lot of bugfixes and new features.

Remember that you can always use dedicated support in case you have some issues/questions with Rundeck Enterprise, the support team will help you ASAP :-)

Regards!
Reply all
Reply to author
Forward
0 new messages