Go to ../roundcubedir/config, edit your config.inc.php and enable all logging
// ----------------------------------
// LOGGING/DEBUGGING
// ----------------------------------
// system error reporting, sum of: 1 = log; 4 = show, 8 = trace
$config['debug_level'] = 8;
// Log sent messages to <log_dir>/sendmail or to syslog
$config['smtp_log'] = true;
// Log successful logins to <log_dir>/userlogins or to syslog
$config['log_logins'] = true;
// Log session authentication errors to <log_dir>/session or to syslog
$config['log_session'] = true;
// Log SQL queries to <log_dir>/sql or to syslog
$config['sql_debug'] = true;
// Log IMAP conversation to <log_dir>/imap or to syslog
$config['imap_debug'] = true;
// Log SMTP conversation to <log_dir>/smtp or to syslog
$config['smtp_debug'] = true;
After that try to login and let´s have a look into the log files. A good advise: Also raise the log level in your imap server and dive into.
The error you posted above isn´t very accurate so we need more details.