Skip to content

Bitbucket Cloud not working #1069

@hyunlee1o

Description

@hyunlee1o

This code is not working. Seems like Cloud works and Bitbucket doesn't.

oauth2 = {
    'client_id': os.getenv('client-id'),
    'token': {
        'token_type': 'Bearer',
        'access_token': os.getenv('access-token')
    },
}

cloud = Cloud(
    url="https://api.bitbucket.org/",
    oauth2=oauth2,
    cloud=True,
    # advanced_mode=True
)

res = cloud.get("repositories/test")

bitbucket = Bitbucket(
    url="https://api.bitbucket.org/",
    oauth2=oauth2,
    cloud=True,
)

p = list(bitbucket.project_list())

The error i get is:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/.cache/pypoetry/virtualenvs/autogit-qXb98hrH-py3.10/lib/python3.10/site-packages/atlassian/bitbucket/base.py", line 59, in _get_paged
    response = self.get(url, trailing=trailing, params=params, data=data, flags=flags, absolute=absolute)
  File "/home/user/.cache/pypoetry/virtualenvs/autogit-qXb98hrH-py3.10/lib/python3.10/site-packages/atlassian/rest_client.py", line 273, in get
    "GET",
  File "/home/user/.cache/pypoetry/virtualenvs/autogit-qXb98hrH-py3.10/lib/python3.10/site-packages/atlassian/rest_client.py", line 245, in request
    return response
  File "/home/user/.cache/pypoetry/virtualenvs/autogit-qXb98hrH-py3.10/lib/python3.10/site-packages/atlassian/rest_client.py", line 407, in raise_for_status
    else:
requests.exceptions.HTTPError

I made a print so that the url that is called gets printed and i got this:
url => https://api.bitbucket.org/2.0/projects

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions