pull-request-notifier-for-bitbucket icon indicating copy to clipboard operation
pull-request-notifier-for-bitbucket copied to clipboard

Configuration UI is broken - Uncaught Error: plugin/prnfb/admin missing aui

Open romandecker opened this issue 6 years ago • 10 comments

We are no longer able to configure the plugin from its configuration UI. The notifications we have configured in the past continue to work, but the configuration UI is broken for us, so we can't make any changes.

  • Bitbucket Server version used: v6.3.0

When opening the configuration UI, the dropdowns for buttons and notifications stay empty, event though we have notifications configured (and they still work!). We also get the following console log in the browser devtools:

Uncaught Error: plugin/prnfb/admin missing aui
    at w (almond.js?_statichash=1b4fe21375bf56ecfa2584c852c3927b-CDN%2F369421503%2F811079b%2F1389%2F449808fae6ab9437afa8f189c3a82e50&locale=en-US:11)
    at u (almond.js?_statichash=1b4fe21375bf56ecfa2584c852c3927b-CDN%2F369421503%2F811079b%2F1389%2F449808fae6ab9437afa8f189c3a82e50&locale=en-US:9)
    at g (almond.js?_statichash=1b4fe21375bf56ecfa2584c852c3927b-CDN%2F369421503%2F811079b%2F1389%2F449808fae6ab9437afa8f189c3a82e50&locale=en-US:11)
    at require (require-lite.js?_statichash=1b4fe21375bf56ecfa2584c852c3927b-CDN%2F369421503%2F811079b%2F1389%2F449808fae6ab9437afa8f189c3a82e50&locale=en-US:3)
    at HTMLDocument.<anonymous> (admin.js?_statichash=d41d8cd98f00b204e9800998ecf8427e-CDN%2F369421503%2F811079b%2F1389%2F3.24:1)
    at c (jquery.js?_statichash=1b4fe21375bf56ecfa2584c852c3927b-CDN%2F369421503%2F811079b%2F1389%2F449808fae6ab9437afa8f189c3a82e50&locale=en-US:30)
    at Object.fireWith [as resolveWith] (jquery.js?_statichash=1b4fe21375bf56ecfa2584c852c3927b-CDN%2F369421503%2F811079b%2F1389%2F449808fae6ab9437afa8f189c3a82e50&locale=en-US:30)
    at Function.ready (jquery.js?_statichash=1b4fe21375bf56ecfa2584c852c3927b-CDN%2F369421503%2F811079b%2F1389%2F449808fae6ab9437afa8f189c3a82e50&locale=en-US:30)
    at HTMLDocument.H (jquery.js?_statichash=1b4fe21375bf56ecfa2584c852c3927b-CDN%2F369421503%2F811079b%2F1389%2F449808fae6ab9437afa8f189c3a82e50&locale=en-US:30)

Configuration

http://localhost:7990/bitbucket/rest/prnfb-admin/1.0/settings

{
    "adminRestriction": "ADMIN",
    "keyStorePassword": "KEEP_THIS_TO_LEAVE_UNCHANGED",
    "shouldAcceptAnyCertificate": false
}

http://localhost:7990/bitbucket/rest/prnfb-admin/1.0/settings/buttons

[
    {
        "buttonFormList": [],
        "buttonFormListString": "[]",
        "name": "",
        "projectKey": "PRS",
        "repositorySlug": "sps",
        "uuid": "6510b76f-c485-49fe-b657-a7f85d2b1955"
    }
]

http://localhost:7990/bitbucket/rest/prnfb-admin/1.0/settings/notifications

[
    {
        "filterRegexp": "^develop$",
        "filterString": "${PULL_REQUEST_TO_BRANCH}",
        "headers": [],
        "method": "GET",
        "name": "Build Preview on merges to develop",
        "password": "KEEP_THIS_TO_LEAVE_UNCHANGED",
        "projectKey": "PRS",
        "proxyPassword": "KEEP_THIS_TO_LEAVE_UNCHANGED",
        "proxyUser": "KEEP_THIS_TO_LEAVE_UNCHANGED",
        "repositorySlug": "prs",
        "triggerIfCanMerge": "ALWAYS",
        "triggerIgnoreStateList": [],
        "triggers": ["DECLINED", "MERGED"],
        "updatePullRequestRefs": false,
        "url": "https://our.configured.url.com/whatever",
        "user": "KEEP_THIS_TO_LEAVE_UNCHANGED",
        "uuid": "f32a09cc-3ab0-4e90-87bc-8de808e06887",
        "postContentEncoding": "NONE"
    },
    {
        "filterRegexp": "^develop$",
        "filterString": "${PULL_REQUEST_TO_BRANCH}",
        "headers": [],
        "method": "GET",
        "name": "Build feature branches before merges to develop",
        "password": "KEEP_THIS_TO_LEAVE_UNCHANGED",
        "projectKey": "PRS",
        "proxyPassword": "KEEP_THIS_TO_LEAVE_UNCHANGED",
        "proxyUser": "KEEP_THIS_TO_LEAVE_UNCHANGED",
        "repositorySlug": "prs",
        "triggerIfCanMerge": "ALWAYS",
        "triggerIgnoreStateList": [],
        "triggers": ["OPENED", "RESCOPED_FROM"],
        "updatePullRequestRefs": false,
        "url": "https://our.configured.url.com/whatever",
        "user": "KEEP_THIS_TO_LEAVE_UNCHANGED",
        "uuid": "6fdb9046-095d-4332-b1e1-60ac41279da4",
        "postContentEncoding": "NONE"
    },
    {
        "headers": [],
        "method": "POST",
        "name": "Cleanup after merge",
        "password": "KEEP_THIS_TO_LEAVE_UNCHANGED",
        "projectKey": "PRS",
        "proxyPassword": "KEEP_THIS_TO_LEAVE_UNCHANGED",
        "proxyUser": "KEEP_THIS_TO_LEAVE_UNCHANGED",
        "repositorySlug": "sps",
        "triggerIfCanMerge": "ALWAYS",
        "triggerIgnoreStateList": [],
        "triggers": ["DECLINED", "DELETED", "MERGED"],
        "updatePullRequestRefs": false,
        "url": "https://our.configured.url.com/whatever",
        "user": "KEEP_THIS_TO_LEAVE_UNCHANGED",
        "uuid": "890ea06f-4e1e-494e-8219-30759165e882",
        "postContentEncoding": "NONE"
    },
    {
        "headers": [],
        "method": "GET",
        "name": "Create isolated environment for PR",
        "password": "KEEP_THIS_TO_LEAVE_UNCHANGED",
        "projectKey": "PRS",
        "proxyPassword": "KEEP_THIS_TO_LEAVE_UNCHANGED",
        "proxyUser": "KEEP_THIS_TO_LEAVE_UNCHANGED",
        "repositorySlug": "sps",
        "triggerIfCanMerge": "ALWAYS",
        "triggerIgnoreStateList": [],
        "triggers": ["OPENED", "REOPENED", "RESCOPED_FROM"],
        "updatePullRequestRefs": false,
        "url": "https://our.configured.url.com/whatever",
        "user": "KEEP_THIS_TO_LEAVE_UNCHANGED",
        "uuid": "80b09b75-9cbf-444a-a166-f344ceb3e695",
        "postContentEncoding": "NONE"
    },
    {
        "filterRegexp": "Test",
        "filterString": "${BUTTON_TRIGGER_TITLE}",
        "headers": [],
        "method": "GET",
        "name": "Notification",
        "password": "KEEP_THIS_TO_LEAVE_UNCHANGED",
        "projectKey": "PRS",
        "proxyPassword": "KEEP_THIS_TO_LEAVE_UNCHANGED",
        "proxyUser": "KEEP_THIS_TO_LEAVE_UNCHANGED",
        "repositorySlug": "prs",
        "triggerIfCanMerge": "ALWAYS",
        "triggerIgnoreStateList": [],
        "triggers": ["BUTTON_TRIGGER"],
        "updatePullRequestRefs": false,
        "url": "https://our.configured.url.com/whatever",
        "user": "KEEP_THIS_TO_LEAVE_UNCHANGED",
        "uuid": "ee6ddb8c-ba02-466e-88ca-a61507305536",
        "postContentEncoding": "NONE",
        "httpVersion": "HTTP_1_1"
    }
]

romandecker avatar Aug 20 '19 10:08 romandecker

Install latest version of the plugin.

See: https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/issues/321

tomasbjerre avatar Aug 20 '19 10:08 tomasbjerre

We already are on 4.1, the issue is still happening.

romandecker avatar Aug 21 '19 07:08 romandecker

I am able to use the global, project and repo -level configuration pages in Bitbucket Server v6.5.1.

I made the test with this configuration: https://github.com/tomasbjerre/bitbucket-server-jenkins-release-tags

tomasbjerre avatar Aug 21 '19 14:08 tomasbjerre

I tried with a completely fresh project and repo and get the error immediately. Maybe the error will go away when we update bitbucket to v6.5.1

romandecker avatar Aug 21 '19 14:08 romandecker

Bitbucket Server 6.6.1 and seeing this error

atikhono avatar Sep 27 '19 14:09 atikhono

Looks like AUI was updated from 7 to 8 in Bitbucket Server 6: https://developer.atlassian.com/server/bitbucket/reference/api-changelog/

And that is documented here: https://docs.atlassian.com/aui/8.0.0/docs/upgrades/aui-8.html

The new API is documented here: https://docs.atlassian.com/aui/8.5.1/docs/helper.html

And that means, the js-files: https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/tree/master/src/main/resources Cannot require @atlassian/aui.

It is really strange that this does not happen to me when I use Bitbucket Server 6. I also tried 6.5.1.

I test it like this:

  • docker run -p 7990:7990 atlassian/bitbucket-server
  • Upload the 4.1 release
  • Browse to http://localhost:7990/plugins/servlet/prnfb/admin
  • I can save all kinds of configuration

You can check what version of AUI you are using, by hitting F12 in Chrome and check the body-tag:

aui810

tomasbjerre avatar Sep 27 '19 17:09 tomasbjerre

Opened an issue here: https://community.developer.atlassian.com/t/how-to-get-ajs-contextpath-in-aui-8/32202

tomasbjerre avatar Sep 27 '19 18:09 tomasbjerre

Bitbucket Server 6.6.1 and seeing this error

Sorry @tomasbjerre, my bad, all seems working with BBS 6.6.1. We had the outdated plugin from Atlasssian Marketplace. When we installed the latest version from github releases, the issue has disappeared.

atikhono avatar Sep 27 '19 20:09 atikhono

Hm, we just updated to 6.6.1 and the issue still happens for us :/

romandecker avatar Sep 30 '19 07:09 romandecker

Upgraded to Atlassian Bitbucket v6.9.1 and still seeing the issue.

dperezcl avatar Aug 26 '20 19:08 dperezcl