OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Archive »
  • 15.1 Legacy Series »
  • [SOLVED] Captive Portal Error
« previous next »
  • Print
Pages: [1]

Author Topic: [SOLVED] Captive Portal Error  (Read 15086 times)

UGUR

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
    • View Profile
[SOLVED] Captive Portal Error
« on: June 15, 2015, 11:47:16 am »
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1 no such table: captiveportal_ip' in /usr/local/opnsense/mvc/app/models/OPNsense/CaptivePortal/DB.php:342 Stack trace: #0 [internal function]: PDO->prepare('select ip,pipen...') #1 /usr/local/opnsense/mvc/app/models/OPNsense/CaptivePortal/DB.php(342): Phalcon\Db\Adapter\Pdo->query('select ip,pipen...') #2 /usr/local/opnsense/mvc/app/models/OPNsense/CaptivePortal/CPClient.php(162): OPNsense\CaptivePortal\DB->listFixedIPs() #3 /usr/local/opnsense/mvc/app/models/OPNsense/CaptivePortal/CPClient.php(147): OPNsense\CaptivePortal\CPClient->refreshAllowedIPs(NULL) #4 /usr/local/opnsense/mvc/app/models/OPNsense/CaptivePortal/CPClient.php(107): OPNsense\CaptivePortal\CPClient->update() #5 /usr/local/etc/inc/captiveportal.inc(229): OPNsense\CaptivePortal\CPClient->reconfigure() #6 /usr/local/etc/inc/captiveportal.inc(337): captiveportal_init_rules(true) #7 /usr/local/www/services_captiveportal.php(386): captiveportal_configure() #8 {main} in /usr/local/opnsense/mvc/app/models/OPNsense/CaptivePortal/DB.php on line 342
« Last Edit: June 16, 2015, 07:16:39 pm by franco »
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 13679
  • Karma: 1176
    • View Profile
Re: Captive Portal Error
« Reply #1 on: June 15, 2015, 11:49:46 am »
Hi there,

Ad wrote the code, but he is on vacation this week. He'll look at this as soon as he is back.


Cheers,
Franco
Logged

remonboonstra

  • Newbie
  • *
  • Posts: 16
  • Karma: 3
    • View Profile
Re: Captive Portal Error
« Reply #2 on: June 16, 2015, 02:13:20 pm »
Same issue here.

Let me know, as I needed it this week :) -- broken m0n0wall server replacement
Ordered the appliance A10, mainly doing captive portal stuff.

Can I downgrade?

Thanks

Remon
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 13679
  • Karma: 1176
    • View Profile
Re: Captive Portal Error
« Reply #3 on: June 16, 2015, 02:57:10 pm »
Hi Remon,

downgrade to? I have no version information here, no info about when this started to happen or if it was working previously at all.

15.1.12 is coming out tomorrow. I'd rather have this pinned down before that happens.


Cheers,
Franco
Logged

remonboonstra

  • Newbie
  • *
  • Posts: 16
  • Karma: 3
    • View Profile
Re: Captive Portal Error
« Reply #4 on: June 16, 2015, 03:49:18 pm »
Hi Franco,

I can create a Captive Portal in disabled state, when enabling (without changing any setting on the form) it fails:

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1 no such table: captiveportal_ip' in /usr/local/opnsense/mvc/app/models/OPNsense/CaptivePortal/DB.php:342 Stack trace: #0 [internal function]: PDO->prepare('select ip,pipen...') #1 /usr/local/opnsense/mvc/app/models/OPNsense/CaptivePortal/DB.php(342): Phalcon\Db\Adapter\Pdo->query('select ip,pipen...') #2 /usr/local/opnsense/mvc/app/models/OPNsense/CaptivePortal/CPClient.php(162): OPNsense\CaptivePortal\DB->listFixedIPs() #3 /usr/local/opnsense/mvc/app/models/OPNsense/CaptivePortal/CPClient.php(147): OPNsense\CaptivePortal\CPClient->refreshAllowedIPs(NULL) #4 /usr/local/opnsense/mvc/app/models/OPNsense/CaptivePortal/CPClient.php(107): OPNsense\CaptivePortal\CPClient->update() #5 /usr/local/etc/inc/captiveportal.inc(229): OPNsense\CaptivePortal\CPClient->reconfigure() #6 /usr/local/etc/inc/captiveportal.inc(337): captiveportal_init_rules(true) #7 /usr/local/www/services_captiveportal_zones.php(47): captiveportal_configure() #8 {ma in /usr/local/opnsense/mvc/app/models/OPNsense/CaptivePortal/DB.php on line 342


Crash Reporter:

System Information:
FreeBSD 10.1-RELEASE-p10 #0 a5b56aa(master): Mon May 18 14:54:06 CEST 2015     root@sensey64:/usr/obj/usr/src/sys/SMP
OPNsense 15.1.11.4-d34b25558 (amd64)
OpenSSL 1.0.2b 11 Jun 2015

PHP Errors:
[16-Jun-2015 14:44:17 Europe/Amsterdam] PHP Fatal error:  Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1 no such table: captiveportal_ip' in /usr/local/opnsense/mvc/app/models/OPNsense/CaptivePortal/DB.php:342
Stack trace:
#0 [internal function]: PDO->prepare('select ip,pipen...')
#1 /usr/local/opnsense/mvc/app/models/OPNsense/CaptivePortal/DB.php(342): Phalcon\Db\Adapter\Pdo->query('select ip,pipen...')
#2 /usr/local/opnsense/mvc/app/models/OPNsense/CaptivePortal/CPClient.php(162): OPNsense\CaptivePortal\DB->listFixedIPs()
#3 /usr/local/opnsense/mvc/app/models/OPNsense/CaptivePortal/CPClient.php(147): OPNsense\CaptivePortal\CPClient->refreshAllowedIPs(NULL)
#4 /usr/local/opnsense/mvc/app/models/OPNsense/CaptivePortal/CPClient.php(107): OPNsense\CaptivePortal\CPClient->update()
#5 /usr/local/etc/inc/captiveportal.inc(229): OPNsense\CaptivePortal\CPClient->reconfigure()
#6 /usr/local/etc/inc/captiveportal.inc(337): captiveportal_init_rules(true)
#7 /usr/local/www/services_captiveportal.php(386): captiveportal_configure()
#8 {main}
  in /usr/local/opnsense/mvc/app/models/OPNsense/CaptivePortal/DB.php on line 342


Thank you!
Logged

Supermule

  • Full Member
  • ***
  • Posts: 223
  • Karma: 15
    • View Profile
Re: Captive Portal Error
« Reply #5 on: June 16, 2015, 04:13:55 pm »
Could this in any way be related to the seldom seen time zone error(NTP)??
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 13679
  • Karma: 1176
    • View Profile
Re: Captive Portal Error
« Reply #6 on: June 16, 2015, 06:19:42 pm »
Don't think so, this is brand new. I can see it now. Reporting back in a bit.
Logged

remonboonstra

  • Newbie
  • *
  • Posts: 16
  • Karma: 3
    • View Profile
Re: Captive Portal Error
« Reply #7 on: June 16, 2015, 06:57:17 pm »
Franco,

Thanks for checking this quick! Let me know if I need/can test anything!

Regard Remon
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 13679
  • Karma: 1176
    • View Profile
Re: Captive Portal Error
« Reply #8 on: June 16, 2015, 07:15:40 pm »
Hi Remon,

fixed, details see: https://github.com/opnsense/core/issues/215

Will be part of tomorrow's 15.1.12. If you want to test run these commands on the (ssh) shell of your OPNsense box:

# rm /var/db/captiveportal*.db
# cd /usr/local/opnsense/mvc/app/models/OPNsense/CaptivePortal/
# fetch https://raw.githubusercontent.com/opnsense/core/eac7cdde65742b5bd7529c767588843b28fd09a6/src/opnsense/mvc/app/models/OPNsense/CaptivePortal/DB.php

And simply retry in the GUI.

As far as the bug goes: PHP or Phalcon internals changed with a recent upgrade for PDO/Sqlite adapters, someone hardened against SQL injection,removing the database creation queries behind the first ";". Sorry about that.

Thanks for helping me to reproduce the error. :)


Cheers,
Franco
Logged

remonboonstra

  • Newbie
  • *
  • Posts: 16
  • Karma: 3
    • View Profile
Re: [SOLVED] Captive Portal Error
« Reply #9 on: June 16, 2015, 08:04:41 pm »
Franco,

Thank you, for the quick reply and the quick solution!
Tomorrow I will update to .12 , can't check today (sick).

Regards,
Remon
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 13679
  • Karma: 1176
    • View Profile
Re: [SOLVED] Captive Portal Error
« Reply #10 on: June 16, 2015, 08:05:19 pm »
Understood, get well soon!
Logged

remonboonstra

  • Newbie
  • *
  • Posts: 16
  • Karma: 3
    • View Profile
Re: [SOLVED] Captive Portal Error
« Reply #11 on: June 17, 2015, 01:08:21 pm »
Franco,

Thank you, it works (tested it manually as suggested).

Kind regards,

Remon
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • Archive »
  • 15.1 Legacy Series »
  • [SOLVED] Captive Portal Error
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2023 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2