Hi everyone,
Hoping someone can help, I’m really stuck with the File Manager after a server migration. Running HestiaCP v1.9.3 (Panel PHP 8.3.17) on Ubuntu 22.04.5 LTS.
Problem:
When I try to open the File Manager for any user (admin, regular users), I just get the red “Unknown error” message.
Error Log (/var/log/hestia/nginx-error.log
): The error is always the same:
PHP message: PHP Warning: ini_set(): Session ini settings cannot be changed when a session is active...
PHP message: PHP Fatal error: Uncaught League\Flysystem\Sftp\ConnectionErrorException: Could not login with username: [username], host: 127.0.0.1 in /usr/local/hestia/web/fm/vendor/league/flysystem-sftp/src/SftpAdapter.php:244
Stack trace:
#0 /usr/local/hestia/web/fm/vendor/league/flysystem-sftp/src/SftpAdapter.php(207): League\Flysystem\Sftp\SftpAdapter->login()
#1 /usr/local/hestia/web/fm/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php(650): League\Flysystem\Sftp\SftpAdapter->connect()
... (rest of stack trace) ...
(Sometimes I also see: PHP Warning: file_get_contents(/home/[user]/.ssh/hst-filemanager-key): Failed to open stream: Permission denied...
just before the fatal error)
What I’ve Tried (Still Not Working):
- Manual SFTP Works Perfectly: I can log in fine using
sftp [email protected]
from the server’s command line with the user’s password. - Checked Forum/GitHub: I’ve searched the Hestia forums and GitHub issues for this
Could not login... 127.0.0.1
error. Found several related threads/issues (like #4759, #4914, forum thread 18011, forum thread 179XX). Tried the suggested solutions (like removinghst-filemanager-key
, checking permissions, applying ACLs) but the problem persists on my server. - SSH Config: Set
PasswordAuthentication yes
in/etc/ssh/sshd_config
and restartedsshd
.UsePAM yes
is also set. - User Shell: Set
SSH Access
tobash
for users in Hestia. - User Status: Checked users aren’t locked (
sudo passwd --status user
shows ‘P’). - Hestia Rebuild: Ran
sudo /usr/local/hestia/bin/v-rebuild-user user
. - File Manager Key: Tried deleting the key (
sudo rm -f /home/*/.ssh/hst-filemanager-key
). It regenerates but the error continues. Triedchown user:user
on the regenerated key too. - Password Resets: Reset passwords through the Hestia UI and using
v-change-user-password
. - Permissions: Session directory permissions seem okay. Tried ACLs (
setfacl -m u:hestiaweb:rwx /home/user/.ssh/
) - this let the key regenerate but didn’t fix the login error. - Service Restarts: Restarted
hestia
,nginx
,sshd
many times.
Database Download Issue (This part IS Fixed):
I did have the database download ERR_INVALID_RESPONSE issue too, but thankfully found the fix for the Undefined array key 1 warning (related to PR #4876) on the forum/GitHub. Applied the sed command, restarted services, and that part works now. Huge thanks to the Hestia devs and contributors who find and fix these things – you guys work like magicians sometimes!
Question:
Why would the File Manager fail the SFTP login when manual SFTP from the command line works fine? Has anyone seen this exact behaviour on Hestia 1.9.3 / PHP 8.3 where the common fixes don’t work? Is there some other known bug, PAM issue, PHP setting, or post-migration quirk I’m missing?
Really appreciate any ideas!
Thanks, Newbie
but starting to feel like a Junior