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

Private repo clonining issue #621

Open
Oolix opened this issue Jan 10, 2024 · 2 comments
Open

Private repo clonining issue #621

Oolix opened this issue Jan 10, 2024 · 2 comments
Labels
bug Something isn't working git private repo

Comments

@Oolix
Copy link

Oolix commented Jan 10, 2024

Bug description

I'm not 100% sure this is a bug but I can't find any resources on it anywhere. Essentially, I followed the docs on setting up multiple private repos on your unity app and when it gets to the stage to clone it errors on the hostname of the repo.

Here's the error:

An error occurred while resolving packages:
  Project has invalid dependencies:
    com.organization.project: Error when executing git command. ssh: Could not resolve hostname key-(long string of characters).github.com: Name or service not known
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.

    com.organization.project: Error when executing git command. ssh: Could not resolve hostname key-(long string of characters).github.com: Name or service not known
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.

    com.organization.project: Error when executing git command. ssh: Could not resolve hostname key-(long string of characters).github.com: Name or service not known
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.
./External/baselib/builds/Include/Internal/../C/Internal/Baselib_Semaphore_FutexBased.inl.h(158): Assertion failed (count >= 0) - Destruction is not allowed when there are still threads waiting on the semaphore.
Trace/breakpoint trap
Build failed, with exit code 133

How to reproduce

My yml:

name: Build Unity App for Windows x64

on:
  push:
    branches:
      - DevOpsTest

jobs:
  build:
    runs-on: self-hosted
    steps:
      - name: 'Add GitHub to the SSH known hosts file'
        run: |
          mkdir -p -m 0700 /home/runner/.ssh
          curl --silent https://api.github.com/meta | jq --raw-output '"github.com "+.ssh_keys[]' >> /home/runner/.ssh/known_hosts
          chmod 600 /home/runner/.ssh/known_hosts

      # Checkout
      - name: Checkout repository
        uses: actions/checkout@v4
        with:
          lfs: true

      # Caching
      - name: Restore Cache
        uses: actions/cache@v3
        with: 
          path: ./XRC360/Library
          key: Library-XRC360-StandaloneWindows64
          restore-keys: |
            Library-XRC360-
            Library-

      - uses: webfactory/[email protected]
        with:
          ssh-private-key: |
            ${{ secrets.FIRST_KEY }}
            ${{ secrets.SECOND_KEY }}
            ${{ secrets.THIRD_KEY }}

      - name: Prepare SSH config for unity builder
        run: |
          mkdir -p $HOME/.ssh_docker
          cp $HOME/.ssh/config $HOME/.ssh_docker/
          cp $HOME/.ssh/key* $HOME/.ssh_docker/
          cp $HOME/.ssh/known_hosts $HOME/.ssh_docker/
          sed -i 's/\/home\/runner/\/root/g' $HOME/.ssh_docker/config
          sudo chown -R root:root $HOME/.ssh_docker
          GIT_CONFIG_EXTENSIONS=$(git config --list | grep '^url\.')
          {
            echo 'GIT_CONFIG_EXTENSIONS<<EOF'
            echo "$GIT_CONFIG_EXTENSIONS"
            echo EOF
          } >> "$GITHUB_ENV"
        shell: bash

      # Build
      - name: Build Project
        uses: game-ci/unity-builder@v4
        env:
          UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
          UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
          UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
        with:
          sshAgent: ${{ env.SSH_AUTH_SOCK }}
          sshPublicKeysDirectoryPath: ${{ env.HOME }}/.ssh_docker
          customImage: 'unityci/editor:2022.3.11f1-base-3'
          targetPlatform: StandaloneWindows64
          allowDirtyBuild: true
          projectPath: ./XRC360
      
      # Upload artifact to GitHub
      - uses: actions/upload-artifact@v3
        with:
          name: Build
          path: build

Push to correct branch, wait

Expected behavior

Project to clone down dependencies.

Additional details

This is a self-hosted runner, to my knowledge I followed all of the correct steps. I configured my manifest.json to the SSH url too.

@Oolix Oolix added the bug Something isn't working label Jan 10, 2024
@Oolix
Copy link
Author

Oolix commented Feb 12, 2024

bump

@webbertakken
Copy link
Member

It seems to not be able to resolve the hostname from the context of your runner.

It's hard to say something more about it without having your complete context.

Try to determine why the hostname can not resolve. For example, inside the runner, try to connect to it manually with those credentials. Consider whether a VPN or other measures are required etc.

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

No branches or pull requests

3 participants