NO JOY Unable to Perform Module Updates

Joined
Mar 10, 2025
Messages
26
Reaction score
2
When running almost any command that starts with "fwconsole ma", I encounter this error:

In modulefunctions.class.php line 215:
foreach() argument must be of type array|object, bool given

followed by what appears to be usage options for the moduleadmin command. Here is a screenshot of what the error looks like:

1793285144551.png

I run OS (Debian-based -- LMDE) and module updates once a day, and this is the first time I remember encountering this issue. Has anyone seen this before? Has the syntax for the command changed? Is something broken on my end?
 
I ran into this today working on a module.

I think I have pinpointed it to Clearly IP repo.

The error occurs when FreePBX retrieves security-advisory information from the ClearlyIP repository. The response contains an empty entry that FreePBX interprets as a boolean instead of a list. When FreePBX tries to process that value, it raises the “foreach() argument must be of type array|object, bool given” error.

Because Module Admin performs this check for different modules, the same repository-response problem can interrupt installations and updates across the system.

@wardmundy @Tonyclewis
 
If the error remains in the GUI, this will clear it out:


Bash:
php <<'PHP'
<?php
require '/etc/freepbx.conf';
$pdo = FreePBX::Database();
$row = $pdo->query("SELECT * FROM module_xml WHERE id='security'")
    ->fetch(PDO::FETCH_ASSOC);
$data = json_decode($row['data'] ?? '', true);

if (!is_array($data) || !array_key_exists('issue', $data) || $data['issue'] !== false) {
    exit("Cache does not contain the diagnosed value; nothing changed.\n");
}

umask(0077);
$backup = '/root/freepbx-security-cache-'.date('Ymd-His').'.json';
if (file_put_contents($backup, json_encode($row)) === false) {
    exit("Backup failed; nothing changed.\n");
}

$data['issue'] = [];
$stmt = $pdo->prepare("UPDATE module_xml SET data=? WHERE id='security'");
$stmt->execute([json_encode($data)]);
echo "Security cache repaired. Backup: $backup\n";
PHP
 

Forum statistics

Threads
26,849
Messages
175,526
Members
20,393
Latest member
dblumer
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top