Various issues, now website is down

Username

epiz_28642109
185.27.134.116

Error Message

This site can’t be reached

Other Information

Brand new website, working on building it. Was going fine until the last 24 hours, have been experiencing various issues over that timeframe.

First FileZilla was unable to transfer files (still retrieved the file structure / directory listing but transfers failed and the connection aborted after a minute - 421 Timeout & TLS non-proper termination). That’s OK, I was still able to transfer files using the Online File Manager on cPanel.

Then the PHP login function on my site stopped working, so the private parts of the site were unavailable. I am a bit new to PHP but I suspect the issue is with sessions, something on the server side. I didn’t change any code or settings on my side that would have impacted this.

I decided that was a good time to get my SSL Certificate.

Now the site is down, and both FileZilla and the cPanel Online File Manager can not connect at all.

Not sure which of these things are related, if any. Not sure what I can do to bring the site back online? Is it caused by various changing server problems that will resolve themselves?

Thanks,
moti

Hey there, FTP (FileZilla) should be working, although there are two other cases here about PHP, it is unknown if they are related though. Can you please send your URL so we can take a look?
Thanks.

https://motivation.systems/welcome.php

Good news is the site is back online and cPanel Online File Manager can transfer files. FileZilla retrieves the directory listing but still can’t transfer files & aborts the connection.

Bad news is the if statement below is still evaluating to true (both parts). I have not changed any code in the login.php file since it was last working properly. Any guess what could cause the SESSION[“loggedin”] variable to no longer get set upon login?

First few lines of welcome.php:

<?php
  session_start();

  if(!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== true){
    header("location: login.php");
    exit;
  }

...

Ah, you are not the third person to mention php sessions. There may be an issue there. As for FileZilla, can you share the full error logs?
Thanks.

Hi Greenreader9,

Nice to know I’m not the only one =) Is there anything you think I can do at this point?

Some recent FileZilla logs, I believe these are from BEFORE the site came back online (will post the rest in the next post):

Status: Resolving address of ftpupload.net
Status: Connecting to 185.27.134.11:21…
Status: Connection established, waiting for welcome message…
Status: Initializing TLS…
Status: Verifying certificate…
Status: TLS connection established.
Command: USER epiz_28642109
Response: 331 User epiz_28642109 OK. Password required
Command: PASS ***************
Error: Connection timed out after 20 seconds of inactivity
Error: Could not connect to server
Status: Waiting to retry…
Status: Resolving address of ftpupload.net
Status: Connecting to 185.27.134.11:21…
Status: Connection established, waiting for welcome message…
Response: 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
Response: 220-You are user number 4452 of 6900 allowed.
Response: 220-Local time is now 08:23. Server port: 21.
Response: 220-This is a private system - No anonymous login
Response: 220 You will be disconnected after 60 seconds of inactivity.
Command: AUTH TLS
Response: 234 AUTH TLS OK.
Status: Initializing TLS…
Status: Verifying certificate…
Status: TLS connection established.
Command: USER epiz_28642109
Response: 331 User epiz_28642109 OK. Password required
Command: PASS ***************
Error: Connection timed out after 20 seconds of inactivity
Error: Could not connect to server

I believe these logs are from AFTER the site came back online:

Status: Disconnected from server
Status: Resolving address of ftpupload.net
Status: Connecting to 185.27.134.11:21…
Status: Connection established, waiting for welcome message…
Status: Initializing TLS…
Status: Verifying certificate…
Status: TLS connection established.
Status: Logged in
Status: Retrieving directory listing…
Status: Directory listing of “/” successful
Status: Retrieving directory listing of “/htdocs”…
Status: Directory listing of “/htdocs” successful
Response: 421 Timeout - try typing a little faster next time
Error: GnuTLS error -110 in gnutls_record_recv: The TLS connection was non-properly terminated.
Status: Server did not properly shut down TLS connection
Error: Could not read from socket: ECONNABORTED - Connection aborted
Error: Disconnected from server

Thanks =)

Hm, this may still be related to the system outage.
The lines

Error: Could not read from socket: ECONNABORTED - Connection aborted

Response: 421 Timeout - try typing a little faster next time

Those were the errors that were given earlier. As for the PHP, could you please share your code?
Thanks.

Is the system outage still ongoing? Those errors are still occurring in FileZilla as of now.

Is there any possibility that the system outage is connected to why the PHP sessions are no longer setting variables correctly?

I would be surprised if it were a code issue as I have not changed any of that code, and it does in fact redirect to welcome.php upon successfully logging in… it just redirects right back to login.php afterward since it can’t find the $_SESSION[“loggedin”] variable.

Code from login.php is below:

<?php
// Initialize the session
session_start();
 
// Check if the user is already logged in, if yes then redirect him to welcome page
if(isset($_SESSION["loggedin"]) && $_SESSION["loggedin"] === true){
    header("location: welcome.php");
    exit;
}
 
// Include config file
require_once "config.php";
 
// Define variables and initialize with empty values
$username = $password = "";
$username_err = $password_err = $login_err = "";
 
// Processing form data when form is submitted
if($_SERVER["REQUEST_METHOD"] == "POST"){
 
    // Check if username is empty
    if(empty(trim($_POST["username"]))){
        $username_err = "Please enter your username.";
    } else{
        $username = trim($_POST["username"]);
    }
    
    // Check if password is empty
    if(empty(trim($_POST["password"]))){
        $password_err = "Please enter your password.";
    } else{
        $password = trim($_POST["password"]);
    }
    
    // Validate credentials
    if(empty($username_err) && empty($password_err)){
        // Prepare a select statement
        $sql = "SELECT id, username, password FROM table WHERE username = ?";
        
        if($stmt = mysqli_prepare($link, $sql)){
            // Bind variables to the prepared statement as parameters
            mysqli_stmt_bind_param($stmt, "s", $param_username);
            
            // Set parameters
            $param_username = $username;
            
            // Attempt to execute the prepared statement
            if(mysqli_stmt_execute($stmt)){
                // Store result
                mysqli_stmt_store_result($stmt);
                
                // Check if username exists, if yes then verify password
                if(mysqli_stmt_num_rows($stmt) == 1){                    
                    // Bind result variables
                    mysqli_stmt_bind_result($stmt, $id, $username, $hashed_password);
                    if(mysqli_stmt_fetch($stmt)){
                        if(password_verify($password, $hashed_password)){
                            // Password is correct, so start a new session
                            session_start();
                            
                            // Store data in session variables
                            $_SESSION["loggedin"] = true;
                            $_SESSION["id"] = $id;
                            $_SESSION["username"] = $username;                            
                            
                            // Redirect user to welcome page
                            header("location: welcome.php");
                        } else{
                            // Password is not valid, display a generic error message
                            $login_err = "Invalid username or password.";
                        }
                    }
                } else{
                    // Username doesn't exist, display a generic error message
                    $login_err = "Invalid username or password.";
                }
            } else{
                echo "Oops! Something went wrong. Please try again later.";
            }

            // Close statement
            mysqli_stmt_close($stmt);
        }
    }
    
    // Close connection
    mysqli_close($link);
}
?>

html follows…

This seems normal to me. Our FTP server is quite aggressive in closing idle connections. But if you open the FTP connection and the directory listing appears, you should just be able to navigate your account and initiate transfers without any problems.

Hello Admin,

Thanks so much for your response =)

Surprisingly, although I am able to open the FTP connection and the directory listing appears, and I am even able to move files between different folders on the server - all transfers fail and then the connection is closed after about 1-2 minutes. This behavior has been quite consistent over the last 2 days (except when the site has been down and the connection does not open at all). Before that, transfers had never failed and the connection had never closed itself (at least not for a few hours).

Additionally there is the other simultaneous issue that PHP SESSIONs are no longer functioning properly. I believe the two issues are related somehow because they started around the same time.

I have worked on several different websites with InfinityFree and haven’t had this behavior before, so I do believe that this is caused by something happening within the last 48 hours on the server side. Does that sound accurate?

Just want to add - the amount of features you guys pack into your free hosting service is already quite good, and I’m super grateful for the support effort you put in on the forum.

moti!

1 Like

Not sure if this is helpful but as recommended in the InfinityFree Knowledge Base, I have now set FileZilla Debug logs to “2-Info”. Fuller logs pasted below:

Status: Disconnected from server
Status: Resolving address of ftpupload.net
Status: Connecting to 185.27.134.11:21…
Status: Connection established, waiting for welcome message…
Response: 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
Response: 220-You are user number 341 of 6900 allowed.
Response: 220-Local time is now 05:38. Server port: 21.
Response: 220-This is a private system - No anonymous login
Response: 220 You will be disconnected after 60 seconds of inactivity.
Command: AUTH TLS
Response: 234 AUTH TLS OK.
Status: Initializing TLS…
Trace: TLS Handshake successful
Trace: Protocol: TLS1.2, Key exchange: RSA, Cipher: AES-256-GCM, MAC: AEAD
Status: Verifying certificate…
Status: TLS connection established.
Command: USER epiz_28642109
Response: 331 User epiz_28642109 OK. Password required
Command: PASS ***************
Response: 230-Your bandwidth usage is restricted
Response: 230 OK. Current restricted directory is /
Command: OPTS UTF8 ON
Response: 200 OK, UTF-8 enabled
Command: PBSZ 0
Response: 200 PBSZ=0
Command: PROT P
Response: 200 Data protection level set to “private”
Status: Logged in
Trace: Measured latency of 75 ms
Status: Retrieving directory listing…
Command: PWD
Response: 257 “/” is your current location
Command: TYPE I
Response: 200 TYPE is now 8-bit binary
Command: PASV
Response: 227 Entering Passive Mode (185,27,134,11,180,112)
Trace: Binding data connection source IP to control connection source IP 192.168.0.12
Trace: Trying to resume existing TLS session.
Command: MLSD
Response: 150 Accepted data connection
Trace: TLS Handshake successful
Trace: TLS Session resumed
Trace: Protocol: TLS1.2, Key exchange: RSA, Cipher: AES-256-GCM, MAC: AEAD
Response: 226-Options: -a -l
Response: 226 6 matches total
Status: Directory listing of “/” successful
Status: Retrieving directory listing of “/htdocs”…
Command: CWD /htdocs
Response: 250 OK. Current directory is /htdocs
Command: PASV
Response: 227 Entering Passive Mode (185,27,134,11,125,199)
Trace: Binding data connection source IP to control connection source IP 192.168.0.12
Trace: Trying to resume existing TLS session.
Command: MLSD
Trace: TLS Handshake successful
Trace: TLS Session resumed
Trace: Protocol: TLS1.2, Key exchange: RSA, Cipher: AES-256-GCM, MAC: AEAD
Response: 150 Accepted data connection
Response: 226-Options: -a -l
Response: 226 17 matches total
Status: Directory listing of “/htdocs” successful

(***Note: I tried to transfer a file here and it failed (Reason: Connecting). Then after a minute…)

Response: 421 Timeout - try typing a little faster next time
Trace: Unexpected reply, no reply was pending.
Error: GnuTLS error -110 in gnutls_record_recv: The TLS connection was non-properly terminated.
Status: Server did not properly shut down TLS connection
Error: Could not read from socket: ECONNABORTED - Connection aborted
Error: Disconnected from server

Update: The website now seems to be working normally, sessions and FileZilla transfers and all! I will respond if that changes again. Thank you so much for your help =)

1 Like

The server kicks out the FTP connection after 20 seconds. It has always done that and never caused too many problems.

The transfers failing is odd because FileZilla should new, open separate connections for that. In any case, disconnecting, reconnecting and then restarting the transfers should work.

If that still doesn’t help, you could try connecting over a VPN instead because it may be a problem with the FTP connection handling.

I also believe that the PHP session issue is related to the ongoing problems. I responded to that here:

But according to @tekaranle, the problem was solved. Is it solved for you too?

1 Like

Yes - as mentioned yesterday sessions and FTP transfers resumed their normal functions. Both have been functioning normally for me since then.

Thanks for your help!

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.