Connection Refused

Problem

The Manta Server URL returns a Connection Refused error both for access via the browser and in Manta Client.

Solution

This general error means that the server isn't accessible. There can be several reasons for this. Please see the checklist below.

This checklist applies when Apache Tomcat is used as the application container.

The Tomcat Process Isn't Running

  1. Windows

    1. Check the process or service in the task manager.
  2. Unix

    1. Command: ps -ef | grep $MANTA_SERVER_HOME | grep java

    2. Output should be something like:

      tfechtn+ 2071 1 19 14:26 pts/0 00:00:22 /home/tfechtner/java/jre1.7.0_80/bin/java -Djava.util.logging.config.file=/home/tfechtner/manta/server/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Xmx4G -Djava.endorsed.dirs=/home/tfechtner/manta/server/endorsed -classpath /home/tfechtner/manta/server/bin/bootstrap. jar:/home/tfechtner/manta/server/bin/tomcat-juli.jar-Dcatalina.base=/home/tfechtner/manta/server -Dcatalina.home=/home/tfechtner/manta/server -Djava.io.tmpdir=/home/tfechtner/manta/server/temp org.apache.catalina.startup.Bootstrap start

Tomcat Started with Errors

  1. Open the log file <MANTA_DIR_SERVER>/logs/catalina.rrrr-mm-dd.log.
  2. There shouldn't be any error messages, especially not anything like:

    1. SEVERE: Failed to initialize end point associated with ProtocolHandler ["http-bio-8080"]
      java.net.BindException: Address already in use: JVM_Bind <null>:8080
      
    2. This specific error indicates that the port is occupied by another application.

  3. The last log records should be something like:

catalina.rrrr-mm-dd.log

XI 29, 2016 2:39:32 ODP. org.apache.catalina.startup.Catalina start
INFO: Server startup in 11261 ms

The Manta Application Is Not Deployed on Tomcat

  1. Open the log file <MANTA_DIR_SERVER>/logs/catalina.rrrr-mm-dd.log.
  2. There should be log records similar to:

catalina.rrrr-mm-dd.log

XI 29, 2016 2:39:21 ODP. org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive C:\apache-tomcat\webapps\manta-dataflow-server.war
XI 29, 2016 2:39:26 ODP. org.apache.catalina.startup.TldConfig execute
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
XI 29, 2016 2:39:31 ODP. org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive C:\apache-tomcat\webapps\manta-dataflow-server.war has finished in 10,849 ms

Tomcat Is Not Listening on the Requested IP Version

  1. Find out what process ID is being used: ps -ef | grep $MANTA_SERVER_HOME | grep java.

  2. Run the command netstat -tulpen.

  3. netstat -tulpen

    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode      PID/Program name
    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      0          16002      -
    tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      0          17649      -
    tcp        0      0 0.0.0.0:5666            0.0.0.0:*               LISTEN      994        15249      -
    tcp6       0      0 :::8080                 :::*                    LISTEN      1002       3439937    2071/java
    tcp6       0      0 ::1:25                  :::*                    LISTEN      0          17650      -
    tcp6       0      0 :::5666                 :::*                    LISTEN      994        15250      -
    tcp6       0      0 127.0.0.1:8005          :::*                    LISTEN      1002       3439998    2071/java
    tcp6       0      0 :::8009                 :::*                    LISTEN      1002       3439938    2071/java
    udp        0      0 0.0.0.0:123             0.0.0.0:*                           996        13548      -
    udp        0      0 127.0.0.1:323           0.0.0.0:*                           996        13546      -
    udp6       0      0 ::1:323                 :::*                                996        13547      -
    
  4. Line 6 says that Tomcat (in this case PID 2071) is listening on port 8080 via TCP IPv6.

  5. If you need to access Manta over IPv4, continue with the following steps.

  6. Create or edit the file <MANTA_DIR_SERVER>/bin/setenv.sh.

  7. Add the row export CATALINA_OPTS="$CATALINA_OPTS -Djava.net.preferIPv4Stack=true".

  8. Restart the server.

  9. The output of the command netstat -tulpen should look like this.

  10. netstat -tulpen

    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode      PID/Program name
    tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN      1002       3444068    2452/java
    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      0          16002      -
    tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      0          17649      -
    tcp        0      0 0.0.0.0:5666            0.0.0.0:*               LISTEN      994        15249      -
    tcp        0      0 0.0.0.0:8009            0.0.0.0:*               LISTEN      1002       3444069    2452/java
    tcp6       0      0 ::1:25                  :::*                    LISTEN      0          17650      -
    tcp6       0      0 :::5666                 :::*                    LISTEN      994        15250      -
    udp        0      0 0.0.0.0:123             0.0.0.0:*                           996        13548      -
    udp        0      0 127.0.0.1:323           0.0.0.0:*                           996        13546      -
    udp6       0      0 ::1:323                 :::*                                996        13547      -
    

A Firewall Is Blocking the Specific Port

Wrong output

--2016-11-29 15:16:16--  http://localhost/manta-dataflow-server
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:80... failed: Connection refused.
Connecting to localhost (localhost)|127.0.0.1|:80... failed: Connection refused.