External Storage FTP Connection is broken since Upgrade from 30.0.10 to 31.0.4

Pasted from nexcloud-snap Github, who reffered me here for something that could be an upstream issue.

Describe the bug

Since Upgrade from 30.0.10 to 31.0.4 the folder that was mapped to FTP first loaded entlessly and now shows “No files…”.
Log shows many instances of:
foreach() argument must be of type array|object, false given at /snap/nextcloud/47611/htdocs/apps/files_external/lib/Lib/Storage/FTP.php#327

And many instances of this, which is probably the culprit:
Unable to get last modified date for ftp folder (), failed to list folder contents

I have not changed my External Storage config until today, the upgrade was about a week ago and since then the connection did not work.

To Reproduce

Steps to reproduce the behavior:

  • Very Basic Plain FTP Server hosted in Docker
  • Added through the Webinterface

Expected behavior

Load and list the folders in FTP

Screenshots

Image

Image

OS/snapd/snap version

root@cloud:~# cat /etc/debian_version
12.2

root@cloud:~# snap list nextcloud
Name Version Rev Tracking Publisher Notes
nextcloud 31.0.4snap1 47611 latest/stable nextcloud✓ -

root@cloud:~# snap version
snap 2.61.4
snapd 2.61.4
series 16
debian 12
kernel 6.1.0-13-amd64

Logs

Everything i tried to copy is too big for github… if you request specific logs, i will try to provide them

Hey @LBIGsest55 welcome to the community

are you able to connect directly to that FTP-Server from the host? please try connecting to the FTP-Sever using a browser from the nextcloud host or using the shell.

this log error seems to imply that missing arguments… can you tell us more about the target FTP service? assuming the FTP service is running on a different host in your network, is that host and service available at all?

prefer using SFTP since that only requires SSH and is far easier to configure without additional services see

Please post the full raw log entry (stack trace) as described in the support template.

Everything i tried to copy is too big for github… if you request specific logs, i will try to provide them

There is no need to post all your logs; just the relevant entry or two.

P.S. It would also be helpful to know what FTP server you’re connecting to, since the problem may be due to a quirk specific to a given FTP server’s output.