Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 29th January 2007, 22:05
marsvin marsvin is offline
Junior Member
 
Join Date: Dec 2006
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Question proftpd and mysql: Protocol violation by server: blank line on control.

Hi guys,

I've just finished the proftpd howto but I haven't managed to get it working.

When I try to log in I get the following error message:
Code:
Protocol violation by server: blank line on control.
Remote host has closed the connection.
On the server side only one line shows up in the log: (I've hidden the ip and hostnames )
Code:
Jan 29 20:36:22 <hostname> proftpd[10031] <hostname> (::ffff:<ip>[::ffff:<ip>]): FTP session closed.
The only real difference between my setup and the howto's is the mysql server is not on the same server as the ftp but I've made sure the mysql server is reachable from the ftp server. mysql.log and mysql.err don't show anything at all.

Not sure what else I can check.. Any ideas would be much appreciated!

-- marsvin
Reply With Quote
Sponsored Links
  #2  
Old 30th January 2007, 12:38
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Quote:
Originally Posted by marsvin
Hi guys,

I've just finished the proftpd howto but I haven't managed to get it working.

When I try to log in I get the following error message:
Code:
Protocol violation by server: blank line on control.
Remote host has closed the connection.
Did you use the correct hostname (without ftp:// in the beginning)?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 30th January 2007, 12:48
marsvin marsvin is offline
Junior Member
 
Join Date: Dec 2006
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

After some more digging I came up with another error while debugging proftpd (using "proftpd -nd6").
Code:
localhost (123.123.123.123[123.123.123.123]) - FTP session requested from unknown class
Also it reports the following line in the configuration as deprecated:
Code:
SQLAuthenticate         users* groups*
Finally proftpd -l is supposed to show up mod_sql I think but in my case all it shows is
Code:
# proftpd -l
Compiled-in modules:
  mod_core.c
  mod_xfer.c
  mod_auth_unix.c
  mod_auth_file.c
  mod_auth.c
  mod_ls.c
  mod_log.c
  mod_site.c
  mod_delay.c
  mod_dso.c
  mod_auth_pam.c
  mod_readme.c
  mod_cap.c
  mod_ctrls.c

Last edited by marsvin; 30th January 2007 at 13:14.
Reply With Quote
  #4  
Old 30th January 2007, 12:50
marsvin marsvin is offline
Junior Member
 
Join Date: Dec 2006
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by falko
Did you use the correct hostname (without ftp:// in the beginning)?
Hi Falko,

I just missed your reply, yes I'm using ncftp -u <user> localhost to test the connection. I'm thinking I should try moving mysql to the same server as the ftp just to see if it has to do with the remote connection. I'll let you know what happens.

update: Installing mysql locally shows the exact same errors so it seems that's not the problem.

-- marsvin

Last edited by marsvin; 30th January 2007 at 12:57.
Reply With Quote
  #5  
Old 30th January 2007, 16:56
marsvin marsvin is offline
Junior Member
 
Join Date: Dec 2006
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I just found a way to get a more detailed error readout by adding the following line to proftpd.conf:
Code:
SQLLogFile /var/log/proftpd/mod_sql.log
Very surprisingly I got the following readout:
Code:
Jan 30 15:49:03 mod_sql/4.2.1[7358]: defaulting to 'postgres' backend
Jan 30 15:49:03 mod_sql/4.2.1[7358]: backend module 'mod_sql_postgres/4.02'
Jan 30 15:49:03 mod_sql/4.2.1[7358]: backend api    'mod_sql_api_v2'
Jan 30 15:49:03 mod_sql/4.2.1[7358]: >>> sql_sess_init
Jan 30 15:49:03 mod_sql/4.2.1[7358]: entering   postgres cmd_defineconnection
Jan 30 15:49:03 mod_sql/4.2.1[7358]:  name: 'default'
Jan 30 15:49:03 mod_sql/4.2.1[7358]:  user: 'proftpd'
Jan 30 15:49:03 mod_sql/4.2.1[7358]:  host: 'localhost'
Jan 30 15:49:03 mod_sql/4.2.1[7358]:    db: 'ftp'
Jan 30 15:49:03 mod_sql/4.2.1[7358]:  port: '5432'
Jan 30 15:49:03 mod_sql/4.2.1[7358]:   ttl: '0'
Jan 30 15:49:03 mod_sql/4.2.1[7358]: exiting    postgres cmd_defineconnection
Jan 30 15:49:03 mod_sql/4.2.1[7358]: entering   postgres cmd_open
Jan 30 15:49:03 mod_sql/4.2.1[7358]: exiting    postgres cmd_open
Jan 30 15:49:03 mod_sql/4.2.1[7358]: unrecoverable backend error
Jan 30 15:49:03 mod_sql/4.2.1[7358]: error: 'mod_sql_postgres/4.02'
Jan 30 15:49:03 mod_sql/4.2.1[7358]: message: 'could not connect to server: Connection refused
        Is the server running on host "localhost" and accepting
        TCP/IP connections on port 5432?
I was expecting a connect error or some misnamed table or something but it appears it's trying to connect using postgresql instead of mysql?

I double checked:
Code:
# aptitude show proftpd-pgsql
Package: proftpd-pgsql
New: yes
State: not installed
...

# aptitude show proftpd-mysql
Package: proftpd-mysql
New: yes
State: installed
...
Why would it be trying to connect using PostgreSQL?
Reply With Quote
  #6  
Old 30th January 2007, 18:39
marsvin marsvin is offline
Junior Member
 
Join Date: Dec 2006
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

Ok I found a "fix".. This isn't probably the best way to do it but I found editing the file /etc/proftpd/modules.conf and commenting out this line:
Code:
#LoadModule mod_sql_postgres.c
Makes proftpd default to mysql rather than postgres. I don't know why that line is even in there since I haven't installed the proftpd-pgsql package but at least it works now!

If anyone knows of a "cleaner" way to do this please feel free to clue me in
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Virtual Hosting With Proftpd And MySQL (Incl. Quota) miguellamerz HOWTO-Related Questions 3 18th October 2006 01:39
Virtual Hosting With Proftpd And MySQL Problems bigredgecko HOWTO-Related Questions 1 7th July 2006 12:56
Mysql Fatal error countzero Installation/Configuration 7 14th June 2006 00:23
First Login Error evbim Installation/Configuration 13 6th May 2006 12:19


All times are GMT +2. The time now is 16:21.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.