nebulo Posted October 23, 2023 Share Posted October 23, 2023 Hello everybody, I am creating a nightly export of the froxlor-settings using a cronjob: /var/www/html/froxlor/bin/froxlor-cli froxlor:api-call froxlor Froxlor.exportSettings > /var/customers/froxlor-settings.backup.json Unfortunately today I recognized the file just contains: Internal PHP error: #2 Undefined array key "groups" Any idea what could be the reason for this? Link to comment Share on other sites More sharing options...
0 d00p Posted October 23, 2023 Share Posted October 23, 2023 is "froxlor" an admin-user in your froxlor installation? Link to comment Share on other sites More sharing options...
0 d00p Posted October 23, 2023 Share Posted October 23, 2023 # bin/froxlor-cli froxlor:api-call admin Froxlor.exportSettings { "data": "{....}" } works just fine with an existing admin-user.... Link to comment Share on other sites More sharing options...
0 nebulo Posted October 23, 2023 Author Share Posted October 23, 2023 5 minutes ago, d00p said: is "froxlor" an admin-user in your froxlor installation? Yes froxlor is actually the admin-user. I am pretty sure that it worked in the past. Link to comment Share on other sites More sharing options...
0 nebulo Posted October 23, 2023 Author Share Posted October 23, 2023 It looks like it is working again. I suspect it works after I've created an export via the WebUI which worked immediately. I'll keep an eye on this. Link to comment Share on other sites More sharing options...
0 d00p Posted October 23, 2023 Share Posted October 23, 2023 that's unlikely to be the cause. Any custom files in froxlor/actions/admin/settings? Because they all return an array starting with index 'groups' Link to comment Share on other sites More sharing options...
0 nebulo Posted October 24, 2023 Author Share Posted October 24, 2023 No I don't have any custom files in 15 hours ago, d00p said: froxlor/actions/admin/settings The issue is that it doesn't work if the command is not executed from withhin the froxlor-base directory even if the path to the froxlor-cli is absolute. Link to comment Share on other sites More sharing options...
0 d00p Posted October 24, 2023 Share Posted October 24, 2023 Okay, that's something we can fix, thanks for noticing Link to comment Share on other sites More sharing options...
0 d00p Posted October 24, 2023 Share Posted October 24, 2023 if you want, try the following patch, it should resolve the behavior: diff --git a/lib/Froxlor/SImExporter.php b/lib/Froxlor/SImExporter.php index a40e24bb..f823f295 100644 --- a/lib/Froxlor/SImExporter.php +++ b/lib/Froxlor/SImExporter.php @@ -65,7 +65,7 @@ class SImExporter public static function export() { $settings_definitions = []; - foreach (PhpHelper::loadConfigArrayDir('./actions/admin/settings/')['groups'] as $group) { + foreach (PhpHelper::loadConfigArrayDir(Froxlor::getInstallDir() . '/actions/admin/settings/')['groups'] as $group) { foreach ($group['fields'] as $field) { $settings_definitions[$field['settinggroup']][$field['varname']] = $field; } Link to comment Share on other sites More sharing options...
Question
nebulo
Hello everybody,
I am creating a nightly export of the froxlor-settings using a cronjob:
/var/www/html/froxlor/bin/froxlor-cli froxlor:api-call froxlor Froxlor.exportSettings > /var/customers/froxlor-settings.backup.json
Unfortunately today I recognized the file just contains:
Internal PHP error: #2 Undefined array key "groups"
Any idea what could be the reason for this?
Link to comment
Share on other sites
8 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now