I'm trying to setup a crontab for running backup on an Ubuntu Server 16.04, and I'm getting exceptions randomly. The cron job is set up correctly, using webmin.
The exception I get is:
Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'appHome' defined in class path resource [META-INF/spring/common-spring.xml]: Could not resolve placeholder 'bitbucket.home' in string value "${bitbucket.home}"; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'bitbucket.home' in string value "${bitbucket.home}"
2016-10-10 21:51:01,545 ERROR BITBUCKET_HOME is not defined.
Creating a backup requires direct, filesystem access to BITBUCKET_HOME for the instance being backed up, in order to backup its repositories.
BITBUCKET_HOME may be set using an environment variable, a system property (bitbucket.home) or configured in backup-config.properties.
When running the job manually with:The BICKBUCKET_HOME variable is
/var/atlassian/application-data/bitbucket
This is also set in backup-config.properties, in bitbucket.home=.
When I ran it manually as the user "root" the first five or so times with the following command
java jar /home/userwtih-root-premission/bitbucket-backup-client-3.3.0/bitbucket-backup-client.jar
it was all good, until i suddenly got the following exception:
Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'restClient' defined in class path resource [META-INF/spring/backup-spring.xml]: Could not resolve placeholder 'bitbucket.password' in string value "${bitbucket.password}"; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'bitbucket.password' in string value "${bitbucket.password}"All the environment variables are set. All the values are set in backup-config.properties, and of course they are set correctly, since I could run it manually the first few times.
I have no idea why I'm experiencing this strange behavior. Please help me find a solution. If I must provide more information, please tell me what information you require, and where I find it if it's a log file or something.
Best regards,
Morten
Community moderators have prevented the ability to post new answers.
Hi Morten,
The bitbucket.properties file is read from wherever directory you run the java command. On your cronjob, are you doing a cd to the directory where this file is before executing? Same question applies for the case when you're running as root.
Regards,
Thiago
That was it. I changed my cronjob to:
08 09 * * * cd /home/user-with-root-permission/bitbucket-backup-client-3.3.0 && java -jar bitbucket-backup-client.jar
Thank you ![]()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not a problem! Glad it helped. ![]()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.