Closed Irkhar closed 1 year ago
Hey there,
I have the same problem with the app (Version 3.1.0). As soon as I enable the app, my log file gets spammed with these log messages (16 messages/second).
Nextcloud 19.0.8
Error: Undefined offset: 1 at /var/www/nextcloud/apps/limit_login_to_ip/lib/LoginHookListener.php#65
/var/www/nextcloud/apps/limit_login_to_ip/lib/LoginHookListener.php - line 65: OC\Log\ErrorHandler::onError(8, "Undefined offset: 1", "/var/www/ne ... p", 65, { ip: "172.XXX. ... "})
/var/www/nextcloud/apps/limit_login_to_ip/lib/LoginHookListener.php - line 120: OCA\LimitLoginToIp\LoginHookListener->matchCidr("172.XXX.XXX.XXX", "")
/var/www/nextcloud/apps/limit_login_to_ip/appinfo/app.php - line 40: OCA\LimitLoginToIp\LoginHookListener->isLoginAllowed()
/var/www/nextcloud/lib/private/legacy/OC_App.php - line 266: require_once("/var/www/ne ... p")
/var/www/nextcloud/lib/private/legacy/OC_App.php - line 155: OC_App::requireAppFile("limit_login_to_ip")
/var/www/nextcloud/lib/private/legacy/OC_App.php - line 128: OC_App::loadApp("limit_login_to_ip")
/var/www/nextcloud/lib/base.php - line 995: OC_App::loadApps()
/var/www/nextcloud/index.php - line 37: OC::handleRequest()
Hi, i have the same problem:
PHP Error: Undefined offset: 1 at /is/htdocs/xxx/www/nc/apps/limit_login_to_ip/lib/LoginHookListener.php#65
NC: 21.0.0 App: 3.1.0
I'm facing the same issue. Any update for this?
It seems to fail here:
56 /**
57 * @param $ip
58 * @param $range
59 * @return bool
60 * @copyright https://stackoverflow.com/questions/594112/matching-an-ip-to-a-cidr-mask-in-php-5/594134#594134
61 * @copyright (IPv4) https://stackoverflow.com/questions/594112/matching-an-ip-to-a-cidr-mask-in-php-5/594134#594134
62 * @copyright (IPv6) MW. https://stackoverflow.com/questions/7951061/matching-ipv6-address-to-a-cidr-subnet via
63 */
64 private function matchCidr($ip, $range) {
65 list($subnet, $bits) = explode('/', $range);
Which is the code from stackoverflow (at least the 1st one above).
How can this be debugged nicely?
Hi, i have the same problem:
PHP Error: Undefined offset: 1 at [nc dir]/apps/limit_login_to_ip/lib/LoginHookListener.php#65
NC: 21.0.2
Solution: I have removed the ip restriction in the security section
This error seems to be caused by having an invalid entry under Security -> Restrict login to IP ranges Make sure you have no empty lines or non CIDR entries.
I deleted the entry with an empty IP address and it no longer reports an error in the logs. Thank you
This issue should be fixed in new version (v4.0.0-beta1
). Feel free to reopen if needed :)
After updating to version 3.1.0, I have such errors in the log. I am asking for help in solving the problem.
Nextcloud 19.0.6
`[PHP] Error: Error: Undefined offset: 1 at /var/www/nextcloud/apps/limit_login_to_ip/lib/LoginHookListener.php#65 at <>