Cannot get netrc file

Hi, I have a problem when i try to run my project i got an error with this
ics: invalid character '<' looking for beginning of value
I dont know what i can do to correct the problem
and i can run other projects

.drone.yml

kind: pipeline
name: ics

steps:
- name: runit
  image: alpine
  commands:
  - apk update
  - apk add node yarn chromium
  - yarn
  - node index.js

drone.env

DRONE_GITEA_SERVER=https://git.delta-wings.net/
DRONE_GITEA_CLIENT_ID=replaced
DRONE_GITEA_CLIENT_SECRET=replaced

DRONE_ADMIN=Avior
DRONE_USER_CREATE=username:Avior,admin:true
DRONE_OPEN=true
DRONE_HOST=http://localhost

DRONE_RPC_SECRET=replaced
DRONE_RPC_PROTO=https
DRONE_RPC_HOST=ci.delta-wings.net

DRONE_RUNNER_CAPACITY=2
DRONE_RUNNER_NAME=Runner

DRONE_GIT_ALWAYS_AUTH=false

DRONE_SERVER_PROTO=https
DRONE_SERVER_HOST=ci.delta-wings.net
DRONE_SECRET=replaced

docker-compose.yml

services:
  drone-server:
    image: drone/drone:1
    ports:
      - 127.0.0.1:3003:80
      - 9000
    volumes:
      - ./drone-server-data:/var/lib/drone/
      - /var/run/docker.sock:/var/run/docker.sock
      - ./data:/data
    restart: always
    env_file:
      - ./drone.env
  drone-agent:
    image: drone/agent:1
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    restart: always
    env_file:
      - ./drone.env

drone logs

drone-server_1  | {"error":"invalid character '\u003c' looking for beginning of value","level":"warning","msg":"manager: cannot generate netrc","repo.id":48,"repo.name":"studiomoto/competition_recoverer","time":"2019-10-18T07:52:08Z"}
drone-agent_1   | {"arch":"amd64","build":8,"error":"invalid character '\u003c' looking for beginning of value","level":"warning","machine":"Runner","msg":"runner: cannot get netrc file","os":"linux","repo":"studiomoto/competition_recoverer","stage":1,"stage-id":36,"time":"2019-10-18T07:52:08Z"}

see the Invalid Endpoint, Proxy Problems section of this thread which describes some ways this can happen.

1 Like

I have the exact same problem, but the given link on the previous message did not help.
My agent connects directly to drone (without reverse proxy).

My configuration is more or less the same as Aviortheking.
The runner correctly connects to the drone server (I get the "“runner: polling queue” message).

My drone is connected to my GITEA instance.
Everything works perfectly with public repositories, but with private repositories, I get the following :

drone                | {"admin":true,"level":"debug","msg":"api: access granted","name":"test-ci","namespace":"username","read":true,"request-id":"1W2bL7lIdgJX8vhhepmGNIIPQzz","time":"2020-01-06T22:42:57Z","user.login":"username","visibility":"private","write":true}
drone                | {"admin":true,"level":"debug","msg":"api: access granted","name":"test-ci","namespace":"username","read":true,"request-id":"1W2bL7lIdgJX8vhhepmGNIIPQzz","time":"2020-01-06T22:42:57Z","user.login":"username","visibility":"private","write":true}
drone                | {"commit":"6eb8a426542cd171b11b6eeb533a606ab3fee597","event":"push","level":"debug","msg":"trigger: received","ref":"refs/heads/develop","repo":"username/test-ci","time":"2020-01-06T22:42:57Z"}
drone                | {"fields.time":"2020-01-06T22:42:57Z","latency":212216791,"level":"debug","method":"POST","msg":"","remote":"172.20.0.12:45836","request":"/api/repos/username/test-ci/builds/2","request-id":"1W2bL7lIdgJX8vhhepmGNIIPQzz","time":"2020-01-06T22:42:57Z"}
drone-runner         | 2020/01/06 22:42:57 [DEBUG] POST https://drone.myserver.com/rpc/v1/accept
drone                | {"admin":true,"level":"debug","msg":"api: access granted","name":"test-ci","namespace":"username","read":true,"request-id":"1W2bL90WoZfWOqTIbIN5Z6ePFCv","time":"2020-01-06T22:42:57Z","user.login":"username","visibility":"private","write":true}
drone                | {"admin":true,"level":"debug","msg":"api: access granted","name":"test-ci","namespace":"username","read":true,"request-id":"1W2bL5mS96M44ALjwHNZ0OVSjKb","time":"2020-01-06T22:42:57Z","user.login":"username","visibility":"private","write":true}
drone                | {"fields.time":"2020-01-06T22:42:57Z","latency":659294,"level":"debug","method":"GET","msg":"","remote":"172.20.0.12:45846","request":"/api/repos/username/test-ci","request-id":"1W2bL90WoZfWOqTIbIN5Z6ePFCv","time":"2020-01-06T22:42:57Z"}
drone                | {"level":"debug","machine":"268bc9a097cc","msg":"manager: accept stage","stage-id":3,"time":"2020-01-06T22:42:57Z"}
drone                | {"fields.time":"2020-01-06T22:42:57Z","latency":1397240,"level":"debug","method":"GET","msg":"","remote":"172.20.0.12:45848","request":"/api/repos/username/test-ci/builds/3","request-id":"1W2bL5mS96M44ALjwHNZ0OVSjKb","time":"2020-01-06T22:42:57Z"}
drone                | {"level":"debug","machine":"268bc9a097cc","msg":"manager: stage accepted","stage-id":3,"time":"2020-01-06T22:42:57Z"}
drone-runner         | {"arch":"amd64","level":"debug","machine":"268bc9a097cc","msg":"runner: get stage details from server","os":"linux","stage-id":3,"time":"2020-01-06T22:42:57Z"}
drone-runner         | 2020/01/06 22:42:57 [DEBUG] POST https://drone.myserver.com/rpc/v1/details
drone-runner         | {"arch":"amd64","level":"debug","machine":"268bc9a097cc","msg":"runner: watch for cancel signal","os":"linux","time":"2020-01-06T22:42:57Z"}
drone-runner         | 2020/01/06 22:42:57 [DEBUG] POST https://drone.myserver.com/rpc/v1/watch
drone                | {"level":"debug","msg":"manager: fetching stage details","step-id":3,"time":"2020-01-06T22:42:58Z"}
drone-runner         | 2020/01/06 22:42:58 [DEBUG] POST https://drone.myserver.com/rpc/v1/netrc
drone                | {"error":"invalid character '\u003c' looking for beginning of value","level":"warning","msg":"manager: cannot generate netrc","repo.id":1,"repo.name":"username/test-ci","time":"2020-01-06T22:42:58Z"}
drone-runner         | {"arch":"amd64","build":3,"error":"invalid character '\u003c' looking for beginning of value","level":"warning","machine":"268bc9a097cc","msg":"runner: cannot get netrc file","os":"linux","repo":"username/test-ci","stage":1,"stage-id":3,"time":"2020-01-06T22:42:58Z"}
drone-runner         | 2020/01/06 22:42:58 [DEBUG] POST https://drone.myserver.com/rpc/v1/afterAll
drone                | {"level":"debug","msg":"manager: stage is complete. teardown","stage.id":3,"time":"2020-01-06T22:42:58Z"}
drone                | {"build.id":3,"build.number":3,"level":"debug","msg":"manager: build is finished, teardown","repo.id":1,"stage.id":3,"time":"2020-01-06T22:42:58Z"}

I tried everything for the past 3 days … Any idea what’s happening ?

I’ve done a work around the issue:
in the env I added

DRONE_GIT_USERNAME=username
DRONE_GIT_PASSWORD=password
DRONE_GIT_ALWAYS_AUTH=true

after that it worked