[solved] Cannot clone gitea repository - missing server url

Hi,

i just started to dive in drone - but i have some issues with my gitea-server. I can authenticate without problems, fetching repo list, set webhooks and so on - everyything seems to work fine

but when i start a build, it fails on clone step:

+ git init
Initialized empty Git repository in /drone/src/username/repo/.git/
+ git remote add origin /username/repo.git
+ git fetch --no-tags origin +refs/heads/master:
fatal: '/username/repo.git' does not appear to be a git repository
fatal: Could not read from remote repository.

seems like the gitea server is lost?
also tried the gogs driver, but the issue is still there.

in the docker-compose.yaml i added DRONE_GITEA and DRONE_GITEA_URL as described in the docs.

gitea version is 1.3.1
drone version 0.8.4

thanks a lot for any help!

Please share your complete docker-compose configuration with only your secrets redacted. Also please see read this thread which is probably related.

Thanks for your fast response!
my setup is far easier than in the other thread:

version: '2'

services:
  drone-server:
    image: drone/drone:0.8

    ports:
      - 8333:8000
      - 9000
    volumes:
      - ./.drone:/var/lib/drone/
    restart: always
    environment:
      - DRONE_OPEN=true
      - DRONE_HOST=https://drone.drailing.net
      - DRONE_SECRET=xxx
      - DRONE_GITEA=true
      - DRONE_GITEA_URL=http://gitea.drailing.net

  drone-agent:
    image: drone/agent:0.8

    command: agent
    restart: always
    depends_on:
      - drone-server
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - DRONE_SERVER=drone-server:9000
      - DRONE_SECRET=xxx

only thing that is a bit diffrent: letsencrypt certificate is added from the certbot on the apache reverse proxy

alright, i got it…

i noticed that the contents of the webhook only contains the /user/repo.git as clone_url and http_url - i updated the gitea conf and set the ROOT_URL correctly - no the data in the webhool seems to be correct.

tested again - same results, url is missing, drone cannot clone.

luckily this was a fresh install of drone, so i just deleted the sqlite db and started again - aaand its working!

is it possible that drone saves or caches the clone_url from the first webhook request?

ROOT_URL env set in /data/gitea/conf/app.ini worked for me.
Mapped as a volume from outside the container. Setting it from docker-compose didn’t work.

[server]
ROOT_URL=http://git-server:3000