# Drone 0.8.1 - Can't pull from a Bitbucket private repository

**URL:** <https://drone.discourse.group/t/drone-0-8-1-cant-pull-from-a-bitbucket-private-repository/9692>\
**Category:** Drone Support\
**Created:** [October 23, 2017, 12:23pm UTC](https://drone.discourse.group/t/drone-0-8-1-cant-pull-from-a-bitbucket-private-repository/9692 "2017-10-23T12:23:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rsareth](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/rsareth/32/3762_2.png) [@rsareth](https://drone.discourse.group/u/rsareth)\
**Post date:** [October 23, 2017, 12:23pm UTC](https://drone.discourse.group/t/drone-0-8-1-cant-pull-from-a-bitbucket-private-repository/9692/1 "2017-10-23T12:23:57Z")

</div>

Hello,

I’ve read this topic, [Cannot clone private gitea repo (could not read Username for…) 0.8.0-rc.3, gitea 1.2.0-rc2](http://discuss.harness.io/t/cannot-clone-private-gitea-repo-could-not-read-username-for-0-8-0-rc-3-gitea-1-2-0-rc2/624). And I’m still facing the issue at the clone step:

```
fatal: could not read Username for 'https://bitbucket.org': No such device or address
exit status 128

```

I wanted to debug it but I don’t understand how I can debug the **plugins/git** with the **Bitbucket credentials**.

I tried with my own personal credentials and it worked:

```
$ docker run --rm \
   -e DRONE_REMOTE_URL='https://me:password@bitbucket.org/ORG/PROJECT.git' \
   -e DRONE_WORKSPACE=/go/src/bitbucket.org/ORG/PROJECT \
   -e DRONE_BUILD_EVENT=push \
   -e DRONE_COMMIT_SHA=<COMMIT_ID> \
   -e DRONE_COMMIT_REF=refs/heads/<BRANCH> \
   -e DRONE_DEBUG=true \
   -e DRONE_DEBUG_PRETTY=true \
   plugins/git
+ git init
Initialized empty Git repository in /go/src/bitbucket.org/ORG/PROJECT/.git/
+ git remote add origin https://me:password@bitbucket.org/ORG/PROJECT.git
+ git fetch --no-tags origin +refs/heads/<BRANCH>:
From https://bitbucket.org/ORG/PROJECT
 * branch <BRANCH> -> FETCH_HEAD
 * [new branch] <BRANCH> -> origin/<BRANCH>
+ git reset --hard -q <COMMIT_ID>
+ git submodule update --init --recursive

```

But how can I test the **plugins/git** with the Bitbucket environment variables (DRONE\_BITBUCKET, DRONE\_BITBUCKET\_CLIENT and DRONE\_BITBUCKET\_SECRET) ?

I’m using docker-compose to run the server and the agent on the same server. This is the yaml configuration:

```
version: '2'

services:
  drone-server:
    image: drone/drone:0.8.1
    ports:
      - 8000:8000
      - 9000:9000
    volumes:
      - /var/lib/drone:/var/lib/drone
    restart: always
    environment:
      - DRONE_OPEN=true
      - DRONE_HOST=https://my.domain.com
      - DRONE_BITBUCKET=true
      - DRONE_BITBUCKET_CLIENT=<CLIENT_ID>
      - DRONE_BITBUCKET_SECRET=<CLIENT_SECRET>
      - DRONE_SECRET=<DRONE_SECRET>
      - DRONE_ADMIN=me,you
      - DRONE_DEBUG=true
      - DRONE_DEBUG_PRETTY=true

  drone-agent:
    image: drone/agent:0.8.1
    restart: always
    depends_on: [drone-server]
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - DRONE_HOST=https://my.domain.com
      - DRONE_SERVER=drone-server:9000
      - DRONE_SECRET=<DRONE_SECRET>
      - DRONE_DEBUG=true
      - DRONE_DEBUG_PRETTY=true

```

Could you help me on this, please?

Thanks,  
Rasmey

---

<div class="post-metadata">

**Author:** ![Fendi\_D](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/fendi_d/32/3766_2.png) [@Fendi\_D](https://drone.discourse.group/u/Fendi_D)\
**Post date:** [November 6, 2017, 10:11am UTC](https://drone.discourse.group/t/drone-0-8-1-cant-pull-from-a-bitbucket-private-repository/9692/2 "2017-11-06T10:11:08Z")

</div>

when i tried to clone my private gitea repository i got the same exact exit status  
i solved the issue using :  
`- DRONE_GOGS_GIT_USERNAME=${GITEA_USERNAME}`  
`- DRONE_GOGS_GIT_PASSWORD=${GITEA_PASSWORD}`

i know its a serious security risk. .but i havent found any other solution so far. .

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [November 6, 2017, 5:49pm UTC](https://drone.discourse.group/t/drone-0-8-1-cant-pull-from-a-bitbucket-private-repository/9692/3 "2017-11-06T17:49:12Z")

</div>

@Fendi_D I do not think the gitea and bitbucket issues described here are related. Gitea introduced a code change that broke git+http authentication using netrc files. You can see the relevant Gitea issue here [https://github.com/go-gitea/gitea/issues/2480](https://github.com/go-gitea/gitea/issues/2480)

One of the gitea maintainers then submitted a patch to drone, which we merged. See [https://github.com/drone/drone/pull/2241](https://github.com/drone/drone/pull/2241).

These changes are available in the latest docker image.

---

<div class="post-metadata">

**Author:** ![Fendi\_D](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/fendi_d/32/3766_2.png) [@Fendi\_D](https://drone.discourse.group/u/Fendi_D)\
**Post date:** [November 8, 2017, 3:59pm UTC](https://drone.discourse.group/t/drone-0-8-1-cant-pull-from-a-bitbucket-private-repository/9692/5 "2017-11-08T15:59:30Z")

</div>

oh. .right. .sorry @bradrydzewski … i didnt know that. . i just have my attention on the error log and exit status … because i got the same exact error logs and i assume its the same thing. .haha . .silly me. .btw, ,thanks a lot for pointing out my mistake. .

---

<div class="post-metadata">

**Author:** ![rsareth](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/rsareth/32/3762_2.png) [@rsareth](https://drone.discourse.group/u/rsareth)\
**Post date:** [November 11, 2017, 5:30pm UTC](https://drone.discourse.group/t/drone-0-8-1-cant-pull-from-a-bitbucket-private-repository/9692/6 "2017-11-11T17:30:18Z")

</div>

Hello,

Sorry for the late response and thank you for your responses.

I fixed my problem. I need to remove the repo and re-added again. And everything works well.

BTW, @bradrydzewski, please put all the documentation in one place. It was really confusing to me.

Thank you,  
Rasmey

---

<div class="post-metadata">

**Author:** ![anaganisk](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/anaganisk/32/5177_2.png) [@anaganisk](https://drone.discourse.group/u/anaganisk)\
**Post date:** [September 27, 2018, 4:06am UTC](https://drone.discourse.group/t/drone-0-8-1-cant-pull-from-a-bitbucket-private-repository/9692/7 "2018-09-27T04:06:01Z")

</div>

Hey @bradrydzewski is this fixed yet? I linked bitbucket successfully but the repo list show its empty. None of my repositories are fetched.

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [September 27, 2018, 4:12am UTC](https://drone.discourse.group/t/drone-0-8-1-cant-pull-from-a-bitbucket-private-repository/9692/8 "2018-09-27T04:12:53Z")

</div>

What needs fixing? I am not aware of anything being broken with Bitbucket. The Bitbucket implementation has been in place for 3+ years and is being used by a number of teams. Also I believe this particular thread is about an error cloning a repository (likely related to a DNS issue on the host machine), not about the repository list being empty …

But if you think there might be an issue, you can see the Bitbucket code [here](https://github.com/drone/drone/tree/master/remote/bitbucket). If you have any suggested improvements or patches please consider sending a pull request.
