New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting non-standard port from GUI broken for FTP #32773
Comments
I have same |
Hi, please update to 24.0.9 or better 25.0.3 and report back if it fixes the issue. Thank you! My goal is to add a label like e.g. 25-feedback to this ticket of an up-to-date major Nextcloud version where the bug could be reproduced. However this is not going to work without your help. So thanks for all your effort! If you don't manage to reproduce the issue in time and the issue gets closed but you can reproduce the issue afterwards, feel free to create a new bug report with up-to-date information by following this link: https://github.com/nextcloud/server/issues/new?assignees=&labels=bug%2C0.+Needs+triage&template=BUG_REPORT.yml&title=%5BBug%5D%3A+ |
OK, updated to NextCloud 25.0.3. (In addition to updating php to 8.1.) The issue is still present: PHP engine versionPHP 8.1 Nextcloud Logs
|
Nice workaround @phibbs7. Thanks! Note that the documentation (e.g. https://docs.nextcloud.com/server/26/admin_manual/configuration_files/external_storage/sftp.html) suggests that you can use colon syntax, e.g. |
Bug description
Attempting to use an external FTP storage with a non-standard port fails. This is due to FtpConnection:__construct() getting the port to use from the GUI as part of the hostname argument and using the raw value as is. While PHP's ftp connect functions expect the hostname and port to be separate arguments.
This can also be seen in the cli:
$sudo php ./occ files_external:config mount id hostname
example.com:1234
$sudo php ./occ files_external:config mount id port
null
$
This will cause the debug log to get a PHP error from either ftp_ssl_connect() or ftp_connect(): getaddrinfo failed: Name or service not known
Steps to reproduce
Expected behavior
FTP connection test to succeed and the external storage to be usable.
Installation method
Manual installation
Operating system
Debian/Ubuntu
PHP engine version
PHP 7.4
Web server
Apache (supported)
Database engine version
MariaDB
Is this bug present after an update or on a fresh install?
Updated from a minor version (ex. 22.2.3 to 22.2.4)
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
Configuration report
No response
List of activated Apps
Nextcloud Signing status
No response
Nextcloud Logs
Additional info
As a workaround, manually setting the port for the external storage via the occ command on the CLI will allow the connection to work.
E.x.
$sudo php ./occ files_external:config mount_id host example.com
$sudo php ./occ files_external:config mount_id port 1234
The text was updated successfully, but these errors were encountered: