Trouble installing Confluence on Virtuozzo virtual server
Asked by MaxLab:

So on my Centos

CentOS 7 (Core)  
4GB RAM  
300GB HDD

Virtualization server (Virtuozzo)

**NO SWAP!!**

```
[root@confluence]# free
total used free shared buff/cache available
Mem: 4194304 2406140 1255308 317468 532856 1573908
Swap: 0 0 0
```

I have problem installing Confluence and really need some help. To do this I uses linux installer

Confluence 6.15.6

```
$ sudo ./atlassian-confluence-X.X.X-x64.bin
```

Installation directory: **/opt/atlassian/confluence**   
Default location for Confluence data: **/var/atlassian/application-data/confluence**   
Default ports (HTTP: **8090** , Control: **8000** )  
Confluence installed as service

**/etc/security/limits.conf**

```
# End of file
confluence soft nofile 4096
confluence hard nofile 8192
confluence soft nproc 4096
confluence hard nproc 8192

mysql soft nproc 4096
```

**/etc/security/limits.d/20-nproc.conf**

```
* soft nproc 4096
root soft nproc unlimited
mysql soft nproc 4096

confluence soft nofile 4096
confluence hard nofile 8192
confluence soft nproc 4096
confluence hard nproc 8192
```

So on the first start, I receive this message

```
Unable to start up Confluence. Fatal error during startup sequence: confluence.lifecycle.core:dblowercheck (Check to ensure the database correctly supports lower() for non-ASCII characters)

2019-06-30 16:50:55 
fatal 

unable to create new native thread?
```

Please help, I tried everything regarding increasing java confluence limits. Nothing helped. Could this be because of a lack of SWAP space? I can not create it because of Virtuozzo server hosting plan that I'm using. Any info would be appreciated. I can also provide log files.

Thanks


Answers:
author: Nic Brough -Adaptavist-
body: The error you have here is about setting up the database. Could you show us what you have set up for the database, and tell us what you have done differently to the setup docs?

comments: author: MaxLab
body: Hi Nic,

Database is MySQL with **mysql-connector-java-5.1.47.jar** connector inserted inside folder

```
/opt/atlassian/confluence/confluence/WEB-INF/lib
```

MySQL database Collation is **utf8_bin**

**![collation_utf8_bin.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/59248i85815A2D92695726/image-size/large?v=v2&px=999 "collation_utf8_bin.PNG")**

What about "unable to create new native thread" part of the message?


author: Nic Brough -Adaptavist-
body: The "can't create thread" is almost certainly down to "can't get a good connection to the database". Have you checked the error message given in your first line?


author: MaxLab
body: Hi Nic, sorry for my late response, I only have time to work on this on weekends mostly. I tried to install version 5 of confluence and it worked!! After that, I did an upgrade to a version 6 and same thing as before. Confluence could not start. I tried starting it with

**./start-confluence.sh -fg**

This is what I receive. I'm sending you just two exceptions

```
Exception in thread "push-notification-http-client-io:thread-1" java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:717)
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:334)
at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:194)
at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:64)
at java.lang.Thread.run(Thread.java:748)
Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:717)
at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:957)
```

Is it possible that version 6 is more resource hungry? How can I approach this problem? I explained already in the first email what kind of environment I have.


author: Nic Brough -Adaptavist-
body: Again, it's not the memory, there is something wrong with your database connection. Look for the database connection errors in the log instead of the memory ones.


author: Michael Schweikart
body: Hi,  

are you able to install confluence?

best regards

comments: author: MaxLab
body: Hi Michael, no unfortunately not. I really tried and give up. I could not get any help on this community page. If you are in the same situation I would share every information I have. Perhaps you can have more luck with this. In a month I will switch to another V-Server plan with my hosting provider and then I will try again when I get more CPU power and more memory.


author: Paco Blasco
body: Hi! I'm in the same situation. No matter what I do, at Virtuozzo (Strato V30) is impossible to launch Jira (or confluence). With 16GB of memory seems not be enough for Jira?? it is quite weird.


author: Nic Brough -Adaptavist-
body: It's not a lack of memory - you can run Jira with 768m heap (just), the memory error is being caused by something else that is wrong.


author: MaxLab
body: Today I tried manual installation using tar.gz file. Installed suggested java version

```
java -version

openjdk version "1.8.0_222"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_222-b10)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.222-b10, mixed mode)
```

Set the $JAV_HOME path

```
echo $JAVA_HOME
/usr/lib/jvm/adoptopenjdk-12-hotspot
```

Same thing

```
21-Jul-2019 16:20:37.115 SEVERE [http-nio-8090-exec-4] org.apache.coyote.AbstractProtocol$ConnectionHandler.process Failed to complete processing of a request    java.lang.OutOfMemoryError: unable to create new native thread        at java.lang.Thread.start0(Native Method)        at java.lang.Thread.start(Thread.java:717)        at java.util.Timer.<init>(Timer.java:176)        at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPoolManager._poolsInit(C3P0PooledConnectionPoolManager.java:236)
```

I also tried every possible trick to solve**java.lang.OutOfMemoryError: unable to create new native thread**problem, but still no luck.

++Anyone who could take a look at this with me?++

comments: author: Nic Brough -Adaptavist-
body: My apologies, this reply happened at a time when I was not being notified of updates by community and I missed quite a lot.

The problem is not memory. There is a process behind it that is leaking memory and causing it to fall over with a memory error.

I'm in the middle of an upgrade where this happened, and it was down to misconfiguration of both the database settings and the database setup itself.

So, the question becomes two:

* Is your database set up as per install docs?
* What have you got in the database settings for Jira (the dbconfig file)? In our case, we had to increase the c3po max something to prevent the memory leak.


author: Paco Blasco
body: Yes. I create the database as in the documentation. I just installed last version of jira software and I got the same.

Loading entityengine.xml from : file:/opt/atlassian/jira-bzi/atlassian-jira/WEB-INF/classes/entityengine.xml  
Entity model field type name : postgres72  
Entity model schema name : public  
Database Version : PostgreSQL - 10.12 (Ubuntu 10.12-0ubuntu0.18.04.1)  
Database Driver : PostgreSQL JDBC Driver - 42.2.6  
Database URL : jdbc:postgresql://localhost:5432/bzi_jira  
Database JDBC config : postgres72 jdbc:postgresql://localhost:5432/bzi_jira

ERROR: Bundle org.eclipse.gemini.blueprint.extender \[12\] EventDispatcher: Error during dispatch. (java.lang.OutOfMemoryError: unable to create new native thread)  
java.lang.OutOfMemoryError: unable to create new native thread

We are stuck here.


author: Paco Blasco
body: Downgraded to version 8.0.0 and I got the same. I'm going to downgrade to version 7 to check if an installation is possible


author: MaxLab
body: Again tried with version 6

Installation did using **atlassian-confluence-6.15.6-x64.bin** file as root user

In **/bin/setenv.sh** changed line to

**CATALINA_OPTS="-Xms1024m -Xmx2048m -XX:+UseG1GC ${CATALINA_OPTS}"**

And still get this error

```
13-Jul-2019 21:05:04.706 SEVERE [main] org.apache.catalina.core.ContainerBase.startInternal A child container failed during start
java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: unable to create new native thread
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:831)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
```

Can anyone help, I could provide all the details??


author: MaxLab
body: Does anyone have the slightest idea what is going on in my case?


Tags: confluence-server

server