Can't reload due to error in functions.inc.php line 4416

So re: this thread, I’ve done some more research and the snippet from the above referenced file seems to relate to this.

Any ideas why restoring my settings might cause a problem for this function?

What I’d really like to do is ‘reset’ FreePBX without reinstalling but I gather this is not possible?

Thanks

function core_hint_get($account){
        global $astman;
        static $hintCache;

        if (isset($hintCache[$account])) {
                return $hintCache[$account];
        }

        $chan_dahdi = ast_with_dahdi();
        // We should always check the AMPUSER in case they logged into a device
        // but we will fall back to the old methond if $astman not open although
        // I'm pretty sure everything else will puke anyhow if not running
        //
        if ($astman) {
                $device=$astman->database_get("AMPUSER",$account."/device");
                $device_arr = explode('&',$device);
                $sql = "SELECT dial, hint_override from devices where id in ('".implode("','",$device_arr)."')";
        } else {
                $sql = "SELECT dial, hint_override from devices where user = '{$account}'";
        }
        $results = sql($sql,"getAll",DB_FETCHMODE_ASSOC);

        //create an array of strings
        if (is_array($results)){
                foreach ($results as $result) {
                        $hint = !empty($result['hint_override']) ? $result['hint_override'] : $result['dial'];
                        if ($chan_dahdi) {
                                $dial[] = str_replace('ZAP', 'DAHDI', $hint);
                        } else {
                                $dial[] = $hint;
                        }
                }
        }

        //create a string with & delimiter
        if (isset($dial) && is_array($dial)){
                $hint = implode($dial,"&");
        } else {
                if (isset($results[0]['dial'])) {
                        $hint = $results[0]['dial'];
                } else {
                        $hint = null;
                }
        }

        $hintCache[$account] = $hint;
        return $hint;
}

If I delete ALL extensions I can get it to reload. If I try to recreate an extension I get the following error:

EDIT Think I sorted it. I rolled back Core a few versions, reinstated the backup, THEN upgraded Core.

I still think the backup that was taken of my system wasn’t a brilliant one - or there were difficulties instating it - there were quite a few gremlins I had to find. e.g. mysterious additional empty destinations on an IVR that were causing errors until deleted.

Thanks

The error is pretty clear. It can’t insert the device data because the column ‘hint_override’ isn’t found. Where version where you on, what version did you roll back to, what version did you upgrade to after the roll back?

I have that column in all my current boxes.

Yes I agree THAT error is pretty clear but I had to delete lots of settings in stages and attempt a reload after each one. THEN I had to attempt creating a new extension. Only then do you get the clear error. It seems FreePBX is SUPER fussy about versions. I gather they’re fixing this in version 15?
I’ve just noticed more settings which either weren’t backed up or can’t be restored. This time it’s a custom destination. Looks like I have my work cut out for me this morning! :wink:
Thanks Tom.

Why didn’t you provide any version information like I asked? I asked three specific questions and you failed to answer any of them.

Sorry Tom, I’ll reply with the info when I’m back at the machine in question. Have been at work all day and wrote my previous from work.
Just to be clear, I am now able to reload

Not sure - do you mean ‘Core’ or FreePBX itself? My backup manifest says:

[pbx_framework_version] 14.0.5.25 [backup_version] 14.0.5 [pbx_version] 14.0.5.25

Rolled back to 14.0.24

Went back to 14.0.25.4

That presumably allowed the upgrade script from 14.0.24 to 14.0.25.4 to add the column…

Similar error from System Recordings module when trying to add a recording, one which I can probably also resolve by rolling back to 13.0.30.6 (at a wild guess) and then rolling forward to 13.0.30.13


Am just wondering if my system is now going to be plagued forevermore by such gremlins! :joy::sweat_smile:
@mmishra I’m guessing that the effort is going into FreePBX 15’s backup/restore module rather than FreePBX 14’s at this point?
Thanks :smiley:

seems similar to:

Is this the official distro?

It’s FreePBX 14.0.13.4 running on a Pi

How did you install FreePBX that might be the answer to a lot of your issues.

Also, how did you end up getting all these errors, you restored a backup?

Hi PitzKey - I used the RasPBX image. No doubt that was stupid. However, my system is fully up to date and there are no warnings or errors showing in the dash or “module admin” or anywhere like that.

I got the errors from restoring from a backup. I suspect my backup was made on a FreePBX where a few of the modules were a couple of versions behind what is now current, perhaps, and then when I restored from the backup I got a lot of moaning from the system about missing database columns etc. I think the FreePBX team are aware of the issues with the backup/restore in 14, hence prioritising it for 15.

At the moment I (think) I’ve resolved my outstanding issues my performing selective roll backs and upgrades when issues crop up.

Thanks for your time and assistance. :slight_smile:

You seem to have some commercially dependant modules in the backup source.

You can fix mariadb tables with an ALTER statement.

pi Debian’s don’t process rc.local by default , look for a “freepbx.service” solution and enable it, it wraps fwconsole .

You restored from the official distro to a RasPBX?

Nope, RasPBX to RasPBX :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.