scp bug (OD-2222)
conpocutmeo opened 1 year ago
I get an error while running step "Copy Files with SCP". 

This is the step in pipeline:
  - !SCPCommandStep
    name: deploy
    privateKeySecret: private_key
    source: /onedev-build/workspace/apps/my-app/dist
    target: root@@172.20.0.254:/opt/my-app/
    condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
    
This is the log of the pipeline:
15:46:04 Running step "deploy"...
15:46:06 1.1.0: Pulling from 1dev/ssh-client
15:46:06 Digest: sha256:b4521937011de01b6cbb6518c89cad533ff879b6340c3c77274e26760d6a4adb
15:46:06 Status: Image is up to date for 1dev/ssh-client:1.1.0
15:46:06 Warning: Permanently added '172.20.0.254' (ED25519) to the list of known hosts.
15:46:06 sh: scp: not found
15:46:06 lost connection
15:46:06 Command exited with code 1
15:46:06 Step "deploy" is failed (2 seconds)
15:46:14 Job finished

When I try executing the 1dev/ssh-client image with docker, it has scp command:
onedev-runner:~# docker run -it --rm 1dev/ssh-client:1.1.0 sh
# scp
usage: scp [-346ABCOpqRrsTv] [-c cipher] [-D sftp_server_path] [-F ssh_config]
           [-i identity_file] [-J destination] [-l limit]
           [-o ssh_option] [-P port] [-S program] source ... target
  • conpocutmeo changed title 1 year ago
    Previous Value Current Value
    bind mount
    scp bug
  • Robin Shen commented 1 year ago

    Works at my side both running as docker and running on bare metal. Can you please tell me detailed reproducing steps including your OS environment, docker version, OneDev version?

  • conpocutmeo changed confidential 1 year ago
    Previous Value Current Value
    true
    false
  • conpocutmeo commented 1 year ago

    Works at my side both running as docker and running on bare metal. Can you please tell me detailed reproducing steps including your OS environment, docker version, OneDev version?

    I'm using OneDev on Docker 26.1.5 (Docker is install on Alpine Linux 3.20)
    Both 1dev/server:latest and 1dev/agent:latest is up to date. 
    P/s: I use Remote Docker Executor for running jobs
    
  • conpocutmeo commented 1 year ago
    I have tried some more methods:
    - Using 1dev/agent:latest agent on Ubuntu 20.04
    - Using bare metal agent on Ubuntu 20.04
    Both fail with the same error.
    
  • Robin Shen commented 1 year ago

    Are you able to reproduce by creating an example project on this instance?

  • conpocutmeo commented 1 year ago

    Are you able to reproduce by creating an example project on this instance?

    I created a repo on this instance: https://code.onedev.io/conpocutmeo. It works with the SCP step.
    I don't know why my Onedev agent doesn't work, maybe it's install on Alpine. 
    Could you please share me how did you deploy the agent?
    
  • Robin Shen commented 1 year ago

    Make sure scp also exists in remote host you are copying file to

  • conpocutmeo commented 1 year ago

    Make sure scp also exists in remote host you are copying file to

    I installed scp on the host that running the agent and it works :)
    I thought that the 1dev/ssh-client has scp itself so it is supposed to work regardless the host that running has scp or not.
    Anyway, thanks for the advice. 
    
  • conpocutmeo changed state to 'Closed' 1 year ago
    Previous Value Current Value
    Open
    Closed
  • conpocutmeo commented 1 year ago

    Install scp on host

issue 1/1
Type
Bug
Priority
Major
Assignee
Affected Versions
latest
Labels
No labels
Issue Votes (1)
Watchers (2)
Reference
OD-2222
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover