FTP service doesn't start from the GUI

stephenreda

Dabbler
Joined
Oct 28, 2012
Messages
29
When I enable the FTP service from the GUI I get the following error message:
FTP service failed to start.

When is start the FTP service from the CLI, everything works:
root@freenas:~ # service ftpd onestart
Starting ftpd.
root@freenas:~ # service ftpd onestatus
ftpd is running as pid 24082.

I am making the assumption that Freenas is using ftpd under the hood.

Any ideas why I am getting this error?


ABOUT

Version:

FreeNAS-11.3-U3.2
Label Icon

Hostname:
freenas.local
Label Icon

Uptime:
1:42PM up 18:44, 1 user
Label Icon

Physical Memory:
16213 MiB
Label Icon

Model:
Intel(R) Core(TM) i5-4670 CPU @ 3.40GHz
Label Icon

Average Load:
0.17 0.28 0.25
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
What's in /var/log/middlewared.log?
 

stephenreda

Dabbler
Joined
Oct 28, 2012
Messages
29
While clickimg on the FTP enable toggle: tail -f /var/log/middlewared.log
[2020/06/25 22:40:37] (DEBUG) ServiceService._simplecmd():287 - Calling: start(ftp)
[2020/06/25 22:40:37] (DEBUG) EtcService.generate():275 - No new changes for /etc/local/proftpd.conf
[2020/06/25 22:40:37] (WARNING) ServiceService._system():309 - Command '/usr/sbin/service proftpd onestart ' failed with code 1: b"Starting proftpd.\n2020-06-25 22:40:37,365 freenas.local proftpd[57777]: mod_ctrls/0.9.5: error: unable to bind to local socket: Address already in use\n2020-06-25 22:40:37,365 freenas.local proftpd[57777]: fatal: SyslogFacility: unable to open syslog: No such file or directory on line 12 of '/usr/local/etc/proftpd.conf'\n/usr/local/etc/rc.d/proftpd: WARNING: failed to start proftpd\n"

However, root@freenas:~ # service ftpd onestatus
ftpd is not running.

And these are listening ports, sockstat -4 -l -P TCP
USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS
root uwsgi-3.7 1403 3 tcp4 127.0.0.1:9042 *:*
root uwsgi-3.7 1324 3 tcp4 127.0.0.1:9042 *:*
root cnid_metad 1265 4 tcp4 127.0.0.1:4700 *:*
root afpd 1264 8 tcp46 *:548 *:*
www nginx 1247 6 tcp4 192.168.1.100:443 *:*
www nginx 1247 8 tcp4 192.168.1.100:80 *:*
root nginx 1246 6 tcp4 192.168.1.100:443 *:*
root nginx 1246 8 tcp4 192.168.1.100:80 *:*
root sshd 1242 4 tcp4 *:22 *:*
root smbd 1201 34 tcp4 *:445 *:*
root smbd 1201 35 tcp4 *:139 *:*
daemon python3.7 1139 9 tcp4 192.168.1.100:5357 *:*
root rpc.statd 1120 7 tcp4 *:803 *:*
root nfsd 1116 5 tcp4 *:2049 *:*
root mountd 1110 8 tcp4 *:781 *:*
root rpcbind 964 11 tcp4 *:111 *:*
root python3.7 79 56 tcp4 *:6000 *:*
? ? ? ? tcp4 *:601 *:*

And the config cat /usr/local/etc/proftpd.conf
ServerName "freenas FTP Server"
ServerType standalone
DefaultServer on
DefaultAddress localhost
UseIPv6 on
Port 21
User nobody
Group nogroup
Umask 066 022
SyslogFacility ftp
MultilineRFC2228 off
DisplayLogin /var/run/proftpd/proftpd.motd
DeferWelcome off
TimeoutIdle 600
TimeoutLogin 300
TimeoutNoTransfer 300
TimeoutStalled 3600
MaxInstances none
MaxClients 5
MaxLoginAttempts 1
DefaultTransferMode ascii
AllowForeignAddress off
IdentLookups off
UseReverseDNS off

<Limit LOGIN>
AllowGroup ftp
AllowGroup wheel
DenyAll
</Limit>

<Global>
RequireValidShell off
DefaultRoot ~ !wheel
RootLogin on
AllowOverwrite on
DeleteAbortedStores off
TimesGMT off
</Global>


<IfModule mod_ban.c>
BanEngine off
BanControlsACLs all allow group wheel
BanLog /var/log/proftpd/ban.log
BanMessage Host %a has been banned
# -m "mod_ban/rule"
# -v "concat(' BanOnEvent ',event,' ',occurrence,'/',timeinterval,' ',expire)" -n
# -b
BanTable /var/run/proftpd/ban.tab
</IfModule>



<IfModule mod_delay.c>
DelayEngine on
DelayTable /var/run/proftpd/proftpd.delay
</IfModule>

<IfModule mod_wrap.c>
TCPAccessFiles "/etc/hosts.allow" "/etc/hosts.deny"
TCPAccessSyslogLevels info warn
TCPServiceName ftpd
</ifModule>
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
OK, it's choking on the directive SyslogFacility ftp. Do you have a file /usr/local/etc/syslog-ng.conf.freenas, containing lines relevant to ftp? grep ftp /usr/local/etc/syslog-ng.conf.freenas should show:

Code:
filter f_ftp { facility(ftp); };
# ftp.info                                              /var/log/xferlog
log { source(src); filter(f_ftp); destination(xferlog); };


And syslog should be running: pgrep -fl syslog-ng. Also check if /var/log/xferlog exists. (Note the forum spell checker is messing with the capitalization of freenas in the file name. The file name is all lower case.)
 
Last edited:

stephenreda

Dabbler
Joined
Oct 28, 2012
Messages
29
grep ftp /usr/local/etc/syslog-ng.conf.FreeNAS
grep: /usr/local/etc/syslog-ng.conf.FreeNAS: No such file or directory


pgrep -fl syslog-ng
- no output here

cat var/log/xferlog
cat: var/log/xferlog: No such file or directory
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Looks like your installation is damaged, and syslog-ng got whacked. How does your boot pool look? zpool status -v freenas-boot
 

stephenreda

Dabbler
Joined
Oct 28, 2012
Messages
29
zpool status -v freenas-boot
pool: freenas-boot
state: ONLINE
scan: scrub repaired 0 in 0 days 00:10:48 with 0 errors on Wed Jun 24 03:55:48 2020
config:
NAME STATE READ WRITE CKSUM
freenas-boot ONLINE 0 0 0
da0p2 ONLINE 0 0 0
errors: No known data errors
 

stephenreda

Dabbler
Joined
Oct 28, 2012
Messages
29
sorry @Samuel Tai didn;t notice the caps like you mentioned

grep ftp /usr/local/etc/syslog-ng.conf.freenas
filter f_ftp { facility(ftp); };
# ftp.info /var/log/xferlog
log { source(src); filter(f_ftp); destination(xferlog); };
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
OK, then try /usr/local/etc/rc.d/syslog-ng start. This should be launched automatically at boot, but syslog-ng died for some reason. After that, try pgrep -fl syslog-ng again, to verify it's running. Also, above you used var/log/xferlog, not /var/log/xferlog.
 

stephenreda

Dabbler
Joined
Oct 28, 2012
Messages
29
root@freenas:~ # /usr/local/etc/rc.d/syslog-ng start
Starting syslog_ng.
iv_tls_user_register: called after iv_init
/usr/local/etc/rc.d/syslog-ng: WARNING: failed to start syslog_ng
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
You'll have to reboot to see if it starts then.
 

stephenreda

Dabbler
Joined
Oct 28, 2012
Messages
29
unfortunately no change..
same error for syslog-ng, not running at all

root@freenas:~ # syslog-ng --version
syslog-ng 3 (3.23.1)
Config version: 3.23
Installer-Version: 3.23.1
Revision:
Compile-Date: Jun 1 2020 20:18:18
Module-Directory: /usr/local/lib/syslog-ng
Module-Path: /usr/local/lib/syslog-ng
Include-Path: /usr/local/share/syslog-ng/include
Segmentation fault (core dumped)
root@freenas:~ #
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Is 11.3-U3.2 your only boot environment, or did you upgrade from an earlier version? Your 11.3 installation has become corrupt. If you upgraded, you could reboot back into the older version, delete the 11.3 boot environment, and upgrade again. If not, then you're looking at a reinstall. Save your config with password secret seed and pool encryption keys before reinstalling, and upload the saved config after you've rebooted back into the fresh install.

What are you using as boot media?
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Are you using a thumb drive as your boot disk? These are notorious for corrupting themselves silently.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Unfortunately, thumb drives don't last long under ZFS's constant writes. You should switch to something like this:


attached to

 
Top