[SOLVED] Git clone step adding wrong origin address

This is the error I’m getting:

+ git init
Initialized empty Git repository in /go/src/192.168.1.173/git/joel/femtoman/.git/
+ git remote add origin http://192.168.173/git/joel/femtoman.git
+ git fetch --no-tags origin +refs/heads/master:
fatal: unable to access 'http://192.168.173/git/joel/femtoman.git/': Failed to connect to 192.168.173 port 80: 
Operation timed out
exit status 128

As you can see, the “remote add origin” step, is adding the wrong origin address. It is missing a number in the IP address. I can’t figure out where drone is getting this address from.

I had this all working fine a few months ago, but I moved gitea to a different server (so it got a new IP address), and now I’m having all sorts of headaches. .173 is the correct gitea address

Any help is much appreciated!

The address is stored in the database. It sounds like you need to go into the database and update the repo_clone_url in the repos table to ensure it is using the correct address.

Thank you for getting back to me!

I completely removed the drone_drone-server-data volume, which houses my sqlite database, but when i brought drone back online and tried again, I’m getting the same error. Should this not have fixed it, since it was starting from scratch?

EDIT: In fact, as I had no other important docker containers, I removed all containers and all volumes to force it to remake everything from scratch, and i’m STILL having the error. I feel like I’m overlooking something here.

In this case, the clone URL comes directly from the Gitea repository API call. If the clone URL is incorrect that would imply the Gitea payload is using the wrong address. You may want to reach out to the Gitea support folks to see if they can help further.

Relevant code in Drone: https://github.com/drone/drone/blob/master/remote/gitea/helper.go#L48

Example response body:

{
  "id": 1,
  "owner": {
    "id": 1,
    "login": "go-gitea",
    "full_name": "go-gitea",
    "email": "",
    "avatar_url": "http://gogs.io/avatars/1",
    "username": "go-gitea"
  },
  "name": "gitea",
  "full_name": "go-gitea/gitea",
  "description": "",
  "private": true,
  "fork": false,
  "parent": null,
  "empty": false,
  "mirror": false,
  "size": 4485120,
  "html_url": "https://try.gitea.io/go-gitea/gitea",
  "ssh_url": "[email protected]:go-gitea/gitea.git",
+ "clone_url": "https://try.gitea.io/go-gitea/gitea.git",
  "website": "",
  "stars_count": 0,
  "forks_count": 0,
  "watchers_count": 2,
  "open_issues_count": 0,
  "default_branch": "master",
  "created_at": "2017-10-22T18:25:33Z",
  "updated_at": "2017-11-16T22:07:01Z",
  "permissions": {
    "admin": true,
    "push": true,
    "pull": true
  }
}

Thank you so much!!!

I had a mis-configured line in my gitea configuration which was sending the wrong address.

The example response body you posted helped me to find it, and have already gotten it working.

You rock!