Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Can't connect to BitBucket server with both stashy and Bitbucket modules in Python

JohnnyAli April 27, 2022

When I try to connect to my company Bitbucket server, I get errors with both Stashy and Bitbucket modules. I gave proper credentials and url and used ssl_verify false, if I don't use it it gets another error, but as far as I know it should work without SSL.

For what I've seen it seems it doesn't log me in I guess.

 

stashy code :  

 

import stashy


bitbucket = stashy.connect("company_bitbucket_url", "username", "password", verify=False)
projects = bitbucket.projects.list()
repos = bitbucket.repos.list()

for project in projects:
for repo in bitbucket.projects["%s" % (project["key"])].repos.list():
print(repo["name"])
print(repo["project"]['key'])

 

Errors are :

File "/usr/lib/python3.6/http/client.py", line 289, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

 

File "/local/localadmin/.local/lib/python3.6/site-packages/urllib3/util/retry.py", line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='***', port=443): Max retries exceeded with url: /rest/api/1.0/projects (Caused by ProxyError('Cannot connect to proxy.', RemoteDisconnected('Remote end closed connection without response',)))

 

 

Bitbucket module code:

 

from atlassian import Bitbucket


bitbucket = Bitbucket(
url='***',
username='***',
password='***',
verify_ssl=False)
data = bitbucket.project_list()
dataList = list(data)
print(dataList)

 

Errors are: 

 

File "/local/localadmin/.local/lib/python3.6/site-packages/requests/models.py", line 960, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: URLBlocked for url: https://****/rest/api/1.0/projects.

 

File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events