Resolved: HTTP Status 500 ? Internal Server Error When creating database
Asked by Justin Parker:

Seems to be a Confluent Doc Bug to me.

<https://github.com/magento/devdocs/issues/1592>

GRANT ALL ON magento.\* TO magento@localhost IDENTIFIED BY 'magento';  
Query OK, 0 rows affected, 1 warning (0.00 sec)

Worked:  
CREATE USER 'magento'@'localhost' IDENTIFIED BY 'password';  
GRANT ALL ON magento.\* TO 'magento'@'localhost';

<https://confluence.atlassian.com/doc/database-setup-for-mysql-128747.html>

3. Create database and database user {#toc-hId--1444051854}
-----------------------------------------------------------

Create a Confluence database user (for example `confluenceuser`):

    GRANT ALL PRIVILEGES ON <database-name>.* TO '<confluenceuser>'@'localhost' IDENTIFIED BY '<password>';

Hello:

I am installing the latest Confluence on CentOS 7 Linux 2 CPUs 4 GB RAM minimal install using MySQL 5.7 installed via RPM files.

version.number=6.14.1  
build.date=Feb 07, 2019  
build.timestamp=2019-02-07T01:47:58.376+0000  
build.number=7901  
marketplace.build.number=10233  
bamboo.build.key=CONFREL-R614-RELEASEPREPARE  
bamboo.build.number=2

After installation, I went to \<IP_address\>:8090 and begin the post install. Connecting to the database passes using MySQL, simple, DB Name, User, and Pass. I copied both mysql-connector-java-5.1.47-bin.jar and mysql-connector-java-5.1.47.jar to /WEB-INF/lib/.

I am following the guide <https://confluence.atlassian.com/doc/database-setup-for-mysql-128747.html> for setting up MySQL 5.7, but not sure if I am missing something.

GRANT ALL PRIVILEGES ON confluence1.\* TO 'confluence'@'localhost' IDENTIFIED BY '\<my user passwor\>';

<br />

Query OK, 0 rows affected, **1 warning** (0.00 sec)

Catalina logs:

<https://pastebin.com/auHLuXyY>

<https://pastebin.com/Eb3H88k0>

<br />

cat /etc/my.cnf

<br />

\[mysqld\]  
datadir=/var/lib/mysql  
socket=/var/lib/mysql/mysql.sock

character-set-server=utf8  
collation-server=utf8_bin  
default-storage-engine=INNODB  
max_allowed_packet=256M  
innodb_log_file_size=2GB  
transaction-isolation=READ-COMMITTED  
binlog_format=row

# Disabling symbolic-links is recommended to prevent assorted security risks  
symbolic-links=0

log-error=/var/log/mysqld.log  
pid-file=/var/run/mysqld/mysqld.pid

When clicking Next, the status was pending creating the database for a minute or two and the received the following error:

HTTP Status 500 -- Internal Server Error {#toc-hId-1043460979}
--------------------------------------------------------------

**Type** Exception Report

**Message** Cannot call sendError() after the response has been committed

**Description** The server encountered an unexpected condition that prevented it from fulfilling the request.

**Exception**

```
java.lang.IllegalStateException: Cannot call sendError() after the response has been committed

Output omitted
```

Server version: 5.7.23 MySQL Community Server (GPL)  
Protocol version: 10  
Connection: Localhost via UNIX socket  
Server characterset: utf8  
Db characterset: utf8  
Client characterset: utf8  
Conn. characterset: utf8

SHOW DATABASES;  
+--------------------+  
\| Database \|  
+--------------------+  
\| information_schema \|  
\| confluence1 \|  
\| mysql \|  
\| performance_schema \|  
\| sys \|  
+--------------------+  
5 rows in set (0.00 sec)

SELECT host,user,authentication_string FROM mysql.user;  
+-----------+---------------+-------------------------------------------+  
\| host \| user \| authentication_string \|  
+-----------+---------------+-------------------------------------------+  
\| localhost \| root \| \* \|  
\| localhost \| mysql.session \| \*\|  
\| localhost \| mysql.sys \| \*\|  
\| localhost \| confluence \| \* \|

SHOW GRANTS;  
+---------------------------------------------------------------------+  
\| Grants for root@localhost \|  
+---------------------------------------------------------------------+  
\| GRANT ALL PRIVILEGES ON \*.\* TO 'root'@'localhost' WITH GRANT OPTION \|  
\| GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION \|

20-Feb-2019 17:22:16.680 WARNING \[ContainerBackgroundProcessor\[StandardEngine\[Standalone\]\]\] org.apache.catalina.valves.StuckThreadDetectionValve.notifyStuckThreadDetected Thread \[http-nio-8090-exec-5\] (id=\[79\]) has been active for \[69,420\] milliseconds (since \[2/20/19 5:21 PM\]) to serve the same request for \[<http://172.16.100.165:8090/setup/setupdbtype.action>\] and may be stuck (configured threshold for this StuckThreadDetectionValve is \[60\] seconds). There is/are \[1\] thread(s) in total that are monitored by this Valve and may be stuck.

Wed Feb 20 17:22:58 EST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

20-Feb-2019 17:24:31.581 SEVERE \[http-nio-8090-exec-5\] org.apache.catalina.core.StandardHostValve.custom Exception Processing ErrorPage\[errorCode=500, location=/500page.jsp\] org.apache.jasper.JasperException: An exception occurred processing \[/500page.jsp\] at line \[120\] 117: 118: if (sysInfoService != null) 119: { 120: confluenceInfo = sysInfoService.getConfluenceInfo(); 121: memoryInfo = sysInfoService.getMemoryInfo(); 122: dbInfo = sysInfoService.getSafeDatabaseInfo(); 123: sysinfo = GeneralUtil.convertBeanToMap(sysInfoService.getSystemProperties());

20-Feb-2019 17:24:37.034 WARNING \[ContainerBackgroundProcessor\[StandardEngine\[Standalone\]\]\] org.apache.catalina.valves.StuckThreadDetectionValve.notifyStuckThreadCompleted Thread \[http-nio-8090-exec-5\] (id=\[79\]) was previously reported to be stuck but has completed. It was active for approximately \[203,174\] milliseconds.

"VM Thread" os_prio=0 tid=0x00007f24ac418800 nid=0x4706 runnable "Gang worker#0 (Parallel GC Threads)" os_prio=0 tid=0x00007f24ac020800 nid=0x46ff runnable "Gang worker#1 (Parallel GC Threads)" os_prio=0 tid=0x00007f24ac022800 nid=0x4700 runnable "G1 Main Concurrent Mark GC Thread" os_prio=0 tid=0x00007f24ac03a000 nid=0x4704 runnable "Gang worker#0 (G1 Parallel Marking Threads)" os_prio=0 tid=0x00007f24ac03c000 nid=0x4705 runnable "G1 Concurrent Refinement Thread#0" os_prio=0 tid=0x00007f24ac028800 nid=0x4703 runnable "G1 Concurrent Refinement Thread#1" os_prio=0 tid=0x00007f24ac026800 nid=0x4702 runnable "G1 Concurrent Refinement Thread#2" os_prio=0 tid=0x00007f24ac025000 nid=0x4701 runnable "VM Periodic Task Thread" os_prio=0 tid=0x00007f24ac47e000 nid=0x470e waiting on condition JNI global references: 1388 Heap garbage-first heap total 1048576K, used 373760K \[0x00000000c0000000, 0x00000000c0102000, 0x0000000100000000) region size 1024K, 24 young (24576K), 16 survivors (16384K) Metaspace used 199688K, capacity 217347K, committed 217592K, reserved 1236992K class space used 24649K, capacity 29223K, committed 29264K, reserved 1048576K


Answers:
author: Zak Laughton
body: Hi Justin,

It's not entirely clear what may have caused this, but we have seen similar "Cannot call sendError()" errors in the past on MySQL if the JAVA_HOME is not configured properly. For reference, see:

* [Unable to reinstall Confluence, different Java errors at different stages.](https://community.atlassian.com/t5/Confluence-questions/Unable-to-reinstall-Confluence-different-Java-errors-at/qaq-p/790011#M107077)
* [HTTP Status 500 - Cannot call sendError() after the response has been committed](https://community.atlassian.com/t5/Confluence-questions/HTTP-Status-500-Cannot-call-sendError-after-the-response-has/qaq-p/732073)

-- Zak

comments: author: Justin Parker
body: I just put the fix at the beginning of the post. You have a bug in your docs.


Tags: confluence-server

error

install

mysql

server