erikdubbelboer / phpRedisAdmin

Simple web interface to manage Redis databases.
http://dubbelboer.com/phpRedisAdmin/
3.11k stars 666 forks source link

Error when switching server when non-available database is selected #89

Closed rikvdh closed 4 years ago

rikvdh commented 8 years ago

I have a server which has 2 databases configured (db 0 and db 1). When I select DB 1 and switch over to the other server which only has one database (db 0) an error is thrown in phpRedisAdmin

PHP Fatal error:  Uncaught exception 'Predis\\Response\\ServerException' with message 'ERR invalid DB index' in /var/www/html/phpredisadmin/vendor/predis/predis/src/Client.php:365
Stack trace:
#0 /var/www/html/phpredisadmin/vendor/predis/predis/src/Client.php(330): Predis\\Client->onErrorResponse(Object(Predis\\Command\\ConnectionSelect), Object(Predis\\Response\\Error))
#1 /var/www/html/phpredisadmin/vendor/predis/predis/src/Client.php(310): Predis\\Client->executeCommand(Object(Predis\\Command\\ConnectionSelect))
#2 /var/www/html/phpredisadmin/includes/common.inc.php(130): Predis\\Client->__call('select', Array)
#3 /var/www/html/phpredisadmin/includes/common.inc.php(130): Predis\\Client->select('1')
#4 /var/www/html/phpredisadmin/index.php(3): require_once('/var/www/html/p...')
#5 {main}
  thrown in /var/www/html/phpredisadmin/vendor/predis/predis/src/Client.php on line 365, referer: http://192.168.23.230/phpredisadmin/?overview&s=1&d=1