How can I "un-blacklist" synchrony.host and synchrony.port in synchrony-args.properties?
Asked by Peter Horvath:

I wanted to run synchrony (the one built into confluence) on a different port. It is because I have multiple confluence instances on the same server.

After many (honestly, already too much) digging, I've found this: <https://confluence.atlassian.com/conf60/administering-collaborative-editing-852732551.html>

...where you explain, it needs a "synchrony.port" setting in "synchrony-args.properties". So, I've set it up... and nothing happened.

However, I've found this in the synchrony logs:

```
WARN [synchrony-interop-executor:thread-1] [plugins.synchrony.bootstrap.DefaultSynchronyProcessManager] populateSynchronyArguments Removed property [synchrony.port->8099] from synchrony sysprop argument list
```

Hmm, things became quite interesting at this point, so I did a deeper bug-digging.

This is what I have in DefaultSynchronyProcessManager.java :

```
??? private static final String[] SYNCHRONY_ARGS_BLACKLIST = {
??????????? "synchrony.memory.max", "synchrony.stack.space",
??????????? "synchrony.host",? "reza.host",
??????????? "synchrony.context.path", "reza.context.path",
??????????? "synchrony.port", "reza.port",
??????????? "synchrony.bind", "reza.bind",
??????????? "synchrony.service.url", "reza.service.url",
??????????? "synchrony.cluster.bind", "reza.cluster.bind"};
```

```
??????????????? for (String argumentName : SYNCHRONY_ARGS_BLACKLIST) {
??????????????????? Object removed = synchronyArgs.remove(argumentName);
??????????????????? if (removed != null) {
??????????????????????? log.warn("Removed property [{}->{}] from synchrony sysprop argument list" , argumentName, removed.toString());
??????????????????? }
??????????????? }
```

So, I've found the reason, why the synchrony host/port can't be changed, contrary the available documentation.

Is there an useful workaround for this problem?


Answers:
author: Peter Horvath
body: After debugging the source code, I've found a workaround.

The synchrony.port and synchrony.host system-properties still exist, but the synchrony instance managed by the confluence server doesn't get them as command-line JVM arguments (for example, "-Dsynchrony.host=1.2.3.4"), instead as environment variables. These environment variables are generated from a wired-in list by the confluence daemon.

**This list can't be affected by any easily available configuration file, and nothing mentions this in the available Atlassian docs. [This resource](https://confluence.atlassian.com/conf60/administering-collaborative-editing-852732551.html) citing "synchrony-arguments.properties" is unfortunately obsolete. In fact, both "synchrony.host" and "synchrony.port" are blacklisted and substituded by its default in the Confluence source code.**

However, you can modify it by overwriting the file

```
confluence/confluence/WEB-INF/atlassian-bundled-plugins/synchrony-interop-6.14.1.jar
```

(The filename contains a confluence version string.)

Unpack this jar, and extract the file env/synchrony.properties from it. It has the needed synchrony.host and synchrony.port settings. Overwrite them as you wish (most likely, you will want to change the port to a different one, and the synchrony.host to 0.0.0.0).

After that, you can update this file in the jar with the

```
jar uf synchrony-interop-6.14.1.jar env/synchrony.properties 
```

as it is written in [this](https://stackoverflow.com/a/8461376/1783163) SO answer.

Note, anything in confluence/confluence/WEB-INF/atlassian-bundled-plugins , which is not a confluence plugin, will cause your confluence to not working properly!

However, after that, the synchrony will work as it is needed.

If you have Confluence behind an Apache proxy, then you might learn more about its integration in [this](https://community.atlassian.com/t5/Confluence-questions/Synchrony-behind-Apache-2-4-over-SSL-does-not-work/qaq-p/282154) answer.


Tags: confluence-server

server