Confluence Error 500 after server upgrade: Unknown system variable 'useUnicode'
Asked by Julian Governale:

Hi,

Our infrastructure team has upgraded one of the confluence servers to be able to install some compliance plugins on the server. Im not to familiar with the server administrator aspects, just getting up to speed now so im sure im also missing some critical area's to review.

Once they upgraded the server, Confluence no longer starts up successfully and we get an error 500.

In the confluence logs im seeing the following error:

```
java.sql.SQLException: Unknown system variable 'useUnicode'
```

In the confluence config.xml file we have the following

```
<property name="hibernate.connection.url">jdbc:mysql://localhost/confluencedb?sessionVariables=useUnicode=true&amp;characterEncoding=utf8</property>
```

On My SQL im seeing the following when viewing the confluenceDB status. Not positive if Client Character set and Conn. Character set is culprit or something else...maybe the fact they are running everything off root?

![Screen Shot 2021-01-06 at 12.02.15 PM.png](/t5/image/serverpage/image-id/124365iD8539FAE68244051/image-size/large?v=v2&px=999 "Screen Shot 2021-01-06 at 12.02.15 PM.png")

The ERROR 500 is indicating:

```
com.atlassian.confluence.tenant.VacantException: Confluence is Vacant, a call to tenanted [public abstract org.hibernate.Session org.hibernate.SessionFactory.getCurrentSession() throws org.hibernate.HibernateException] is not allowed
```

The confluence service is running under a dedicate user account "confluence" so that isnt running under root and the confluence server previous worked according to the team that set it up and managed it.

Im currently stumped on where to look to try to find the issue and resolve it. I wanted to see if anyone else has had this issue after a server upgrade?


Answers:
author: Radek Dost?l
body: You have these parameters:
>
> ```
> jdbc:mysql://localhost/confluencedb?sessionVariables=useUnicode=true&amp;characterEncoding=utf8
> ```

Notice the use of equals '=' twice in succession.

Comparing that to my instance it uses this:
> jdbc:mysql://xxx.xxx.xxx.xxx:xxxx/confluencedb?autoReconnect=true\&amp;useSSL=false\&amp;useUnicode=true\&amp;characterEncoding=utf8

Each parameter must contain only a single equals, i.e. key=value; separated by ampersand \&.

Can you remove the sessionVariables to and see if this helps?

> jdbc:mysql://localhost/confluencedb?useUnicode=true\&amp;characterEncoding=utf8

comments: author: Julian Governale
body: Thanks for the response [@Radek Dost?l](/t5/user/viewprofilepage/user-id/715713) that eliminated the useUnicode error but i got a new one

```
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'performance_schema.session_variables' doesn't exist
```

I haven't checked the mysql config file just yet but will later to understand if the ++performance_schema = on++ is in there


author: Julian Governale
body: Thank you again for the help, once i made the suggested change, i did get another error but all i needed to do was set the compatibility on using the below command in mysql

```
set @@global.show_compatibility_56=ON;
```

Restarted confluence and boom, it's back up and running.


author: Radek Dost?l
body: Oof, nice one :)


Tags: confluence-server

mysql

server