3

Gitea is setup through a helm chart on a Kubernetes cluster. As in Gitea - SSH Auth ok but can't push to remote, SSH Auth works fine with the git user. HTTPS connections also work fine.

But when I try to push or pull via SSH, I get:

Gitea: Unauthorized
fatal: Could not read from remote repository.

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

And I have no idea what to do...

xeruf
  • 2,602
  • 1
  • 25
  • 48

1 Answers1

1

If you do see the "Hi there, You've successfully authenticated, but Gitea does not provide shell access." with ssh -Tv git@your.Gitea, that means you actually does not "have the correct access rights".

Or that you have made a small mistake in the repository URL (lowercase/upercase, or typo). That would address the second part of the error message ("the repository [does not] exists")


The OP xeruf points in the comments to metallb-gitea.yaml:

# https://metallb.org/usage/
#apiVersion: metallb.io/v1beta1
apiVersion: v1
kind: Service
metadata:
  name: gitea-ssh
  namespace: stackspout
  annotations:
    metallb.universe.tf/allow-shared-ip: "share-ipv4"
spec:
  type: LoadBalancer
  loadBalancerIP: "${ip_address}"
  ports:
    - name: ssh
      protocol: TCP
      port: 22
      targetPort: 22
  selector:
    app: gitea
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Yes, that's what I get. I have an ssh key in my account, and double-checked the repo name :/ – xeruf Aug 03 '22 at 20:02
  • @xeruf Is this an on-premise Gitea instance? Could an admin check the logs? – VonC Aug 03 '22 at 20:15
  • I am the admin :) as said, running on Kubernetes, from the official helm chart. Unfortunately, I get absolutely no logs upon performing any of these actions. – xeruf Aug 03 '22 at 21:24
  • Even after setting the log.LEVEL to trace :/ – xeruf Aug 03 '22 at 21:33
  • @xeruf So a connection issue then: the SSH query never reaches the pod where Gitea resides. Is ingress enabled? (https://gitea.com/gitea/helm-chart/#server-defaults). Is it configured properly? (as in https://gitea.com/gitea/helm-chart/issues/303) – VonC Aug 03 '22 at 21:40
  • Honestly, I am very confused. Why do I get the successful authentication via SSH but not when using git? Furthermore, `Gitea: Unauthorized` suggests to me that it does reach gitea. But I also see nothing in the logs anywhere. Also asked in https://open.greenhost.net/stackspin/stackspin/-/issues/1364 now. – xeruf Aug 09 '22 at 11:12
  • @xeruf If this related to https://open.greenhost.net/stackspin/stackspin/-/issues/1310? Because 1364 just got closed. – VonC Aug 09 '22 at 12:07
  • got it working after all, see https://open.greenhost.net/xeruf/stackspout/-/blob/main/basic/apps/code/metallb-gitea.yaml :) – xeruf Nov 14 '22 at 23:57
  • @xeruf Great, well done! What did you do to make it work? – VonC Nov 14 '22 at 23:59
  • @xeruf I have included your comment and link in the answer for more visibility. – VonC Nov 15 '22 at 00:00