Error Medic

Confluence Troubleshooting Guide: Fixing 'Connection Refused', Timeouts, and Slow Performance

Comprehensive guide to resolving Confluence configuration issues, 'Connection Refused' errors, timeouts, and slow performance. Learn to diagnose and apply fixes

Last updated:
Last verified:
1,400 words
Key Takeaways
  • Connection Refused errors often stem from proxy misconfigurations (Tomcat server.xml) or database connectivity loss.
  • Slow performance and timeouts are typically caused by insufficient JVM memory allocation (Heap space) or poorly tuned garbage collection.
  • Confluence not working after data migration usually indicates mismatched database collations or missing file system permissions.
  • Quick fix: Validate server.xml proxy settings, check catalina.out for OutOfMemoryError, and ensure the database connection string is correct in confluence.cfg.xml.
Troubleshooting Approaches Compared
MethodWhen to UseTimeRisk
Tuning JVM Heap SizeFrequent timeouts, 'java.lang.OutOfMemoryError', or slow UI response.10 minsLow
Fixing Tomcat server.xmlReverse proxy issues, HTTP 502/504, or 'Connection Refused' during login.15 minsMedium
Database Connection Pool TuningDatabase timeouts, slow macro rendering, or locked threads in thread dumps.20 minsMedium
Rebuilding Search IndexSearch returns no results or is extremely slow after a data migration.1-4 hoursLow

Understanding Confluence Configuration Errors

Atlassian Confluence is a robust enterprise wiki, but its reliance on the JVM, Tomcat, and a backend database means that misconfigurations can quickly cascade into critical failures. When Confluence goes down, administrators typically face one of several common symptoms: 'Connection Refused' errors when accessing the web interface, severe timeouts rendering pages, or sluggish performance that degrades the user experience.

These issues are rarely random. They usually trace back to three primary areas: JVM resource limits, Tomcat connector configurations (especially when behind a reverse proxy like Nginx or Apache), or database latency and connection pool exhaustion.

Symptom 1: Confluence Connection Refused

When users attempt to access Confluence and receive an ERR_CONNECTION_REFUSED in their browser, or when reverse proxies log 502 Bad Gateway, the Confluence application process is either not running, crashing on startup, or the Tomcat connector is misconfigured.

Common Error Logs in catalina.out:

SEVERE [main] org.apache.catalina.core.StandardServer.await StandardServer.await: create[localhost:8000]: 
java.net.BindException: Address already in use

Or, if the database connection fails during startup:

FATAL [main] [atlassian.confluence.setup.ConfluenceConfigurationListener] contextInitialized 
Database connection error: org.postgresql.util.PSQLException: Connection to localhost:5432 refused.
Step 1: Diagnose the Connection Issue

First, verify if the Confluence process (Java) is actually running and listening on the expected port (default 8090).

Run the following command on your Linux server: netstat -tulpn | grep 8090

If the port is not actively listening, check the Tomcat logs located at <confluence-install>/logs/catalina.out or <confluence-home>/logs/atlassian-confluence.log. Look for fatal exceptions during the startup sequence.

If Confluence is running behind a reverse proxy, ensure the server.xml file has the correct proxyName, proxyPort, and scheme defined in the <Connector> block.

Step 2: Fix Tomcat and Proxy Configuration

If you are using Nginx with SSL, your <confluence-install>/conf/server.xml should look something like this:

<Connector port="8090" connectionTimeout="20000" redirectPort="8443"
           maxThreads="48" minSpareThreads="10"
           enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8"
           protocol="org.apache.coyote.http11.Http11NioProtocol"
           scheme="https" secure="true" proxyName="confluence.yourdomain.com" proxyPort="443"/>

Restart Confluence after modifying server.xml.

Symptom 2: Confluence Slow Performance and Timeouts

If Confluence is accessible but pages take over 10 seconds to load, or users frequently see 504 Gateway Timeout errors, the system is likely starving for resources. This is the most common complaint in large enterprise environments.

Common Error Logs:

java.lang.OutOfMemoryError: GC overhead limit exceeded
WARN [http-nio-8090-exec-12] [confluence.util.profiling.DurationThresholdWarningTimingPoint] 
Execution of action /display/SPACE/Page+Name took 15432 ms
Step 1: Diagnose Resource Starvation

The most frequent cause of Confluence slow performance is insufficient JVM Heap memory. When the heap is full, the Java Garbage Collector works overtime, freezing the application (Stop-The-World pauses).

Check your garbage collection logs or use monitoring tools like AppDynamics, Dynatrace, or Prometheus/Grafana via JMX. If GC pauses exceed a few seconds, you need more memory.

Additionally, check database latency. If the database is on a slow disk or the network link is saturated, Confluence threads will block waiting for SQL queries to return.

Step 2: Fix JVM Memory Allocation

You need to increase the maximum heap size (-Xmx) and potentially the minimum heap size (-Xms).

Locate your setenv.sh (Linux) or setenv.bat (Windows) file in the <confluence-install>/bin/ directory.

Find the line defining CATALINA_OPTS or JVM_MAXIMUM_MEMORY. Update it to grant more RAM. For a medium-sized instance (500-1000 users), 4GB to 8GB is typical.

# Edit setenv.sh
CATALINA_OPTS="-Xms4096m -Xmx4096m -XX:+UseG1GC ${CATALINA_OPTS}"

Note: Setting Xms and Xmx to the same value prevents the JVM from spending resources resizing the heap during runtime.

After saving the file, restart the Confluence service. Monitor the atlassian-confluence.log to ensure the new memory settings are applied successfully.

Symptom 3: Confluence Data Migration Failures

Migrating Confluence data (e.g., from Server to Data Center, or moving to a new database engine) often results in a broken application if not handled meticulously. "Confluence not working" after a migration is a broad symptom usually pointing to database integrity issues or file system permission errors.

Step 1: Diagnose Migration Issues

If Confluence fails to start after restoring a database dump, the atlassian-confluence.log will typically show SQL exceptions or Liquibase migration failures.

Common Error:

Caused by: java.sql.SQLException: Cannot create PoolableConnectionFactory (FATAL: password authentication failed for user "confluence")

Or collation errors:

java.sql.SQLException: Illegal mix of collations (utf8_bin,NONE) and (utf8_general_ci,IMPLICIT) for operation '='
Step 2: Fix Database and Configuration Mismatches
  1. Verify confluence.cfg.xml: Ensure the JDBC URL, username, and password in <confluence-home>/confluence.cfg.xml match the new database environment.
  2. Database Character Set: For MySQL/PostgreSQL, Confluence strictly requires UTF8 character sets and specific collations (e.g., utf8_bin for MySQL). If your migrated database used the wrong collation, you will experience bizarre bugs and missing content. You may need to alter the database and tables to use the correct character set and collation before starting Confluence.
  3. Permissions: Ensure the OS user running the Confluence process (usually confluence) has read/write ownership over the entire <confluence-home> directory, especially the attachments folder.
# Fix permissions on Linux
chown -R confluence:confluence /var/atlassian/application-data/confluence

Conclusion

Troubleshooting Confluence configuration issues requires a systematic approach. Always start by checking whether the Java process is running, then move to the Tomcat logs (catalina.out) and application logs (atlassian-confluence.log). By understanding the relationship between the JVM, Tomcat connector, and the backend database, you can quickly isolate whether a "Connection Refused" error or slow performance is a proxy issue, a memory limit, or a database bottleneck.

Frequently Asked Questions

bash
# Diagnostic commands for Confluence troubleshooting

# 1. Check if Confluence process is running and listening on port 8090
netstat -tulpn | grep 8090

# 2. Check the Tomcat logs for fatal startup errors
tail -n 200 /opt/atlassian/confluence/logs/catalina.out

# 3. Check application logs for OutOfMemory or Database errors
grep -i "error\|exception\|fatal" /var/atlassian/application-data/confluence/logs/atlassian-confluence.log | tail -n 50

# 4. Fix permissions on the Confluence home directory (often needed after data migration)
sudo chown -R confluence:confluence /var/atlassian/application-data/confluence

# 5. Check current JVM memory arguments on a running Confluence instance
ps aux | grep java | grep confluence

# Example of tuning memory in setenv.sh
# sed -i 's/CATALINA_OPTS=""/CATALINA_OPTS="-Xms4096m -Xmx4096m"/g' /opt/atlassian/confluence/bin/setenv.sh
E

Error Medic Editorial

The Error Medic Editorial team consists of senior DevOps engineers and Atlassian ecosystem experts dedicated to untangling complex enterprise software infrastructure issues.

Sources

Related Guides