Drone

Pipeline clone falied with connection refused

After push code to gitea and Drone pipeline failed in clone phase because

Initialized empty Git repository in /drone/src/.git/
+ git fetch origin +refs/heads/master:
fatal: unable to access 'http://localhost:3000/VxSIP/hello.git/': Failed to connect to localhost port 3000: Connection refused

Environment:
OS: win10(1903)
Docker: 19.03.1

Here is docker-compose of drone:

version: '3'
services:
  drone-server:
    image: drone/drone:1.3.0
    container_name: drone-server
    restart: always
    ports:
      - "18080:80"
      # - "8000:8000"
      - 9000
    volumes:
      - D:\\data\\drone:/data:z
    environment:
      - DRONE_RUNNER_CAPACITY=2
      - DRONE_RUNNER_NETWORKS=vm-net-ci
      # - DRONE_NETWORK=${NET_BUILD}
      - DRONE_AGENTS_ENABLED=true
      - DRONE_SERVER_HOST=${DRONE_SERVER_HOST}:18080
      - DRONE_SERVER_PROTO=${DRONE_SERVER_PROTO}
      - DRONE_RPC_SECRET=${DRONE_RPC_SECRET}
      - DRONE_TLS_AUTOCERT=false
      - DRONE_LOGS_DEBUG=true
      - DRONE_LOGS_TRACE=true
      # - DRONE_LOGS_PRETTY=true
      - DRONE_LOGS_COLOR=true
      - DRONE_GIT_ALWAYS_AUTH=false
      - DRONE_GITEA=true
      - DRONE_GITEA_SERVER=${DRONE_GITEA_SERVER}
      - DRONE_GITEA_CLIENT_ID=${DRONE_GITEA_CLIENT_ID}
      - DRONE_GITEA_CLIENT_SECRET=${DRONE_GITEA_CLIENT_SECRET}
      # - DRONE_GITLAB_SERVER=${DRONE_GITLAB_SERVER}
      # - DRONE_GITLAB_CLIENT_ID=${DRONE_GITLAB_CLIENT_ID}
      # - DRONE_GITLAB_CLIENT_SECRET=${DRONE_GITLAB_CLIENT_SECRET}

  drone-agent:
    image: drone/agent:1.3.0
    container_name: drone-agent
    command: agent
    restart: always
    depends_on:
      - drone-server 
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - DRONE_RUNNER_NETWORKS=vm-net-ci
      - DRONE_SERVER_HOST=10.30.26.86:18080
      - DRONE_RPC_SERVER=10.30.26.86:9000
      # - DRONE_RPC_SERVER=http://drone-server:9090
      - DRONE_RPC_SECRET=${DRONE_RPC_SECRET}
      - DRONE_RUNNER_CAPACITY=2
      - DRONE_RUNNER_NAME=hyperV
      - DRONE_LOGS_DEBUG=true
      - DRONE_LOGS_TRACE=true
      # - DRONE_LOGS_PRETTY=true
      - DRONE_LOGS_COLOR=true

networks:
  default:
    external:
      name: ${NET_CI}

and gitea:

version: '3'
services:
  gitea:
    image: gitea/gitea:latest
    container_name: gitea-core
    restart: always
    volumes:
      - gitea-volume:/data
    ports:
      - "3000:3000"
      - "22:22"
    depends_on:
      - db
  db:
    image: mysql:latest
    container_name: gitea-db
    restart: always
    environment:
      - MYSQL_ROOT_PASSWORD=123456
      - MYSQL_DATABASE=gitea
      - MYSQL_USER=gitea
      - MYSQL_PASSWORD=123456
    volumes:
      - D:\\data\\mysql:/var/lib/mysql

volumes:
  gitea-volume:
    external: true

networks:
  default:
    external:
      name: vm-net-ci

I google it for a long time, but still no clue. I tried DRONE_RUNNER_NETWORKS and docker network connect, no luck.

I’m confued about the localhost, there no place use localhost to set up, where it comes from? I try to open drone sqlite db, but failed with disk image is malformed error.

Where is the setting wrong?

Figure out the reason. When setup the gitea, not change the default http://localhost:3000 in the base URL.

would you be able to post instructions (or link to instructions) on how to change this value? It is a pretty common issue and it would be nice to have a documented fix.