Oli Kessler
2017-05-18 12:39:06 UTC
Hi all
We got strange errors recently with SFTP transfers:
* All users are in a postgreSQL DB
* A user has a quota of 100 MB (mod_quotatab_sql)
* In an authenticated session, the user uploads a file test1.bin of 60 MB successfully
* The user then uploads a file test2.bin of 50 MB which is denied correctly (quota issue)
* The user uploads the first file test1.bin again (trying to overwrite), gets denied when the 100MB is reached due to the temporary file
* Repeating the former process 4 to 5 times results in a server error and disconnection and leaves the temporary file ".in.test1.bin." in the directory * subsequent sessions can not upload/overwrite this file again due to the temporary file
The errors are (error log):
ProFTPD terminating (signal 11)
mod_sql/4.3: unrecoverable backend error: (mod_sql_postgres/4.0.4) could not look up local user ID 1001: No such file or directory#012
mod_sql/4.3: check the SQLLogFile for more details
In the STP log:
2017-05-17 18:04:58,843 mod_sftp/0.9.9[19535]: error writing to '/.in.test1.bin.': Operation not permitted
2017-05-17 18:05:08,497 mod_sftp/0.9.9[19535]: + Session key exchange: ecdh-sha2-nistp256
2017-05-17 18:05:08,497 mod_sftp/0.9.9[19535]: + Session server hostkey: ssh-dss
2017-05-17 18:05:08,497 mod_sftp/0.9.9[19535]: + Session client-to-server encryption: aes128-ctr
2017-05-17 18:05:08,497 mod_sftp/0.9.9[19535]: + Session server-to-client encryption: aes128-ctr
2017-05-17 18:05:08,497 mod_sftp/0.9.9[19535]: + Session client-to-server MAC: hmac-md5
2017-05-17 18:05:08,497 mod_sftp/0.9.9[19535]: + Session server-to-client MAC: hmac-md5
2017-05-17 18:05:08,497 mod_sftp/0.9.9[19535]: + Session client-to-server compression: none
2017-05-17 18:05:08,497 mod_sftp/0.9.9[19535]: + Session server-to-client compression: none
2017-05-17 18:05:08,503 mod_sftp/0.9.9[19535]: aborting 1 unclosed file handle
There is no information in the SQLLogFile about any errors, just normal lookups for users, logging to the DB etc.
I did not find the string "could not look up local user ID" in the sources of mod_sql or mod_sql_postgres.
Any ideas what this error "could not look up local user ID 1001: No such file or directory#012" means and where it comes from?
Cheers
-ok
$> proftpd -V
Compile-time Settings:
Version: 1.3.5d (maint)
Platform: LINUX [Linux 3.13.0-112-generic x86_64]
Built: Wed Feb 15 2017 14:49:06 CET
Built With:
configure '--prefix=/opt/cargo' '--enable-auth-pam=no' '--disable-ident' '--enable-facl' '--enable-cap' '--enable-nls' '--enable-shared=no' '--enable-static=yes' '--enable-dso=no' '--enable-openssl' '--enable-ctrls' '--enable-timeout-idle=300' '--enable-timeout-stalled=1800' '--enable-pcre' '--with-modules=mod_charset:mod_sql:mod_sftp_sql:mod_sftp:mod_sql_postgres:mod_quotatab:mod_quotatab_sql:mod_unique_id:mod_tls:mod_wrap2:mod_wrap2_sql:mod_sql_passwd:mod_ctrls_admin:mod_ban:mod_clamav:mod_diskuse:mod_exec:mod_deflate:mod_snmp:mod_copy:mod_geoip:mod_ifsession' 'CC=cc' 'CFLAGS=-fstack-protector-all'
CFLAGS: -fstack-protector-all -Wall
LDFLAGS: -L$(top_srcdir)/lib -L/usr/lib
LIBS: -lpcreposix -lpcre -lssl -lcrypto -lssl -lcrypto -lcap -lGeoIP -lssl -lm -lpq -lcrypto -lz -lsupp -lcrypt -ldl
Files:
Configuration File:
/opt/cargo/etc/proftpd.conf
Pid File:
/var/run/proftpd.pid
Scoreboard File:
/opt/cargo/var/proftpd.scoreboard
Features:
- Autoshadow support
+ Controls support
+ curses support
- Developer support
- DSO support
+ IPv6 support
+ Largefile support
- Lastlog support
- Memcache support
+ ncurses support
+ NLS support
+ OpenSSL support
+ PCRE support
+ POSIX ACL support
+ Shadow file support
+ Sendfile support
+ Trace support
Tunable Options:
PR_TUNABLE_BUFFER_SIZE = 1024
PR_TUNABLE_DEFAULT_RCVBUFSZ = 8192
PR_TUNABLE_DEFAULT_SNDBUFSZ = 8192
PR_TUNABLE_GLOBBING_MAX_MATCHES = 100000
PR_TUNABLE_GLOBBING_MAX_RECURSION = 8
PR_TUNABLE_HASH_TABLE_SIZE = 40
PR_TUNABLE_NEW_POOL_SIZE = 512
PR_TUNABLE_SCOREBOARD_BUFFER_SIZE = 80
PR_TUNABLE_SCOREBOARD_SCRUB_TIMER = 30
PR_TUNABLE_SELECT_TIMEOUT = 30
PR_TUNABLE_TIMEOUTIDENT = 10
PR_TUNABLE_TIMEOUTIDLE = 300
PR_TUNABLE_TIMEOUTLINGER = 30
PR_TUNABLE_TIMEOUTLOGIN = 300
PR_TUNABLE_TIMEOUTNOXFER = 300
PR_TUNABLE_TIMEOUTSTALLED = 1800
PR_TUNABLE_XFER_SCOREBOARD_UPDATES = 10
We got strange errors recently with SFTP transfers:
* All users are in a postgreSQL DB
* A user has a quota of 100 MB (mod_quotatab_sql)
* In an authenticated session, the user uploads a file test1.bin of 60 MB successfully
* The user then uploads a file test2.bin of 50 MB which is denied correctly (quota issue)
* The user uploads the first file test1.bin again (trying to overwrite), gets denied when the 100MB is reached due to the temporary file
* Repeating the former process 4 to 5 times results in a server error and disconnection and leaves the temporary file ".in.test1.bin." in the directory * subsequent sessions can not upload/overwrite this file again due to the temporary file
The errors are (error log):
ProFTPD terminating (signal 11)
mod_sql/4.3: unrecoverable backend error: (mod_sql_postgres/4.0.4) could not look up local user ID 1001: No such file or directory#012
mod_sql/4.3: check the SQLLogFile for more details
In the STP log:
2017-05-17 18:04:58,843 mod_sftp/0.9.9[19535]: error writing to '/.in.test1.bin.': Operation not permitted
2017-05-17 18:05:08,497 mod_sftp/0.9.9[19535]: + Session key exchange: ecdh-sha2-nistp256
2017-05-17 18:05:08,497 mod_sftp/0.9.9[19535]: + Session server hostkey: ssh-dss
2017-05-17 18:05:08,497 mod_sftp/0.9.9[19535]: + Session client-to-server encryption: aes128-ctr
2017-05-17 18:05:08,497 mod_sftp/0.9.9[19535]: + Session server-to-client encryption: aes128-ctr
2017-05-17 18:05:08,497 mod_sftp/0.9.9[19535]: + Session client-to-server MAC: hmac-md5
2017-05-17 18:05:08,497 mod_sftp/0.9.9[19535]: + Session server-to-client MAC: hmac-md5
2017-05-17 18:05:08,497 mod_sftp/0.9.9[19535]: + Session client-to-server compression: none
2017-05-17 18:05:08,497 mod_sftp/0.9.9[19535]: + Session server-to-client compression: none
2017-05-17 18:05:08,503 mod_sftp/0.9.9[19535]: aborting 1 unclosed file handle
There is no information in the SQLLogFile about any errors, just normal lookups for users, logging to the DB etc.
I did not find the string "could not look up local user ID" in the sources of mod_sql or mod_sql_postgres.
Any ideas what this error "could not look up local user ID 1001: No such file or directory#012" means and where it comes from?
Cheers
-ok
$> proftpd -V
Compile-time Settings:
Version: 1.3.5d (maint)
Platform: LINUX [Linux 3.13.0-112-generic x86_64]
Built: Wed Feb 15 2017 14:49:06 CET
Built With:
configure '--prefix=/opt/cargo' '--enable-auth-pam=no' '--disable-ident' '--enable-facl' '--enable-cap' '--enable-nls' '--enable-shared=no' '--enable-static=yes' '--enable-dso=no' '--enable-openssl' '--enable-ctrls' '--enable-timeout-idle=300' '--enable-timeout-stalled=1800' '--enable-pcre' '--with-modules=mod_charset:mod_sql:mod_sftp_sql:mod_sftp:mod_sql_postgres:mod_quotatab:mod_quotatab_sql:mod_unique_id:mod_tls:mod_wrap2:mod_wrap2_sql:mod_sql_passwd:mod_ctrls_admin:mod_ban:mod_clamav:mod_diskuse:mod_exec:mod_deflate:mod_snmp:mod_copy:mod_geoip:mod_ifsession' 'CC=cc' 'CFLAGS=-fstack-protector-all'
CFLAGS: -fstack-protector-all -Wall
LDFLAGS: -L$(top_srcdir)/lib -L/usr/lib
LIBS: -lpcreposix -lpcre -lssl -lcrypto -lssl -lcrypto -lcap -lGeoIP -lssl -lm -lpq -lcrypto -lz -lsupp -lcrypt -ldl
Files:
Configuration File:
/opt/cargo/etc/proftpd.conf
Pid File:
/var/run/proftpd.pid
Scoreboard File:
/opt/cargo/var/proftpd.scoreboard
Features:
- Autoshadow support
+ Controls support
+ curses support
- Developer support
- DSO support
+ IPv6 support
+ Largefile support
- Lastlog support
- Memcache support
+ ncurses support
+ NLS support
+ OpenSSL support
+ PCRE support
+ POSIX ACL support
+ Shadow file support
+ Sendfile support
+ Trace support
Tunable Options:
PR_TUNABLE_BUFFER_SIZE = 1024
PR_TUNABLE_DEFAULT_RCVBUFSZ = 8192
PR_TUNABLE_DEFAULT_SNDBUFSZ = 8192
PR_TUNABLE_GLOBBING_MAX_MATCHES = 100000
PR_TUNABLE_GLOBBING_MAX_RECURSION = 8
PR_TUNABLE_HASH_TABLE_SIZE = 40
PR_TUNABLE_NEW_POOL_SIZE = 512
PR_TUNABLE_SCOREBOARD_BUFFER_SIZE = 80
PR_TUNABLE_SCOREBOARD_SCRUB_TIMER = 30
PR_TUNABLE_SELECT_TIMEOUT = 30
PR_TUNABLE_TIMEOUTIDENT = 10
PR_TUNABLE_TIMEOUTIDLE = 300
PR_TUNABLE_TIMEOUTLINGER = 30
PR_TUNABLE_TIMEOUTLOGIN = 300
PR_TUNABLE_TIMEOUTNOXFER = 300
PR_TUNABLE_TIMEOUTSTALLED = 1800
PR_TUNABLE_XFER_SCOREBOARD_UPDATES = 10