Uploaded image for project: 'Jira Server and Data Center'
  1. Jira Server and Data Center
  2. JRASERVER-67279

Request timeout when creating project





      Creating a project in Jira can be slow, and, because Jira's front end enforces a 60 seconds timeout, even if the project creation completes successfully, if it does not do so within 60 seconds, the user will be presented with "Request timeout when creating project" error, and will not be redirected to the created project.


      • Projects - 2000+
      • Screens - 2000+
      • Workflows - 1400+

      Steps to Reproduce

      1. Create a project from Project template (eg. Scrum)

      Expected Results

      Project is created successfully under 60 seconds.

      Actual Results

      The page keeps on loading for 60 seconds then error appears on page: "Request timeout when creating project".
      Several minutes after, the said project can be found in "View all projects" page.

      Following is seen in atlassian-jira.log

      2018-08-30 08:54:21,719 http-nio-8080-exec-3 url:/rest/project-t...ates/1.0/templates username:USERNAME INFO USERNAME 534x661x1 xxxxx /rest/project-templates/1.0/templates [c.a.j.i.f.config.manager.FieldConfigSchemeManagerImpl] ConfigScheme TEST: Scrum Issue Type Scheme (43480). Created with no associated contexts
      2018-08-30 08:54:54,624 http-nio-8080-exec-3 url:/rest/project-t...ates/1.0/templates username:USERNAME INFO USERNAME 534x661x1 xxxxx /rest/project-templates/1.0/templates [c.a.jira.workflow.OSWorkflowManager] User 'USERNAME(USERNAME)' updated workflow 'Software Simplified Workflow for Project TEST' at 'Thu Aug 30 08:54:54 GMT 2018'


      Reviewing access log will indicate that creating project took a long time (in this case 2 minutes 26 seconds) 534x661x1 USERNAME [30/Aug/2018:08:56:46 +0000] "POST /rest/project-templates/1.0/N HTTP/1.1" 200 139 146117 "https://jira/secure/Dashboard.jspa?selectPageId=32476" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36" "xxxxxx"

      There are many SELECT queries to Database, focusing on the specific request ID 534x661x1

      zul-mbp:logs zul$ grep 'http-nio-8080-exec-3' atlassian-jira-sql.log* | grep '534x661x1' | awk -F'(FROM|WHERE)' '/SELECT/{print $2}' | sort | uniq -c | sort -k1,1 -n
        39  projectroleactor
       269  fieldlayout
       269  fieldlayoutitem
       269  fieldlayoutschemeentity
      1194  workflowschemeentity
      1673  fieldlayoutscheme
      2401  permissionscheme
      3541  workflowscheme
      7255  nodeassociation
      8094  fieldscreen

      Compounding factor

      • The problem scales with the project scheme complexity (for example, Jira Service Management can have up to 5 workflows per project, where as Jira Software has 1 workflow per project - meaning JSM is 5x slower than JSW), and, the amount of nodes in the cluster.
      • If the node count > 1, then, cache flush events occur on the other nodes necessitating additional SELECT query to the db
      • In addition to DB queries, there can be contention on the localq - as many cache events occur resulting in many writes to the localq queue files, stored on the LOCAL_HOME volume.  If the disk latency is poor (for example, when using a slow disk, or slow network linked disk), this contributes to the project creation time. The expectation for cache writes to disk is 1ms.
      • Jira's front-end Javascript code enforces a 60 seconds timeout. This is because the jQuery library being used to send the request to the server has been instructed to use a global 60 seconds timeout, in which the project creation code does not override.


      We can address the symptom at this stage, but not the cause.

      To increase the project creation front-end timeout to 300000 ms (5 minutes), add to the Jira Announcement Banner:

      // JRASERVER-67279 Workaround Start
      $(document).ready(function() {
      //Modify the create project menu link
          let observer = new MutationObserver(function(mutation){
              $('#project_template_create_link_lnk').on('click', function() {
                  console.log("JRASERVER-67279 workaround triggered");
                  $.ajaxSetup({ timeout : 300000 });
          let container = document.documentElement || document.body;
          observer.observe(container, { attributes: false, subtree: true, childList: true});
      //Modify the Projects List page Create Button:
          $('#browse-projects-create-project').on('click', function() {
              console.log("JRASERVER-67279 workaround triggered");
              $.ajaxSetup({ timeout : 300000 });


        Issue Links



              Unassigned Unassigned
              emarghidan Eduard M
              47 Vote for this issue
              60 Start watching this issue