Menu

r2247: Unable to add BYOD device

Help
Jay
2018-07-06
2018-09-27
  • Jay

    Jay - 2018-07-06

    Hi,

    This is on a fresh installation using build 2247. Adding users and vouchers works perfectly.

    However adding a BYOD device returns a "Failure Undefined " error

    This is what turns up in the error.log
    Error: [PDOException] SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'value' cannot be null

    This is what the Chrome debugger shows

    Form Data:

    name: ab-12-df-e3-4a-cd
    description: asd
    permanent_user_id: 249
    profile_id: 15
    data_cap_type: hard
    time_cap_type: hard
    active: active
    always_active: always_active
    token: 0cbe06ba-8225-42d5-9fa1-e19ea13da90d
    sel_language: 4_4
    

    Response: (too big to copy the entire thing here)

    [main] - ROOT/index.php, line 16</pre></div></pre>{
        "message": "SQLSTATE[23000]: Integrity constraint violation: 1048 Column \u0027value\u0027 cannot be null",
        "url": "\/devices\/add.json",
        "code": 500,
        "file": "\/usr\/share\/nginx\/html\/cake3\/rd_cake\/vendor\/cakephp\/cakephp\/src\/Database\/Statement\/MysqlStatement.php",
        "line": 39
    }
    

    Has anybody faced this before?

    Any help on this would be awesome

    Best Regards
    Jay

     
  • Jay

    Jay - 2018-07-09

    On digging further, found this in the error logs

    /usr/share/nginx/html/cake3/rd_cake/src/Model/Behavior/FreeRadiusBehavior.php(701): App\Model\Behavior\FreeRadiusBehavior->_add_radcheck_item('ae-12-32-45-fe-.
    ..', 'Rd-Device-Owner', NULL)
    

    For some reason Rd-Device-Owner is being set to NULL, although the form data clearly shows the right input.

    Can anyone help debugging this...?

    Thanks in advance

     
  • Jay

    Jay - 2018-07-12

    Found a temporary workaround by editing
    /usr/share/nginx/html/cake3/rd_cake/src/Model/Behavior/FreeRadiusBehavior.php

    Changed the line

    $this->_add_radcheck_item($username,'Rd-Device-Owner',$request->data['rd_device_owner']);
    

    to this

    $this->_add_radcheck_item($username,'Rd-Device-Owner','dummyuser');
    

    once the entry is created, its possible to change the owner to the correct user.

     
  • Michael Danuschenkov

    I decided to make this change in /usr/share/nginx/html/cake3/rd_cake/src/Model/Behavior/FreeRadiusBehavior.php to work

            //Michael 270918
            // FIX error on manual add new BYOD. Request has no 'rd_device_owner' value
            //$this->_add_radcheck_item($username,'Rd-Device-Owner',$request->data['rd_device_owner']);
            $this->_add_radcheck_item($username,'Rd-Device-Owner',$entity->rd_device_owner);
            //end Michael
    

    Problem is at $request = Router::getRequest(); dont has 'rd_device_owner' attribute.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.