Skip to content

fix: os runtime php update-setting silently fails when adding a setting that does not exist #330

Description

@alehostert

Static Badge

Summary

The os runtime php update-setting command looks like it only modifies settings that already exist in the phpIniOverride block. When the setting does not exist, the command returns "status": "success" without inserting it, creating a false impression that the operation succeeded.

Steps to reproduce

  1. Update an EXISTING setting — works correctly
root@f2ccb3e81c08:/infinite# grep session.gc_maxlifetime /app/conf/php-webserver/primary.conf
php_value session.gc_maxlifetime 1800

root@f2ccb3e81c08:/infinite# os runtime php update-setting --name session.gc_maxlifetime --value 1440 --version 8.2
{
  "status": "success",
  "body": "PhpConfigsUpdated",
  "readableMessage": ""
}

root@f2ccb3e81c08:/infinite# grep session.gc_maxlifetime /app/conf/php-webserver/primary.conf
php_value session.gc_maxlifetime 1440
# Result: setting updated from 1800 to 1440 ✅
  1. Add a NON-EXISTENT setting — returns success but does nothing
root@f2ccb3e81c08:/infinite# grep session.gc_probability /app/conf/php-webserver/primary.conf
root@f2ccb3e81c08:/infinite# 
root@f2ccb3e81c08:/infinite# os runtime php update-setting --name session.gc_probability --value 1 --version 8.2
{
  "status": "success",
  "body": "PhpConfigsUpdated",
  "readableMessage": ""
}
  1. Verify — setting was not added
root@f2ccb3e81c08:/infinite# grep session.gc_probability /app/conf/php-webserver/primary.conf
root@f2ccb3e81c08:/infinite# 

Expected behavior

  • If the setting does not exist in phpIniOverride: insert the new php_value line
  • If the setting exists: update the value
  • If the operation cannot be completed: return an explicit error instead of "status": success

Impact

Operators relying on update-setting to apply configuration changes may believe the fix was applied when it was not. This leads to unresolved issues persisting in production without any indication of failure.

Related: goinfinite/os-services#73session.gc_probability missing from default phpIniOverride template

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    approved

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions