Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-20008

Scheduled Elastic Instance startup fails with Hibernate error

      Summary

      Elastic Image crons, created in the "Image Schedule" UI fail to trigger Elastic Image startup

      Steps to Reproduce

      1. Configure Elastic Bamboo
      2. Configure an Elastic Image Schedule
      3. Let it run

      Expected Results

      Instance Starts at scheduled time

      Actual Results

      The below exception is thrown in the atlassian-bamboo.log file:

      2018-07-26 17:50:00,113 INFO [scheduler_Worker-1] [ElasticFunctionalityFacadeImpl] Adjusting elastic agents with schedule: com.atlassian.bamboo.agent.elastic.schedule.ElasticInstanceScheduleImpl@5429cf[48758785,0 50 17 ? * *,com.atlassian.bamboo.agent.elastic.server.ElasticImageConfigurationImpl@810e8617,EQUALS,1,true]
      2018-07-26 17:50:00,113 INFO [scheduler_Worker-1] [ElasticFunctionalityFacadeImpl] Starting up 1 of 'Ubuntu stock image' elastic instances
      2018-07-26 17:50:00,123 ERROR [scheduler_Worker-1] [JobRunShell] Job ElasticInstanceSchedule.ElasticInstanceScheduleJob threw an unhandled Exception:
      org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.atlassian.bamboo.agent.elastic.server.ElasticImageConfigurationImpl.startupScripts, could not initialize proxy - no Session
      ...
      2018-07-26 17:50:00,178 ERROR [scheduler_Worker-1] [ErrorLogger] Job (ElasticInstanceSchedule.ElasticInstanceScheduleJob threw an exception.
      org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.atlassian.bamboo.agent.elastic.server.ElasticImageConfigurationImpl.startupScripts, could not initialize proxy - no Session]
      ....
      Caused by: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.atlassian.bamboo.agent.elastic.server.ElasticImageConfigurationImpl.startupScripts, could not initialize proxy - no Session
      ...
      

      Workaround

      There is no known workaround for this. Instances will need to be manually started.

            [BAM-20008] Scheduled Elastic Instance startup fails with Hibernate error

            So there's no REST api for this. However, this worked for me:

            1) Get your elasticImageConfigurationId on your image configuration page: https://your.bamboo.server.com/admin/elastic/image/configuration/viewElasticImageConfigurations.action
            Click on your and you'll see some some numbers in the end of the url in browser location field. That's your elasticImageConfigurationId
            2) Schedule this task in scheduler of your choice:
            curl -qs -X POST -F elasticImageConfigurationId=<your image ID> -F numAgentsToCreate=X --user "username:password" --header "X-Atlassian-Token: no-check" "https://your.bamboo.server.com/admin/elastic/createElasticInstances.action"

            Eugene Babichev added a comment - So there's no REST api for this. However, this worked for me: 1) Get your elasticImageConfigurationId on your image configuration page: https://your.bamboo.server.com/admin/elastic/image/configuration/viewElasticImageConfigurations.action Click on your and you'll see some some numbers in the end of the url in browser location field. That's your elasticImageConfigurationId 2) Schedule this task in scheduler of your choice: curl -qs -X POST -F elasticImageConfigurationId=<your image ID> -F numAgentsToCreate=X --user "username:password" --header "X-Atlassian-Token: no-check" "https://your.bamboo.server.com/admin/elastic/createElasticInstances.action"

            Any workaround to this? Very frustrating

            Eugene Babichev added a comment - Any workaround to this? Very frustrating

            NadineW added a comment -

            Hello,

            when will the versionion 6.6.3 and the 6.7 released?

            Then we need to run the service 24h which is expensive.

             

            NadineW added a comment - Hello, when will the versionion 6.6.3 and the 6.7 released? Then we need to run the service 24h which is expensive.  

            I'd like to request that this be given much higher priority as this is a regression in functionality that Bamboo has had for several years.  There is no work-around and our developers are not happy having to wait additional time for instances to launch based on the queue.

             

            I was hoping that there might be an API for Bamboo we can hit, but I don't see that available either.

            Garret_Pick added a comment - I'd like to request that this be given much higher priority as this is a regression in functionality that Bamboo has had for several years.  There is no work-around and our developers are not happy having to wait additional time for instances to launch based on the queue.   I was hoping that there might be an API for Bamboo we can hit, but I don't see that available either.

              Unassigned Unassigned
              ezeidan Ellie Z (they/them)
              Affected customers:
              16 This affects my team
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: