Fatal: could not read Username for GITEA_URL: No such device or address. Existing info not helping

I tried different approaches in this forum, but no luck. I can curl repository successfully, here is my .env config for drone docker:

DRONE_GITEA_SERVER=https://gitea.my-server.ru
DRONE_GITEA_CLIENT_ID=SECRET
DRONE_GITEA_CLIENT_SECRET=CLIENT_SECRET
DRONE_RPC_SECRET=RPC_SECRET
DRONE_SERVER_HOST=drone.my-server.ru
DRONE_SERVER_PROTO=https
DRONE_GIT_USERNAME=drone
DRONE_GIT_PASSWORD=drone_password

Gitea logs shows Unauthorized access.

Repository is in organization. Organization available for logged in users, repository is not private.

I learned there are many and many different forum topics here about this problem and almost each one of them use outdated env variables and configuration options.

Drone successfully gets commits, starts builds, but I always get this error about could not read Username.

I don’t understand why it won’t even use my special drone gitea users username and password, since this user specifically added into organization for drone to work without problems.
I added it into the starting script like this:

#!/bin/bash

source ./.env

docker stop drone
docker rm drone

docker run \
  --volume=/var/lib/drone:/data \
  --env=DRONE_AGENTS_ENABLED=true \
  --env=DRONE_GIT_USERNAME=${DRONE_GIT_USERNAME} \
  --env=DRONE_GIT_PASSWORD=${DRONE_GIT_PASSWORD} \
  --env=DRONE_GITEA_SERVER=${DRONE_GITEA_SERVER} \
  --env=DRONE_GITEA_CLIENT_ID=${DRONE_GITEA_CLIENT_ID} \
  --env=DRONE_GITEA_CLIENT_SECRET=${DRONE_GITEA_CLIENT_SECRET} \
  --env=DRONE_RPC_SECRET=${DRONE_RPC_SECRET} \
  --env=DRONE_SERVER_HOST=${DRONE_SERVER_HOST} \
  --env=DRONE_SERVER_PROTO=${DRONE_SERVER_PROTO} \
  --env=DRONE_GITEA_SKIP_VERIFY=true \
  --publish=3012:80 \
  --restart=always \
  --detach=true \
  --name=drone \
  drone/drone:1

I’m using latest available versions of Drone and Gitea.

Drone runner also working via docker.

I think I am having trouble understanding this issue report. Where do you experience this issue? What are steps to produce? What are the expected results? What are the actual results?

I ask because this looks like a git clone error, but reading the issue description I could not be certain.

You also mentioned you searched existing threads and tried different approaches. Which approaches have you tried? The most common root causes are related to networking (using docker networks and running everything on the same server) and issues related to private mode. Have you ruled these out? If so how?

1 Like

I’m really sorry for making duplicate thread.

I was confused by previous resolutions that used older versions than current.
Thought it’s kinda new error.

In the end, I overcame this error with different approach (not fixing oauth drone-gitea, if I’m right)

In the end, what I did:

  1. I created drone user in my gitea instance.
  2. Added it to needed internal repositories and organizations read-only mode.
  3. Used it’s username and password in those env variables:

DRONE_GIT_USERNAME
DRONE_GIT_PASSWORD

  1. Added

DRONE_GIT_ALWAYS_AUTH

  1. It worked.

In the end I needed to force git auth for drone.

Again, sorry for not trying everything.

I run into the same issue and the FAQ for that error couldn’t help me solve it…

Here is some backgrounds info :
I had a clear instance of gitea & drone running good with docker-compose on the same server.
A few repository were deploying nicely with drone.
Then I had to create and organisation and move one of them into it passing ownership.
That is when things start to go wrong and I get stuck with that error ''Fatal: could not read Username for GITEA_URL : terminal prompts disabled ‘’

Yet the error I had is slightly different, I post here because it is the solution mentionned by @idchlife that got me to solve the issue.

I believe it is just a work-around and I would love to have a more stable solution for that problem.
I haven’t got the opportunity to do so but it might be easily reproducable when you switch repo to organisation ownership…