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

Error in /home/runner/.ssh/config #14

Closed
gansm opened this issue Dec 22, 2022 · 12 comments
Closed

Error in /home/runner/.ssh/config #14

gansm opened this issue Dec 22, 2022 · 12 comments
Labels
bug Something isn't working

Comments

@gansm
Copy link

gansm commented Dec 22, 2022

Since December 8, GitHub Action for FreeBSD, NetBSD, and OpenBSD no longer work for me. On December 7, everything was still working. Looks to me like an empty variable.

I receive the following output:

Run cross-platform-actions/action@v0.6.2
  with:
    operating_system: freebsd
    version: 13.0
    shell: bash
    run: uname -a
  freebsd-version
  whoami
  pwd
  sudo env IGNORE_OSVERSION=yes pkg update -f
  sudo pkg install -y lang/gcc devel/autotools autotools automake autoconf autoconf-archive libtool pkgconf devel/ncurses devel/cppunit cppunit
  g++ --version
  autoreconf -v --install --force
  ./configure --prefix=/usr
  make -j10

Downloading disk image: https://github.com/cross-platform-actions/freebsd-builder/releases/download/v0.2.0/freebsd-13.0-x86-64.qcow2
Downloading hypervisor: https://github.com/cross-platform-actions/resources/releases/download/v0.5.0/qemu-system-x86_64-linux.tar
Downloading resources: https://github.com/cross-platform-actions/resources/releases/download/v0.5.0/resources-linux.tar
/usr/bin/truncate -s 40m /tmp/resourcescgpR6b/res.raw
/usr/bin/ssh-keygen -t ed25519 -f /tmp/resourcescgpR6b/id_ed25519 -q -N 
/usr/sbin/fdisk /tmp/resourcescgpR6b/res.raw

Welcome to fdisk (util-linux 2.37.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x470d6395.

Command (m for help): Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): Partition number (1-4, default 1): First sector (2048-81919, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-81919, default 81919): 
Created a new partition 1 of type 'Linux' and of size 39 MiB.

Command (m for help): The partition table has been altered.
Syncing disks.

/usr/bin/sudo losetup -f --show --offset 1048576 --sizelimit 40894464 /tmp/resourcescgpR6b/res.raw
/dev/loop3
/usr/bin/sudo mkfs.fat -F32 /dev/loop3
mkfs.fat 4.2 (2021-01-31)
/usr/bin/sudo mount -o uid=1001 /dev/loop3 /tmp/resourcescgpR6b/mount/RES
/usr/bin/sudo umount /tmp/resourcescgpR6b/mount/RES
/usr/bin/sudo losetup -d /dev/loop3
Downloaded file: /home/runner/work/_temp/c11061fd-0c62-4b61-ae04-33b9bd68ec75
Downloaded file: /home/runner/work/_temp/374c6c8c-59d9-4690-a6a9-69bfbe9053c1
Downloaded file: /home/runner/work/_temp/0d035091-a74d-4037-b5f2-f0bb3f4dff28
Unarchiving hypervisor: /home/runner/work/_temp/374c6c8c-59d9-4690-a6a9-69bfbe9053c1
Unarchiving resources: /home/runner/work/_temp/c11061fd-0c62-4b61-ae04-33b9bd68ec75
/usr/bin/tar -x --warning=no-unknown-keyword -C /home/runner/work/_temp/2bb90f00-e8b9-49e6-93ee-1384c6f1d076 -f /home/runner/work/_temp/374c6c8c-59d9-4690-a6a9-69bfbe9053c1
/usr/bin/tar -x --warning=no-unknown-keyword -C /home/runner/work/_temp/6eea3f1c-0469-4779-b6fa-79ca4ae9b0e4 -f /home/runner/work/_temp/c11061fd-0c62-4b61-ae04-33b9bd68ec75
/home/runner/work/_temp/6eea3f1c-0469-4779-b6fa-79ca4ae9b0e4/qemu-img convert -f qcow2 -O raw /home/runner/work/_temp/0d035091-a74d-4037-b5f2-f0bb3f4dff28 /home/runner/work/_temp/6eea3f1c-0469-4779-b6fa-79ca4ae9b0e4/disk.raw
Initializing VM
Booting VM   
Waiting for VM to be ready...
Executing command inside VM: true
/usr/bin/ssh -t runner@localhost
/home/runner/.ssh/config line 6: no argument after keyword "sendenv"
/home/runner/.ssh/config: terminating, 1 bad configuration options
Waiting for VM to be ready...
Executing command inside VM: true
/usr/bin/ssh -t runner@localhost
/home/runner/.ssh/config line 6: no argument after keyword "sendenv"
/home/runner/.ssh/config: terminating, 1 bad configuration options
Waiting for VM to be ready...
Executing command inside VM: true
/usr/bin/ssh -t runner@localhost
/home/runner/.ssh/config line 6: no argument after keyword "sendenv"
/home/runner/.ssh/config: terminating, 1 bad configuration options
Waiting for VM to be ready...
Executing command inside VM: true
/usr/bin/ssh -t runner@localhost
/home/runner/.ssh/config line 6: no argument after keyword "sendenv"
/home/runner/.ssh/config: terminating, 1 bad configuration options
Waiting for VM to be ready...
Executing command inside VM: true
/usr/bin/ssh -t runner@localhost
/home/runner/.ssh/config line 6: no argument after keyword "sendenv"
/home/runner/.ssh/config: terminating, 1 bad configuration options
Waiting for VM to be ready...
Executing command inside VM: true
/usr/bin/ssh -t runner@localhost
/home/runner/.ssh/config line 6: no argument after keyword "sendenv"
/home/runner/.ssh/config: terminating, 1 bad configuration options
Waiting for VM to be ready...
Executing command inside VM: true
/usr/bin/ssh -t runner@localhost
/home/runner/.ssh/config line 6: no argument after keyword "sendenv"
/home/runner/.ssh/config: terminating, 1 bad configuration options
Waiting for VM to be ready...
Executing command inside VM: true
/usr/bin/ssh -t runner@localhost
/home/runner/.ssh/config line 6: no argument after keyword "sendenv"
/home/runner/.ssh/config: terminating, 1 bad configuration options
Waiting for VM to be ready...
Executing command inside VM: true
/usr/bin/ssh -t runner@localhost
/home/runner/.ssh/config line 6: no argument after keyword "sendenv"
/home/runner/.ssh/config: terminating, 1 bad configuration options
Waiting for VM to be ready...
Executing command inside VM: true
/usr/bin/ssh -t runner@localhost
/home/runner/.ssh/config line 6: no argument after keyword "sendenv"
/home/runner/.ssh/config: terminating, 1 bad configuration options
Waiting for VM to be ready...
Executing command inside VM: true
/usr/bin/ssh -t runner@localhost
/home/runner/.ssh/config line 6: no argument after keyword "sendenv"
/home/runner/.ssh/config: terminating, 1 bad configuration options
Waiting for VM to be ready...
Executing command inside VM: true
/usr/bin/ssh -t runner@localhost
/home/runner/.ssh/config line 6: no argument after keyword "sendenv"
/home/runner/.ssh/config: terminating, 1 bad configuration options
Waiting for VM to be ready...
Executing command inside VM: true
/usr/bin/ssh -t runner@localhost
/home/runner/.ssh/config line 6: no argument after keyword "sendenv"
/home/runner/.ssh/config: terminating, 1 bad configuration options
Waiting for VM to be ready...
Executing command inside VM: true
/usr/bin/ssh -t runner@localhost
/home/runner/.ssh/config line 6: no argument after keyword "sendenv"
/home/runner/.ssh/config: terminating, 1 bad configuration options
Waiting for VM to be ready...
Executing command inside VM: true
/usr/bin/ssh -t runner@localhost
Terminating VM
/home/runner/.ssh/config line 6: no argument after keyword "sendenv"
/home/runner/.ssh/config: terminating, 1 bad configuration options
/usr/bin/sudo kill -s TERM 1766
Error: write EPIPE
Error: The operation was canceled.
@jacob-carlborg
Copy link
Contributor

Hmm, might be something on the runner that has changed.

@jacob-carlborg jacob-carlborg added the bug Something isn't working label Dec 22, 2022
@jacob-carlborg
Copy link
Contributor

@gansm
Copy link
Author

gansm commented Dec 22, 2022

I just noticed that the Ubuntu version has changed from 20.04.5 (LTS) to 22.04.1(LTS)

Last working build: https://github.com/gansm/finalcut/actions/runs/3634569559/jobs/6132780682

Current runner version: '2.299.1'
Operating System
  Ubuntu
  20.04.5
  LTS

Current build: https://github.com/gansm/finalcut/actions/runs/3754613414/jobs/6378990692

Current runner version: '2.299.1'
Operating System
  Ubuntu
  22.04.1
  LTS

@jacob-carlborg
Copy link
Contributor

I see that you recently added an environment variable to the usage of this action. Could you please try to remove that and see if it makes any difference.

      env:
        WORKSPACE_PATH: "${{ github.workspace }}"

@jacob-carlborg
Copy link
Contributor

Yes, that's definitely it. I managed to reproduce it.

BTW, if you set an environment variable using env, it won't automatically be available inside the VM. You need to explicitly forward the environment variables to the VM using the environment_variables input, see https://github.com/cross-platform-actions/action#inputs.

@gansm
Copy link
Author

gansm commented Dec 22, 2022

It works now with environment_variables. So I was already on the right way, with setting an environment variable. It's just stupid that we now have to set an environment variable to make /usr/bin/ssh -t runner@localhost work.

Is there any hope that it will work again in the future without this workaround?

@jacob-carlborg
Copy link
Contributor

Is there any hope that it will work again in the future without this workaround?

It has always been required to use the environment_variables input. The GitHub Action API doesn't provide a way to get the specified environment variables. You only get access to all environment variables as you would in any other programming language environment. At least that was the case when I initial created this action. But I can take a look again to see if it's possible.

@gansm
Copy link
Author

gansm commented Dec 23, 2022

I'm afraid you misunderstood me. I don't want to use any environment variables at all. But it seems that I have to do it now. If I don't set an environment variable, you have in the /home/runner/.ssh/config in line 6 only "sendenv" without a parameter.

@jacob-carlborg
Copy link
Contributor

Yes, and I think I still misunderstand you. If you don't want to use any environment variables, why did you add one? It should work if you remove:

      env:
        WORKSPACE_PATH: "${{ github.workspace }}"

@jacob-carlborg
Copy link
Contributor

jacob-carlborg commented Dec 24, 2022

Hmm, ok. So removing the environment variable doesn't help. Now I understand the problem (I think 😄). Since no one has reported this before it has to be related to a new version of Ubuntu, which probably comes with a new version of SSH. I'm using environment variables in the pipeline for this action, therefore I haven't encountered the issue myself.

@gansm
Copy link
Author

gansm commented Dec 24, 2022

I believe that in the old (20.04) Ubuntu ${this.input.environmentVariables} always had a content. This no longer seems to be the case. It now causes a wrong configuration file to be created in action.ts.

[...]
    const lines = [
      'StrictHostKeyChecking=accept-new',
      `Host ${ipAddress}`,
      `Port ${this.operatingSystem.ssHostPort}`,
      `IdentityFile ${this.privateSshKey}`,
      'SendEnv CI GITHUB_*',
      `SendEnv ${this.input.environmentVariables}`,  // <==== Line 6
      'PasswordAuthentication no'
    ].join('\n')
[...]

@jacob-carlborg
Copy link
Contributor

Fixed in 0.7.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants