Confluence Initial setup Error
Asked by Matja? Antloga - BalkanCloud IT:

we are trying to setup another instance of confluence that runs with another user but getting totally frustrated...

getting this errors in atlassian-confluence.log

Failed due to UNCLASSIFIED_FAILURE

getComponent Spring Application context has not been set  
2017-07-22 15:37:23,780 WARN \[\*\*\*\*\*\*\*.\*\*\*\*.\*\*-startStop-3\] \[atlassian.confluence.plugin.PluginFrameworkContextListener\] contextDestroyed Failed to shut down plugin system during ServletContext  
shutdown: Spring Application context has not been set

I've tried everything, reinstall it several times, recheck all permissions etc... but still no go, one confluence, first instance in running normally second one, no go


Answers:
author: Matja? Antloga - BalkanCloud IT
body: if anyone is reading this, i suggest you don't use chrome for install, rather use internet explorer, it does same really strange caching.... probably some bug or .....

comments: author: AnnWorley
body: Yes, it was caching that database error when we were on the call, threw me for a loop.


author: Matja? Antloga - BalkanCloud IT
body: yes it happened again when configuring second confl and third jira.... not sure maybe is sth wrong with my chrome   


author: AnnWorley
body: Sounds like you are making progress.


author: Matja? Antloga - BalkanCloud IT
body: Sort of, I imported Confluence cloud backup into second instance and hit that sysadmin issue <https://jira.atlassian.com/browse/CONFCLOUD-52260>

this is way to complicated, you should make a script to solve that....


author: Matja? Antloga - BalkanCloud IT
body: solved


author: AnnWorley
body: Happy to hear it!


author: Matja? Antloga - BalkanCloud IT
body: Still got some issues.

First instance of confluence is working fine.

Second one got (we migrated data from cloud version) got this type of error when try to edit existing pages.

Error: This page is taking longer to load than usual. Give it a few moments, then try refreshing. Still having issues? Contact your Confluence admin.

in manage add-ons I've got this error:

The base URL configuration of your instance does not match the URL in your browser. This can prevent operations on this page from working correctly. See UPM documentation for more details about this error.

which is impossible, I'm 100% sure base url is correct.


author: Matja? Antloga - BalkanCloud IT
body: I've double checked this is correct

<https://confluence.atlassian.com/doc/configuring-the-server-base-url-148592.html>


author: Matja? Antloga - BalkanCloud IT
body: some errors from logs

2017-08-18 13:12:54,415 WARN \[AtlassianEvent::CustomizableThreadFactory-4\] \[persistence.schema.hibernate.HibernateSchemaComparator\] lambda$compareTables$0 Schema check for table \[EVENTS\] encountered an error. Turn debug logging on for stacktrace.  
2017-08-18 13:12:54,417 WARN \[AtlassianEvent::CustomizableThreadFactory-4\] \[persistence.schema.hibernate.HibernateSchemaComparator\] lambda$compareTables$0 Schema check for table \[SECRETS\] encountered an error. Turn debug logging on for stacktrace.  
2017-08-18 13:12:54,419 WARN \[AtlassianEvent::CustomizableThreadFactory-4\] \[persistence.schema.hibernate.HibernateSchemaComparator\] lambda$compareTables$0 Schema check for table \[SNAPSHOTS\] encountered an error. Turn debug logging on for stacktrace.  
2017-08-18 13:12:54,878 WARN \[ThreadPoolAsyncTaskExecutor::Thread 2\] \[client.eventfilter.whitelist.AnalyticsWhitelistModuleDescriptor\] readPluginWhitelist No whitelist resource file found at \[mediaviewer/lib/analytics-whitelist.json\] in plugin \[com.atlassian.confluence.plugins.confluence-previews\] (bundle entry not found)  
2017-08-18 13:12:54,878 WARN \[ThreadPoolAsyncTaskExecutor::Thread 2\] \[client.eventfilter.whitelist.AnalyticsWhitelistModuleDescriptor\] readPluginWhitelist No whitelist resource file found at \[mediaviewer/lib/analytics-whitelist.json\] in plugin \[com.atlassian.confluence.plugins.confluence-previews\] (null InputStream)  
2017-08-18 13:12:56,057 ERROR \[ThreadPoolAsyncTaskExecutor::Thread 19\] \[spring.scanner.extension.ComponentImportBeanFactoryPostProcessor\] postProcessBeanFactory Unable to load class 'com.atlassian.bitbucket.auth.RememberMeService' for component importation purposes. Skipping...  
2017-08-18 13:12:56,058 ERROR \[ThreadPoolAsyncTaskExecutor::Thread 19\] \[spring.scanner.extension.ComponentImportBeanFactoryPostProcessor\] postProcessBeanFactory Unable to load class 'com.atlassian.jira.config.properties.ApplicationProperties' for component importation purposes. Skipping...  
2017-08-18 13:12:56,236 WARN \[ThreadPoolAsyncTaskExecutor::Thread 16\] \[confluence.setup.bandana.ConfluenceDaoBandanaPersister\] getObjectFromValue Configuration could not be loaded because class could not be found (context: _GLOBAL, key: atlassian.confluence.settings).


author: Matja? Antloga - BalkanCloud IT
body: I've also noticed that none of existing confluence users is a member of a system-administrators group which is not cool at all.


author: Matja? Antloga - BalkanCloud IT
body: ```
?
```

all solved, hint: sinhronicity conf....


author: AnnWorley
body: "All solved" is good to hear! If you have time to let us know more about how you solved it, that may help another member of the Community. :)


author: Smita Kelkar
body: Yes, Same here. Please help us with ur knowledge


author: Mayuresh Sakharape
body: [@Matja? Antloga - BalkanCloud IT](/t5/user/viewprofilepage/user-id/771837) Hi, How you solved below

\[ThreadPoolAsyncTaskExecutor::Thread 1\] \[client.eventfilter.whitelist.AnalyticsWhitelistModuleDescriptor\] readPluginWhitelist No whitelist resource file found at \[mediaviewer/lib/analytics-whitelist.json\] in plugin \[com.atlassian.confluence.plugins.confluence-previews\] (bundle entry not found) ?


author: Matja? Antloga - BalkanCloud IT
body: I've tuned - increase some values - postgres a bit and got through that mess :D

comments: author: AnnWorley
body: Thanks for keeping us updated. Happy to help where I can, just let me know.


author: Matja? Antloga - BalkanCloud IT
body: trying to setup second confluence

got stuck with Postgres

Setup Database Failed  

The following error(s) occurred:  

Configuring database failed  
org.postgresql.util.PSQLException: FATAL: remaining connection slots are reserved for non-replication superuser connections  
Setting up database instance failed. You can either try it again or or go back to the database selection page:  

Setup Database Again Restart Database Setup  
Atlassian


author: Matja? Antloga - BalkanCloud IT
body: java version "1.8.0_131"  
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)  
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

output when started

Using Java: //bin/java  
2017-08-07 18:02:18,435 INFO \[main\] \[atlassian.confluence.bootstrap.SynchronyProxyWatchdog\] A Context element for ${confluence.context.path}/synchrony-proxy is found in /opt/atlassian/cust00102/confluence/conf/server.xml. No further action is required

---------------------------------------------------------------------------

Using JRE_HOME: /

comments: author: AnnWorley
body: I am emailing you a screen share invitation in case you can join.


author: Matja? Antloga - BalkanCloud IT
body: yes,please send it.


author: AnnWorley
body: During our call we were able to install Confluence using a clean database and home directory, even though you tried that before, for some reason it worked for us this time.

You imported an XML backup and were able to log in and verify attachmments were in place. You mentioned you would update the Community if the second instance gives you any trouble.


author: Steven F Behnke
body: Good luck Matjaz, thank you Ann!


author: Matja? Antloga - BalkanCloud IT
body: 1)

I've noticed that when starting confluence (this first instance),

Using JRE_HOME: /

2)

I've rechecked again all 7 resolutions on a solution link you provide....

didn't find any mistake at first glance

selinux disabled, perm ok, running with correct user, hostname ok, postgres version 9.2, enough ram - 8 gb

when pilot is over, we will have 2 confluences and three jiras on same server. right now np with jira, i can run three of them but none of confluence

3) i've noticed that i didn't take care of server.xml redirect port value, which was 8443 for all instances, i'm setting diff value for each attlasian instance now....


author: Matja? Antloga - BalkanCloud IT
body: that kind of support is a joke,

i suggest you stop selling 10 users license if you can't cover proper support.

I've tried with postgres and my first instance of confluence, which was working well on mysql also stopped working

error like:

com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.IllegalStateException: Spring Application context has not been set  
at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:149)

caused by: java.lang.IllegalStateException: Spring Application context has not been set  
at com.atlassian.spring.container.SpringContainerContext.getComponent(SpringContainerContext.java:48)

means nothing to me.


author: Matja? Antloga - BalkanCloud IT
body: I've also noticed that setup doesn't touch database, doesn't create any tables but it connects to DB , I've tried with wrong pwd and got error that way,


author: Matja? Antloga - BalkanCloud IT
body: I run out of time, will try it asap.


author: Matja? Antloga - BalkanCloud IT
body: Can anyone from confluence confirms that this is the only support we get for 10 users licence? We are stucked with the case and I was honestly expecting more....

best regards, Matjaz

comments: author: AnnWorley
body: Yes, if you have a Starter license you are in the right place for support. Please see details on our blog: [We're updating our support offering for server starter (10-user) licenses](https://www.atlassian.com/blog/announcements/support-for-server-starter-10-user-licenses)

Since you checked the file system permissions I am thinking you may have seen this article, but I wanted to link it in case you had not tried all the suggested resolutions listed:

[Confluence does not start due to Spring Application context has not been set](https://confluence.atlassian.com/confkb/confluence-does-not-start-due-to-spring-application-context-has-not-been-set-218278311.html)


author: Matja? Antloga - BalkanCloud IT
body: Hi Ann.

I've double checked those steps, but none does not help.

I'm also not comfortable with settings you suggested in that article, like disable SELinux , 755 etc ... but yes, we have done it for a test. ( I also think they are not needed, because on same server one instance of confluence works without any problems)

I really can't give more details public.

What do you suggest next?

Thanks, Matja?


author: AnnWorley
body: Is there any chance you are editing the **confluence.cfg.xml** after installation? I saw a particularly persistent case of "Spring Application context has not been set" that turned out to be from formatting characters that a text editor was inserting in that file. Not all text editors would show the weird characters so we were examining the file for ages before we opened it in an editor that showed them.


author: Matja? Antloga - BalkanCloud IT
body: i've edited it once, but deleted file afterwards (complete folder delete).

However, is there any chance that this is connected to a license issue? Once I've tried new ID with old licence? For the future, is it possible to recreate license file with new ID?

Don't want to confuse you, last few (5-10) times I've just entered trial key after reinstall.


author: AnnWorley
body: Are you running the installer (.bin script) or using the tar.gz archive as described in [Installing Confluence on Linux from Archive File](https://confluence.atlassian.com/doc/installing-confluence-on-linux-from-archive-file-255362363.html)? If you are running the installer, please try the archive method; you will need to have a JAVA_HOME variable defined but otherwise it's very easy and removes the installer as a factor.

If you used an eval license the license should not be the issue, unless you are pasting it into confluence.cfg.xml instead of entering it during the setup wizard. Confluence licenses can be applied on different servers, not tied to Server ID.


author: Matja? Antloga - BalkanCloud IT
body: .bin script, i've read on some forum that it could be corrupted installer, so i've repeat DL also, but yes, I can try via archive method. Will report back.

better and easier solution would be you provide checksum, so we could compare hashes and eliminate it that way

<https://jira.atlassian.com/browse/CONFSERVER-25687>


author: AnnWorley
body: You definitely have a point as far as validating the archive.

In this case, I'm asking you to try the archive method because the installer creates a user and changes the file system permissions and can be configured to start Confluence automatically, whereas we want to control everything manually to eliminate any settings done by the installer.

I am looking forward to hearing the results, my fingers are crossed.


author: Matja? Antloga - BalkanCloud IT
body: ok, i will try this on Thursday, will let you note. Thanks!


author: AnnWorley
body: How did it go with the archive install, Matja??


author: Matja? Antloga - BalkanCloud IT
body: i've tried archive, no luck so far

us \| action: setupstandarddb  
2017-08-05 14:32:23,163 WARN \[Navlink Plugin Executor:thread-8\] \[confluence.impl.vcache.SynchronousExternalCache\] lambda$get$11 Failed to read entry from cache 'com.atlassian.bandana.BandanaPersister': Failed due to UNCLASSIFIED_FAILURE  
-- url: /confluence/setup/setupstandarddb.action \| referer: <https://wiki.something.com/confluence/setup/setupstandarddb-start.action?database=mysql> \| traceId: 003db9fcaeb9aa7b \| userName: anonymous \| action: setupstandarddb

this is very strange, why I see database=mysql and user anoynmous there?


author: Steven F Behnke
body: You'll have to provide details like version and database version/database driver etc.

comments: author: Matja? Antloga - BalkanCloud IT
body: atlassian-confluence-6.3.1-x64.bin

mysql-connector-java-5.1.42

mysql 5.5.56

centos 7.0 64 bit

I've also disabled selinux \& reboot + disable FW for testing purposes


author: Matja? Antloga - BalkanCloud IT
body: I've also gave

755 to install dir \& homedir to specific user  
which is also entered in user.sh  
put entry for \*\*.\*\*\*\*.\*\* into hosts file

first error in atlassian-confluence,log is

2017-07-22 17:34:46,578 ERROR \[\*\*\*.\*\*\*\*.\*\*-startStop-1\] \[atlassian.confluence.plugin.PluginFrameworkContextListener\] contextInitialized Error initialising plugin manager: Spring Applicatio  
n context has not been set  

not to mention that 've done several reinstall and complete purge of dirs between


author: Matja? Antloga - BalkanCloud IT
body: this is memory

KiB Mem : 8010796 total, 145908 free, 7094328 used, 770560 buff/cache  
KiB Swap: 8388604 total, 7203996 free, 1184608 used. 610836 avail Mem

i will shutdown server and give it 4 GB more memory just in case right now


author: Matja? Antloga - BalkanCloud IT
body: \[atlassian.confluence.plugin.PluginFrameworkContextListener\] contextInitialized Error initialising plugin manager: Spring Application context has not been set


author: Matja? Antloga - BalkanCloud IT
body: jira and confluence are running with same FQDN and cert, nginx acts like a proxy and redirect https://something/jira to localhost:8082 and https://something/confluence to localhost:8092. This seems working fine, since i can start initial setup on both instances.


author: Steven F Behnke
body: Sorry for the late response on my end. I try to participate as much as possible.

Unfortunately, this is one of the most generic errors that can be thrown. This is a pretty base portion of the application that is failing to start so we're not getting any details.

It could be that the database driver is missing or not correct as I mentioned before, but it could also be that the home folder is set wrong, that permissions on the folder are set wrong (ie root). If you're still having issues I'd like to see your confluence properties file, folder permissions for the install/home folders.

That being said, I've never encounted this error on an intial, clean setup. Something must be wrong with the environment.