Application Link page erroring with NullPointerException or IllegalStateException in Bamboo

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

問題

When Creating or Viewing Application Links a HTTP 500 Internal Server error occurs at <bamboo-baseURL>/plugins/servlet/applinks/listApplicationLinks with one of the following exceptions:

NullPointerException
com.atlassian.templaterenderer.RenderingException: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getOrphanedTrustCertificates' in  class com.atlassian.applinks.ui.velocity.ListApplicationLinksContext threw exception java.lang.NullPointerException at com/atlassian/applinks/ui/admin/list_application_links.vm[line 66, column 20]
	at com.atlassian.templaterenderer.velocity.one.six.internal.VelocityTemplateRendererImpl.render(VelocityTemplateRendererImpl.java:100)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
IllegalStateException
com.atlassian.templaterenderer.RenderingException: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getOrphanedTrustCertificates' in class com.atlassian.applinks.ui.velocity.ListApplicationLinksContext threw exception java.lang.IllegalStateException: adminConfig.currentApplication is not properly initialized! at com/atlassian/applinks/ui/admin/common_header.vm[line 11, column 20]
	at com.atlassian.templaterenderer.velocity.one.six.internal.VelocityTemplateRendererImpl.render(VelocityTemplateRendererImpl.java:109)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)

原因

Cause 1 - NullPointerException:

An Application Link has become corrupted in the database, possibly due to deletion and recreation.

Cause 2 - IllegalStateException: adminConfig.currentApplication is not properly initialized!

Likely misconfiguration in the hosts file.

ソリューション

Cause 1 - NullPointerException:

  1. Shutdown the Bamboo instance.
  2. Connect to the Bamboo database and execute the following SQL queries:

    データベースの変更を行う場合は必ず事前にバックアップを取得してください。可能な場合は、まずステージング サーバーで SQL コマンドの変更、挿入、更新、または削除を行うようにします。

    The following queries will remove all application links, even those that are working correctly. So, if you have more than application integrated with Bamboo, try to remove the links from the UI and contact support for more help.

    DELETE FROM trusted_apps_ips;
    DELETE FROM trusted_apps_urls;
    DELETE FROM trusted_apps;
    DELETE FROM bandana WHERE bandana_key LIKE '%applink%';
    DELETE FROM bandana WHERE bandana_key LIKE '%com.atlassian.oauth%';
  3. Edit the <bamboo-home>/xml-data/configuration/administration.xml file and remove the entire <currentApplication> tag, if it exists. For example, delete the lines below:

    <currentApplication>
        <applicationId>C0A80F180131E4494C2071A449684E94</applicationId>
        <publicKey>MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgH2SbSdLy4vKr/A0zeAO$</publicKey>
        <privateKey>MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCAfZJtJ0vLi8q$</privateKey>
    </currentApplication> 


  4. Restart the Bamboo instance.
  5. Go to the other application(s) you want to link to Bamboo and remove any application links related to Bamboo.
  6. Try to configure the the Application Link between the other application(s) and Bamboo again using the correct authentication method, which depends on the user base.

Cause 2 - IllegalStateException: adminConfig.currentApplication is not properly initialized!

Ensure you have configured /etc/hosts (Linux) or C:\Windows\System32\drivers\etc\hosts (Windows):

 

  1. Run the following command from a Terminal:

    # check your $HOSTNAME
    echo $HOSTNAME
     
    # try to ping $HOSTNAME
    ping $HOSTNAME
  2. If it returns "ping: cannot resolve <hostname>: Unknown host" then add an entry into your /etc/hosts file. For that edit /etc/hosts file and add following:

    127.0.0.1	localhost
    127.0.0.1	<hostname>
最終更新日 2018 年 11 月 2 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.