i get the following error when i try to add my ftp storage (fritzbox):
ftp_connect(): php_network_getaddresses: getaddrinfo failed: Name or service not known at [...]apps/files_external/lib/Lib/Storage/FtpConnection.php#37
The ftp server is reachable via the command prompt on my server.
I use nextcloud 23.0.5 on ubuntu 20.04 with apache 2.4.41 and php 7.4.3
Hmm not sure then what causes this. Here a few ideas…
You are using a hostname and DNS resoultion is not working. In this case you could try to using the IP address instead of the DNS name.
The path respective the folder names do not match.
You did specify the protocol in the “Host” field of the External Storage app like this: (ftp://IP-ADDRESS). Try to enter just the hosname or the IP address. Otherwise it’s probably doubeling it up, because the app already adds ftp:// to the URL automatically.
Something else I didn’t think of. Unfortunately, this is a rather generic error message.
If none of this works, maybe you could post screenshots of your configs from both the FritzBox and the External Storage app in Nextcloud…
I specify only the hostname (without ftp://) in the form ‘hostname:port’.
Here are some screenshots:
The exclamation mark (error) in the nextcloud external storage config appears immediately (without delay), so maybe there are missing permissions to establish the ftp_connect() function?
Ok sorry. I think ftp:// is wrong. In this documentation the example is ftp.example.com:22 (bad example the default port is 21) and not ftp://ftp.example.com
Because of fritz...4 i think it is not FTP. Please explain your settings. If it is your Fritzbox and you use Nextlcoud at home you must set the FTP relative to your Nextcloud e.g. ftp-internal-ip:21.
My nextcloud runs on a separate VPS and is reachable via the internet.
My ftp-server is a fritzbox, which is reachable via DDNS (thats why it begins with fritz…) via the internet. I changed the default port to 4…
I can connect the the ftp-server directly from the server where the nextcloud runs.
There is also no problem to connect to the fritzbox-ftp-server via other clients/machines - just nextcloud can not connect.
In this tutorial port 47891 is used on the Fritzbox and as far as I can tell @caveflow is doing everything right on the Nextcloud side. What I don’t know is whether the External Storage App supports non default ports.
@caveflow Maybe you can try to set the FTP server to port 21 on the Fritzbox and see if it works without specifying a port in the External Storage App.
You can ip:port (see network socket) at the same time only once. If you first start e.g. FTP server on ip 192.168.1.1 (or a name) on port 2121 and then apache2 on ip 192.168.1.1 (or the same name) on port 2121 the socket (ip:port or name:port) is already used and apache2 does not work.
->addParameters([
new DefinitionParameter('host', $l->t('Host')),
(new DefinitionParameter('port', $l->t('Port')))
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
(new DefinitionParameter('root', $l->t('Remote subfolder')))
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
(new DefinitionParameter('secure', $l->t('Secure ftps://')))
->setType(DefinitionParameter::VALUE_BOOLEAN)
->setDefaultValue(true),
])