Custom plugin causes timeout on startup

Hey community,

My current plugin project causes Jira to lock up on startup, due to some plugins not loading in time.
I have followed the steps at troubleshooting jira startup, increasing the wait time and the jvm allocated memory, but with either and both options enabled, startup still fails.

Deleting the plugin from the application home file, solves the lockup, but it is not a viable long term solution.

It’s notable that installing the plugin does not cause any errors or problems.

EDIT: I’ve tried disabling the plugin before shutdown and enabling it afterwards, and this functions normally. This leads me to believe the problem is not related to incorrect destruction of the plugin upon shutdown.

Any suggestions?

If it proves helpful, I ‘avoided’ the problem by no longer building my project in IntelliJ, but only from the command line using atlas-package. I think that IntelliJ pulls in a version of Maven that is incompatible with JIRA 7.2 (but I am not 100% certain).

1 Like

I already build with the sdk (with atlas-mvn clean package, but that should be equivalent). What version of the sdk do you use?

Which add-ons are giving you the issue? Is it things like the dashboard add-on? Take a look at https://confluence.atlassian.com/jirakb/jira-applications-system-plugin-timeout-while-waiting-for-add-ons-to-enable-212173447.html and try increasing the timeout for plugins to 300 seconds. I’ve had similar experiences when my machine was underpowered and really busy.

1 Like

I’ve tried to increase the timeout, first 300, then 600. Then, following another thread, I’ve increased the -Xmx to 1024m. At this point I was seeing in the logs that the amount of timed out plugins decreased, I put the timeout to 900, but no improvement came from that.

I doubt it’s a memory problem though, since there’s no OutOfMemoryErrors in the logs. I could increase the timeout by another 300 seconds, but that’s unreasonably long.

Here is the log section on th failed plugins.

    ___ Plugin System Started _________________
    
2017-05-16 15:38:36,855 JIRA-Bootstrap FATAL      [c.a.jira.startup.JiraStartupLogger] 
    
    ********************************************************************************************************************************************************************************************************
    The following plugins are required by JIRA, but have not been started: 
JIRA Projects Plugin(com.atlassian.jira.jira-projects-plugin),
 Atlassian Navigation Links Plugin (com.atlassian.plugins.atlassian-nav-links-plugin),
 Atlassian JIRA - Plugins - Project Config Plugin (com.atlassian.jira.jira-project-config-plugin), 
Applinks - Plugin - Core (com.atlassian.applinks.applinks-plugin), 
Atlassian OAuth Service Provider Plugin (com.atlassian.oauth.serviceprovider), 
Embedded Gadgets Plugin (com.atlassian.gadgets.embedded), 
Gadget Directory Plugin (com.atlassian.gadgets.directory), 
Atlassian JIRA - Plugins - Gadgets Plugin (com.atlassian.jira.gadgets), 
Atlassian JIRA - Plugins - Global Issue Navigator (com.atlassian.jira.jira-issue-nav-plugin), 
Atlassian JIRA - Plugins - Quick Edit Plugin (com.atlassian.jira.jira-quick-edit-plugin), 
Atlassian REST - Module Types (com.atlassian.plugins.rest.atlassian-rest-module), 
Atlassian JIRA - Plugins - REST Plugin (com.atlassian.jira.rest), 
Opensocial Plugin (com.atlassian.gadgets.opensocial), 
Gadget Dashboard Plugin (com.atlassian.gadgets.dashboard)
    ********************************************************************************************************************************************************************************************************
    
2017-05-16 15:38:36,857 JIRA-Bootstrap ERROR      [c.a.jira.upgrade.UpgradeLauncher] Skipping, JIRA is locked.
2017-05-16 15:38:36,858 JIRA-Bootstrap INFO      [c.a.jira.scheduler.JiraSchedulerLauncher] JIRA Scheduler not started: JIRA startup checklist failed.
2017-05-16 15:38:36,883 JIRA-Bootstrap WARN      [c.a.jira.startup.JiraStartupLogger] 
    

and there is the log section on memory use for that sequence

2017-05-16 15:38:36,890 JIRA-Bootstrap INFO      [c.a.jira.startup.DefaultInstantUpgradeManager] Late startup launchers took 0s
2017-05-16 15:38:36,911 JIRA-Bootstrap INFO      [c.a.jira.startup.LauncherContextListener] Memory Usage:
    ---------------------------------------------------------------------------------
      Heap memory     :  Used:  427 MiB.  Committed:  567 MiB.  Max:  992 MiB
      Non-heap memory :  Used:  199 MiB.  Committed:  213 MiB.  Max: 1264 MiB
    ---------------------------------------------------------------------------------
      TOTAL           :  Used:  625 MiB.  Committed:  780 MiB.  Max: 2256 MiB
    ---------------------------------------------------------------------------------
2017-05-16 15:39:36,445 localhost-startStop-2 INFO      [c.a.jira.startup.DefaultJiraLauncher] Stopping launchers
2017-05-16 15:39:36,492 localhost-startStop-2 INFO      [c.a.plugin.manager.DefaultPluginManager] Preparing to shut down the plugin system
2017-05-16 15:39:36,508 localhost-startStop-2 INFO      [c.a.plugin.manager.DefaultPluginManager] Shutting down the plugin system

I guess your plugin use some components which are currently not available while your plugin is trying to get started

Add the following to the

	<plugin-info>
		<description>${project.description}</description>
		<version>${project.version}</version>
                ...
        </plugin-info>

tag in your atlassian-plugin.xml

<startup>late</startup>

This tells JIRA to load your plugin not at the beginning of the Plugin System Startup

So long

4 Likes

Thanks for the help, this seems to have fixed the issue.

Turns out the issue was that the IntelliJ IDE generated a dependency on com.sun.jersey jersey-client 1.8 which caused atlas-run to fail with a locked server. Changing the version to 1.8-atlassian-15 fixed it.

Well pickle me grandmother!

Do you know if is there any documentation that provide all tags that we can use into atlassian-plugin.xml? I couldn’t find any about this startup tag.

Unfortunetly there is not complete list of all tags, I’m still also looking for an Overview of all possible tags which can be used in the descriptor file.