Gitea Runner / Recursive Checkout

I’m currently setting up my first repository on my self-hosted Gitea instance using submodules contained in the instance.

Azure DevOps generally doesn’t have an issue with this, but Gitea apparently does.

At first my repository pulled the repo (in the same org as the parent repo) via CPM, but that didn’t work in the runner.

I got this error:

[ 11%] Creating directories for 'procsys_utils-populate'
[ 22%] Performing download step (git clone) for 'procsys_utils-populate'
Cloning into 'procsys_utils-src'...
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Cloning into 'procsys_utils-src'...
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Cloning into 'procsys_utils-src'...
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
-- Had to git clone more than once: 3 times.
CMake Error at procsys_utils-subbuild/procsys_utils-populate-prefix/tmp/procsys_utils-populate-gitclone.cmake:39 (message):
  Failed to clone repository:
  'ssh://gitea@<me>/<ORG>/procsys_common.git'

As I said, the repo structure is as follows:

PARENT_ORG/
            PARENT
            CHILD

So instead I removed the reference from CPM and added it as a git submodule.
This is a tried-and-true method. Or so I thought.

.gitmodules:
[submodule "submodules/procsys_common"]
	path = submodules/procsys_common
	url = ssh://gitea@<me>/<ORG>/procsys_common.git

However, no matter if I try actions/checkout@v4/v3 or set different options, it always ends up in an error like the following:

Fetching submodules
[command]/usr/bin/git submodule sync --recursive
[command]/usr/bin/git -c protocol.version=2 submodule update --init --force --depth=1 --recursive
Submodule 'submodules/procsys_common' (ssh://gitea@<me>/<ORG>/procsys_common.git) registered for path 'submodules/procsys_common'
Cloning into '/workspace/<ORG>/<PROJECT>/submodules/procsys_common'...
Permission denied, please try again.
Permission denied, please try again.
Received disconnect from <IP> port <PORT>:2: Too many authentication failures
Disconnected from <IP> port <PORT>
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'ssh://gitea@<me>/<ORG>/procsys_common.git' into submodule path '/workspace/<ORG>/<PROJECT>/submodules/procsys_common' failed
Failed to clone 'submodules/procsys_common'. Retry scheduled
Cloning into '/workspace/<ORG>/<PROJECT>/submodules/procsys_common'...
Permission denied, please try again.
Permission denied, please try again.
Received disconnect from <IP> port <PORT>:2: Too many authentication failures
Disconnected from <IP> port <PORT>
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'ssh://gitea@<me>/<ORG>/procsys_common.git' into submodule path '/workspace/<ORG>/<PROJECT>/submodules/procsys_common' failed
Failed to clone 'submodules/procsys_common' a second time, aborting
::remove-matcher owner=checkout-git::
::error::The process '/usr/bin/git' failed with exit code 1

I have setup a specific gitea user with an SSH key and set it up in the runner.

      - name: Checkout Repository
        uses: actions/checkout@v4
        with:
          submodules: recursive
          ssh-key: ${{secrets.PROCSYS_SSH_KEY}}
          ssh-user: gitea

Following step prepares the build:


      - name: Prepare Run
        run: |
          sudo apt update
          sudo apt install cmake g++-10 make build-essential nodejs doxygen graphviz npm -y
          sudo npm -g install quicktype
          ssh-keyscan -p <PORT> -t ed25519 <me> >> ~/.ssh/known_hosts
          git config --global --add url.https://<me>:3000/.insteadOf gitea@<me>/

What am I doing wrong?

Thank you for any help!
Sorry for so much snipping, I’m not at liberty to disclose some of the information.

Hey,

u wrote “I have setup a specific giteas user…” what exactly you have done?

Are you using the build in SSH Server and changed the username in app.ini too? If not have a look into Configuration Cheat Sheet | Gitea Documentation

Under Server you have serveral settings for the ssh part.

The “Permission denied, please try again.” message seems that your key or user is not correct I think.

Greetings