Errors encountered while adding some reviewers to this pull request.

Issue #348 open
Mark Pender created an issue

Opening PR with a list of default users results in this error, removing all reviewers works.

Version 2.3.2

Comments (21)

  1. Mark Pender reporter

    The error on vscode is ‘Errors encountered while adding some reviewers to this pull request’

    Is there actual logs i can get from vscode?

  2. Jonathan Doklovic Account Deactivated

    @Mark Pender There are two ways to see errors:

    For UI errors:

    • open the UI in question
    • open the VS Code command palette
    • find “Developer: Open Web Developer Tools”
    • you’ll get a chrome dev tools panel and errors might show up in the console.

    For extension/http errors:

    • from the VS Code command palette, open “Preferences: Open Settings (UI)”
    • in the search box type “output level”
    • Find the “Atlascode: Output Level” select box and choose “debug”
    • in the bottom VS Code pane, go to the OUTPUT tab
    • in the select box on the right, choose “Atlassian”
    • You’ll now see logging from our extension

    If you want to debug the http requests our extension makes, you can have it log every request to the Atlassian OUTPUT pane (mentioned above) as curl commands

    • from the VS Code command palette, open “Preferences: Open Settings (UI)”
    • in the search box type “curl”
    • Find the “Atlascode: enable curl logging” checkbox and make sure it’s checked
    • now all requests will be logged and you can copy/paste the entire curl comman into a terminal and run it to see what Jira returns

    Let me know if any of those methods give you any more information.

    Thanks!

  3. Pramod Busam Account Deactivated

    (pasting Thorsten Frei's comment after removing auth info):

    I have the same error when creating a pull request.

    VSC 1.42.0 Jira and Bitbucket (Official) 2.4.0

    extension/http error: Error: error creating pull request: [object Object]

    curl output: curl -X POST -H "Content-Type:application/json" -H "Authorization:Basic <auth>" --data '{"title":"title","description":"description","fromRef":{"id":"bugfix/feature-x","repository":{"slug":"suite","project":{"key":"project"}}},"toRef":{"id":"master"},"reviewers":[{"user":{"name":"lxw"}},{"user":{"name":"mxs1"}},{"user":{"name":"mxs2"}},{"user":{"name":"pxy"}},{"user":{"name":"sxw"}},{"user":{"name":"txh"}},{"user":{"name":"uxr"}}]}' "https://bitbucket.local/rest/api/1.0/projects/project/repos/suite/pull-requests?markup=true&avatarSize=64"

  4. Mark Pender reporter

    Apologies, here is my error

    [2020-02-07 17:00:28:717] curl -X POST -H "Content-Type:application/json" -H "Authorization:Basic RANDOMSTRINGSTUFF=" --data '{"title":"vm-issue","description":"\n\n---\n_Created from_ Atlassian for VS Code","fromRef":{"id":"vm-issue","repository":{"slug":"ansible","project":{"key":"$TEAM"}}},"toRef":{"id":"dev"},"reviewers":[{"user":$LOTS OF USERS IN A DICT }]}' "https://STASH_URL/rest/api/1.0/projects/$TEAM/repos/ansible/pull-requests?markup=true&avatarSize=64"
    [2020-02-07 17:00:28:717] ----------------------------------------------------------------------
    [2020-02-07 17:00:29:599] Error: error creating pull request: [object Object]

    we are using stash however.

    VSC Version: 1.41.1

    Debug mode enabled and curl commands as requested

  5. Jan Kappen

    Same problems here with Bitbucket 4.14.4.

    curl -X PUT -H "Content-Type:application/json" -H "Authorization:Basic <string>" 
    --data '{"version":0,"title":"The title","reviewers":[{"user":{"name":"<USERNAME>"}}]}' 
    "https://<LINK_TO_BB>/rest/api/1.0/projects/<key>/repos/<repo>/pull-requests/2"
    
    
    Error: error adding reviewer: [object Object]
    

    The Username exists and the link works, too.

    However, the error is

    {"errors":[{"context":"reviewers","message":"Errors encountered while adding some reviewers to this pull request.",
    "exceptionName":"com.atlassian.bitbucket.pull.InvalidPullRequestReviewersException",
    "reviewerErrors":[{"context":"<USER>","message":"<USER> is not a user.","exceptionName":null}],
    "validReviewers":[]}]}(base)
    

    So looks like the username is wrong. But the user exists! If I go to https://<LINK_TO_BB>/users/<USER> the user’s profile is shown. Is this a upper/lower case problem maybe?

    Thanks.

  6. Nick Rundquist

    @Jan Kappen , can you verify that you’re able to add that reviewer using the web interface?

  7. Mark Pender reporter

    is the issue possibly down to how the plugin looksup a given user? perhaps with users who have special characters. For a PR, we use a default list of reviewers to a specific branch. what is the plugin doing when it gets a list of users? I assume it just passes the same data back that it got during the first phase of the PR setup

  8. Jan Kappen

    @Nick Rundquist , yes we could add that user via the Webinterface.

    I found out it is a upper/lower case problem. The user has a key, coming from the LDAP server. It is “AB####” with # being a digit. The user also has a name: “name, first name”. When I choose the name from reviewers list, the curl command uses the lowercase version of the user key: “ab####”. I called the curl command with ‘AB’ (uppercase) and it worked.

    In the webinterface it does not make any difference if I type <URL>/users/ab#### or <URL>/users/AB####, the same user is shown. But in the profile information, below the name the key is in upper case.

    Hope that helps 🙂

  9. Kristóf Siket

    Hello. I”m experiencing the same problem. Via curl, by sending the upper case version of the user name, it works. However, to make full use of the plugin, we would need it to be triggered from VSCode UI as well.

    When can we expect this bug to be solved?

    By the way, besides this small issue, the extension is great. 🙂 Perfect for BB-Jira-VSCode stack 😉

  10. djflex68

    I’m having the same issue. Reviewers that I’m trying to attach to the pull requests do not have any special characters in their names. If I leave Reviewers empty, I can create the pull request.
    [2021-03-19 10:21:25:521]  Error: error creating pull request: [object Object]

    What is going on ? When will this bug be fixed ?!

  11. Peter Foti

    I’m also facing this issue. User’s can be assigned to the pull request (via the web interface) after I create it, but not at creation time within VS Code, which somewhat defeats the purpose of using the extension to create pull requests. 1 year and 3 months since this bug was opened, with no progress.

  12. Kelly Selden

    We had the issue where someone left the company and was still a reviewer on a bunch of PRs causing this error when trying to edit and save. Hopefully this helps some other people getting this error.

  13. Kyle Gottfried

    I’ve confirmed that even if all reviewers are active associates with no special characters this still reproduces.

  14. Jakub Gąsiorowski

    The same. The hint in the reviewer box works correctly, but save ends up with the error.

  15. Log in to comment