I can't find public_html and I can not create files or folder in file manager within my website using my user in hestiacp

Analysis of NGINX error log

The provided NGINX error log indicates several instances of an “Uncaught League\Flysystem\Sftp\InvalidRootException” error. This means that the Flysystem library, which is used to interact with the SFTP server, is encountering an issue with the root directory.

Here’s a breakdown of the error message:

  • PHP Notice: Invalid SFTP packet size
  • PHP Notice: Expected SSH_FXP_VERSION
  • PHP Fatal error: Uncaught League\Flysystem\Sftp\InvalidRootException: Root is invalid or does not exist: /

This suggests that:

  1. There is an issue with the communication between PHP and the SFTP server.
  2. The library is expecting a specific response from the server, but it’s receiving something different.
  3. The root directory specified for the SFTP connection is either invalid or does not exist.

The stack trace indicates the following sequence of events:

  1. SftpAdapter.php(208): The SftpAdapter attempts to set the connection root directory.
  2. AbstractFtpAdapter.php(650): The adapter tries to establish a connection with the SFTP server.
  3. SftpAdapter.php(360): If the connection is successful, the adapter retrieves the connection object.
  4. AbstractFtpAdapter.php(338): The adapter tries to list the contents of the root directory.
  5. Filesystem.php(272): The Flysystem library attempts to access the files listed by the adapter.
  6. Filesystem.php(199): The library encounters the “InvalidRootException” due to the invalid or non-existent directory.

Possible causes:

  • Incorrect configuration: The SFTP connection details (host, username, password, port, root directory) might be incorrect.
  • Permissions: The user might not have sufficient permissions to access the specified root directory.
  • SFTP server issues: The SFTP server itself might be experiencing problems.

Recommendations

Here are some steps you can take to troubleshoot the issue:

  1. Verify SFTP connection details: Double-check the host, username, password, port, and root directory specified for the SFTP connection. Ensure they are accurate and match your SFTP server configuration.
  2. Check user permissions: Make sure the user used for the SFTP connection has read and write access to the specified root directory.
  3. Test SFTP connection manually: Use an SFTP client like WinSCP or FileZilla to connect to the server using the same credentials and root directory. This will help confirm if the issue is specific to the Flysystem library or a general connection issue.
  4. Review Flysystem configuration: Check the configuration of the Flysystem adapter to ensure it’s using the correct SFTP connection details and root directory.
  5. Enable debug logging: Enable debug logging for both the Flysystem library and the SFTP server to obtain more detailed information about the error. This can help identify the specific cause of the communication issue.
  6. Seek support: If you’re unable to resolve the issue on your own, consider seeking help from the Flysystem library documentation, community forums, or contacting the SFTP server administrator.

By following these recommendations, you should be able to identify the root cause of the “InvalidRootException” error and fix the issue with the SFTP connection.