fwrite() issue with Monsta FTP

  • I'm facing an issue with Monsta FTP. When I try to login, i come up with an Error like "Error! An unknown error occured during authentication."


    The request to api comes back with the following error:


    Code
    1. Fatal error: Uncaught Exception: Expected to write 6 bytes but only wrote in /var/www/imscp/gui/vendor/imscp/monsta-ftp/mftp/application/api/file_sources/connection/mftp_functions.php:1035
    2. Stack trace:
    3. #0 /var/www/imscp/gui/vendor/imscp/monsta-ftp/mftp/application/api/file_sources/connection/mftp_functions.php(675): _mftp_put_cmd(Object(mftp_conn), 'QUIT\r\n')
    4. #1 /var/www/imscp/gui/vendor/imscp/monsta-ftp/mftp/application/api/file_sources/connection/MFTPConnection.php(80): mftp_disconnect(Object(mftp_conn))
    5. #2 /var/www/imscp/gui/vendor/imscp/monsta-ftp/mftp/application/api/file_sources/connection/ConnectionBase.php(157): MFTPConnection->handleDisconnect()
    6. #3 /var/www/imscp/gui/vendor/imscp/monsta-ftp/mftp/application/api/request_processor/RequestDispatcher.php(161): ConnectionBase->disconnect()
    7. #4 /var/www/imscp/gui/vendor/imscp/monsta-ftp/mftp/application/api/request_processor/RequestMarshaller.php(77): RequestDispatcher->disconnect()
    8. #5 /var/www/imscp/gui/vendor/imscp/monsta-ftp/mftp/application/api/api.php(60): Reques in /var/www/imscp/gui/vendor/imscp/monsta-ftp/mftp/application/api/file_sources/connection/mftp_functions.php on line 1035


    That is possibly the piece of code where the error occurs:


    Code
    1. if (!is_null($connection->logger))
    2. $connection->logger->log($command);
    3. $bytesWritten = fwrite($connection->commandSocket, $command);
    4. if ($bytesWritten === FALSE || $bytesWritten != strlen($command))
    5. throw new Exception("Expected to write " . strlen($command) . " bytes but only wrote $bytesWritten");


    I tried to update Monsta FTP, but same again. What can I do? Any suggestions?

  • Unfortunately nothing.


    Today, I restarted imscp_panel and now it works! Hmm...


    So I think this thread can be closed.