VS Code: Error creating pull request - Cannot read property 'site' of undefined
Asked by Barnett Temwa Msiska:

I am trying to make a pull request from Jira and Bitbucket (Official) VS Code Extension but get the error: "Error creating pull request - Cannot read property 'site' of undefined"

I am logged into Bitbucket from VS Code Extension and I do not know what the error means. I am working on Linux mint 20.1. Could someone assist.

Regards,

Barnett


Answers:
author: Dave Carlson
body: i was running into this issue when i tried to create a PR into the 'main' branch (for example).

if i change my approach to make the PR into 'origin/main' then the PR is created without issue.


author: Spyros Psarras
body: Um, except of "watch", can we do anything else to solve this?

Debug:

\`\`\`  
\[2023-06-06 13:15:03:619\] curl -X GET -H "User-Agent:atlascode/2.x axios/0.19.2" -H "Content-Type:application/json" -H "Authorization:Bearer XXX "<https://api.bitbucket.org/2.0/repositories/XXX>/proxy/commits?include=BACKLOG-2702-PRX---add-logging\&exclude=main\&pagelen=100"  
\[2023-06-06 13:15:03:619\] ----------------------------------------------------------------------  
\[2023-06-06 13:15:04:332\] Error: error fetching commits: TypeError: Cannot read properties of undefined (reading 'length')  
\`\`\`  
Did you guys change the API without changing the extension?


author: Douglas H. Silva
body: Change the destination branch to Origin/Master which will resolve it.  

Destination Branch  
Master = Local  
Origin/Master = Bitbucket

comments: author: Holly Williams
body: Hi Douglas, where do we change the destination branch? I've searched through all the settings for the Jira extension, in Jira itself, and it Bitbucket, and I can't find a place to change this anywhere. Thanks for your help!


author: Cedric Bernard
body: Facing also the same issue. Is there already an existing issue to track this?


author: Theodora Boudale
body: Hi Barnett,

You can report this issue and request for assistance here:

* <https://bitbucket.org/atlassianlabs/atlascode/issues>

This is the issue tracker of the repo for VS Code extension, and it is monitored by the developers of the extension.

Kind regards,  
Theodora

comments: author: Muhammed Hussein Karimi
body: submitted at <https://bitbucket.org/atlassianlabs/atlascode/issues/786/cannot-read-properties-of-undefined>


author: Praful.Shah
body: any update on this issue?


author: Rafael Barreto
body: I'm facing the same problem


author: unthar
body: I have the same issue running on Arch Linux. If I create a Pull Request in the browser then I can approve, merge, etc. But if I try to create a Pull Request in the VS Code extension it will never populate the Source nor Destination branches whether I use the dropdown or type in the branches.


author: Le Phuong
body: Same issue when trying to create a new PR from the extension.  
![Screenshot_20230421_162908.png](https://community.atlassian.com/t5/image/serverpage/image-id/253259i81D2914C6392954D/image-size/large?v=v2&px=999 "Screenshot_20230421_162908.png")

And the issues page of the extension is no longer accessible.


author: Francois Desrochers
body: Same issue here.


author: Siva kilaru
body: count one more.. Same issue when trying to create a new PR from the extension.


author: Arslan Tarar
body: Same issue here


author: Adam Cooke
body: Dito


author: Michael Nemni
body: same here


author: Dominic Saladin
body: I just switched back to VS Code 1.75.1 and installed Atlassian 3.0.2, then everything works fine.

Not ideal, but works for now.


author: magdy elmansy
body: i have the same issue


author: Daniel Ward
body: Same here.


author: Dave Carlson
body: Same same. Issue creating PR in VS Code from Atlassian Plugin.


author: lgLindstrom
body: I also have this issue


author: chris.roberts
body: As do I


author: Anna Ochab-Marcinek
body: Same here


author: Spyros Psarras
body: Um, except of "watch", can we do anything else to solve this?

Debug:

\`\`\`  
\[2023-06-06 13:15:03:619\] curl -X GET -H "User-Agent:atlascode/2.x axios/0.19.2" -H "Content-Type:application/json" -H "Authorization:Bearer XXX "<https://api.bitbucket.org/2.0/repositories/XXX>/proxy/commits?include=BACKLOG-2702-PRX---add-logging\&exclude=main\&pagelen=100"  
\[2023-06-06 13:15:03:619\] ----------------------------------------------------------------------  
\[2023-06-06 13:15:04:332\] Error: error fetching commits: TypeError: Cannot read properties of undefined (reading 'length')  
\`\`\`  
Did you guys change the API without changing the extension?  
Also, <https://bitbucket.org/atlassianlabs/atlascode/issues> is not reachable.


Tags: bitbucket-cloud

cloud