Hello! I’ve been wanting to upgrade to 1.0.0-rc.4 and tried to change everything accordingly like adding DRONE_GIT_USERNAME and DRONE_GIT_PASSWORD with a set of credentials I created for drone in Gogs and toggling DRONE_GIT_ALWAYS_AUTH=true. I’m still getting this however:
Initialized empty Git repository in /drone/src/.git/
+ git fetch origin +refs/heads/master:
fatal: could not read Username for 'https://git.mydomain.com': No such device or address
Maybe it’s something related to using HTTPS instead of SSH, which I’m avoiding since Gogs recommends using HTTPS when using its docker image.
Previously, I used drone 0.6.x, and it did work, but I’m not looking forward into downgrading.
I looked into the sqlite database and saw that the repository wasn’t marked as private, so I did it manually (updating the row to have repo_private = 1 and repo_visilibity = private) but still no luck. I may be missing some environment variable, I currently have these set:
However, some things have changed especially on the environment variables front, and I’m afraid some of it no longer applies (like the DRONE_GOGS_PRIVATE_MODE doesn’t seem to exist anymore for example).
Private mode was deprecated in favor of DRONE_GIT_ALWAYS_AUTH=true
When always auth is true it will instruct Drone to always clone the repository with credentials, regardless of whether or not the repository is private.
Very interesting. I have that toggled in my environment variables:
But it seems like it doesn’t even attempt to login using my provided credentials DRONE_GIT_USERNAME and DRONE_GIT_PASSWORD in Gogs (hence this error). I’m thinking that what causes this problem is my single machine setup .
Update: The same happens if I have one agent, so unrelated I guess.
You will notice that Git will return this error under a variety of circumstances, which may not have anything to do with the actual username or password.
It is more likely that Drone simply cannot reach your Gogs server because you are using custom Docker networks and Docker internal DNS, and the clone container is running on a completely separate Docker network.
And case closed, looks like gogs didn’t set the password correctly for the account I created. If someone else wants to debug this, I recommend setting up your .drone.yml like this:
if DRONE_REPO_PRIVATE env return false, means your repo on gogs was not privated
even though you go back to your repo and set privated it still doesn’t work, and i found drone cache all repo infomation on its database which is database.sqlite