Service not fully initialised until first login plus backups not triggering

I am running YouTrack under Docker, hosted on an EC2 instance up on AWS. My EC2 instance is auto-scheduled to start-up at 6.00 and shutdown at 00:05 to save on running costs in the cloud. I believe I am suffering two possibly related issues:-

  1. The YouTrack "service" appears to not fully initialise until the first user connects to the service
  2. My scheduled "Backup" which is scheduled for every weekday at 7.00am does not appear to run

Item 1 I believe is similar to the problem posted here -> https://youtrack-support.jetbrains.com/hc/en-us/community/posts/115000075830-Fully-starting-YouTrack-after-server-restart?flash_digest=1f4c3e901d90830f2c8ffa0dff2f7ef921df30cb 

Item 2 I believe may be because the backup is scheduled after the EC2 is started (and hence YouTrack service started), but before the first user has connected.

I've extracted the following snippets from my youtrack.log file to illustrate the problem:-

Regular Backup configured
05 Mar 2018 09:59:35,581 INFO  [YouTrackInit                  ] [init servlet        ] [init] YouTrack init complete
05 Mar 2018 10:02:40,086 INFO  [security                      ] [qtp1030870354-55    ] [root@82.69.56.228] Backup cron expression changed to: 0 0 7 * * ?
05 Mar 2018 10:02:40,094 INFO  [LocalScheduling               ] [qtp1030870354-55    ] [root@82.69.56.228] job BackupDatabaseScheduling rescheduled at Tue Mar 06 07:00:00 UTC 2018

EC2 instance tidy shutdown triggered
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
...skipping...
00:05:35,756 INFO  [/hub                          ] [Thread-0       ] [init] MainServlet: Application destroyed
EC2 instance restarts at 06:00
2018-03-06 00:05:36,155 INFO stopped: youtrack (exit status 143)
2018-03-06 06:06:00,145 CRIT Supervisor running as root (no user in config file)
2018-03-06 06:06:00,149 WARN Included extra file "/etc/supervisor/conf.d/youtrack.conf" during parsing
2018-03-06 06:06:00,183 INFO RPC interface 'supervisor' initialized
2018-03-06 06:06:00,184 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2018-03-06 06:06:00,184 INFO supervisord started with pid 1
2018-03-06 06:06:01,189 INFO spawned: 'youtrack' with pid 7
YouTrack home folder is [/opt/youtrack/.youtrack]
Verifying Java Runtime Environment...
Verifying memory requirements...
Checking entropy sources...
2018-03-06 06:06:02,789 INFO success: youtrack entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Checking free disk space...
Checking embedded Hub database...
Deploying web application: Hub
Deploying web application: YouTrack
WARN  Errors - The following warnings have been detected: WARNING: Parameter 2 of type kotlin.jvm.functions.Function0<? extends jetbrains.jetpass.api.settings.Settings> from public jetbrains.jetpass.rest.api.SettingsDAOResource$SettingsDAOEn
titySubresource(kotlin.jvm.functions.Function0<? extends jetbrains.jetpass.api.settings.Settings>) is not resolvable to a concrete type.
WARNING: Parameter 2 of type kotlin.jvm.functions.Function0<? extends jetbrains.jetpass.api.settings.Settings> from public jetbrains.jetpass.rest.api.SettingsDAOResource$SettingsDAOEntitySubresource(kotlin.jvm.functions.Function0<? extends j
etbrains.jetpass.api.settings.Settings>) is not resolvable to a concrete type.
WARNING: Parameter 2 of type kotlin.jvm.functions.Function0<? extends jetbrains.jetpass.api.settings.Settings> from public jetbrains.jetpass.rest.api.SettingsDAOResource$SettingsDAOEntitySubresource(kotlin.jvm.functions.Function0<? extends j
etbrains.jetpass.api.settings.Settings>) is not resolvable to a concrete type.
WARNING: Parameter 2 of type kotlin.jvm.functions.Function0<? extends jetbrains.jetpass.api.settings.Settings> from public jetbrains.jetpass.rest.api.SettingsDAOResource$SettingsDAOEntitySubresource(kotlin.jvm.functions.Function0<? extends j
etbrains.jetpass.api.settings.Settings>) is not resolvable to a concrete type.
WARNING: Parameter 2 of type kotlin.jvm.functions.Function0<? extends jetbrains.jetpass.api.settings.Settings> from public jetbrains.jetpass.rest.api.SettingsDAOResource$SettingsDAOEntitySubresource(kotlin.jvm.functions.Function0<? extends j
etbrains.jetpass.api.settings.Settings>) is not resolvable to a concrete type.
WARNING: Parameter 2 of type kotlin.jvm.functions.Function0<? extends jetbrains.jetpass.api.settings.Settings> from public jetbrains.jetpass.rest.api.SettingsDAOResource$SettingsDAOEntitySubresource(kotlin.jvm.functions.Function0<? extends j
etbrains.jetpass.api.settings.Settings>) is not resolvable to a concrete type.
First user connects and logs in
09:30:40,624 INFO  [Reflections                   ] [init servlet   ] [init] Reflections took 2568 ms to scan 34 urls, producing 1375 keys and 23154 values
09:30:43,625 INFO  [AbstractServiceLocator        ] [init servlet   ] [init] ----------------------------------------
09:30:43,632 INFO  [AbstractServiceLocator        ] [init servlet   ] [init] Init xml spring configuration with configs:
09:30:43,632 INFO  [AbstractServiceLocator        ] [init servlet   ] [init]     classpath*:**/youtrack-spring-config.xml
09:30:43,632 INFO  [AbstractServiceLocator        ] [init servlet   ] [init] ----------------------------------------

Note: No backup appears to fire at 07:00

If I manually request the backup to run via the web console, a backup is taken successfully.

Any help or advice appreciated,
Thanks
Andrew

 

 

 

 

 

 

 

 

 

0
4 comments
Avatar
Liubov Melnikova
Official comment

Do you run JAR distributive in Docker container?

Hi,

Yes. The Docker definition I am using is lifted from here -> https://github.com/uniplug/youtrack-docker

The command string used to start the YouTrack service is:-

java -Xmx1g -XX:MaxMetaspaceSize=250m -Duser.home=/opt/youtrack -Ddatabase.location=/opt/youtrack/data -Ddatabase.backup.location=/opt/youtrack/backup -Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts -Djavax.net.ssl.trustStorePassword=changeit -Djetbrains.youtrack.disableBrowser=true -Djetbrains.youtrack.enableGuest=false -Djava.awt.headless=true -Djetbrains.youtrack.disableCheckForUpdate=true -Djava.security.egd=/dev/urandom -jar /opt/youtrack/bin/youtrack.jar 80

Thanks

0
Avatar
Liubov Melnikova

Hello,

Server wouldn't start unless the first request is made. Also since server is not started, then backups are not triggered. 

As a workaround I can recommend to add curl line into the start script to start the server.

0

I have now changed the cron definition for the backup schedule to occur towards the end of the day rather than at the beginning. This has the advantage that a backup if not taken if no access to YouTrack has been made during the day. A backup is now successfully taken if the service is accessed during the day.

  1. Can I suggest that the following issues are added into the documentation please:-
  2. The "service" is not started until the first user connects with the service
  3. Backups are not scheduled if the service is not started fully

An example of a script that starts the service (when running the JAR distribution) including a curl request that will initialise the service fully.

Thanks for the support

 

0

Please sign in to leave a comment.