Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non Standard Moosh Error Handling #471

Open
nobicycle opened this issue May 8, 2024 · 0 comments
Open

Non Standard Moosh Error Handling #471

nobicycle opened this issue May 8, 2024 · 0 comments

Comments

@nobicycle
Copy link

  • moosh version:1.21
  • moodle version:4.40
    • database:mariadbd Ver 11.3.2-MariaDB for Linux on x86_64 (Arch Linux)
  • php version:PHP 8.2.16 (fpm-fcgi) (built: Mar 3 2024 08:26:22)
  • operating system:Linux tower 6.6.26-1-MANJARO Install plugin command #1 SMP PREEMPT_DYNAMIC Wed Apr 10 20:11:08 UTC 2024 x86_64 GNU/Linux

Actual behaviour

`[http@tower moodle]$ moosh category-list 2>/dev/null

Notice: session_start(): Redis connection not available in /srv/http/moosh/moosh.php on line 297

Warning: session_start(): Session cookie cannot be sent after headers have already been sent (output started at /srv/http/moosh/moosh.php:297) in /srv/http/moosh/moosh.php on line 297

Warning: session_start(): Redis connection not available in /srv/http/moosh/moosh.php on line 297

Warning: session_start(): Failed to read session data: redis (path: tcp://192.168.1.100:?auth=) in /srv/http/moosh/moosh.php on line 297

Warning: session_regenerate_id(): Session ID cannot be regenerated when there is no active session in /srv/http/moodle/lib/classes/session/manager.php on line 621
id name idnumber description parent visible

Deprecated: str_pad(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/http/moosh/Moosh/Command/Moodle39/Category/CategoryList.php on line 81

Deprecated: str_pad(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/http/moosh/Moosh/Command/Moodle39/Category/CategoryList.php on line 81
1 Category 1 Top 1
`

Expected behaviour

[http@tower moodle]$ moosh category-list 2>&1 
1              Category 1                                   Top            1              

The errors should be redirected.

Note: they are redirected for some commands. eg.:
http@tower moodle]$ moosh --list-commands PHP Warning: Invalid "upload_max_filesize" setting. Invalid quantity "20M post_max_sizeM", interpreting as "20M" for backwards compatibility in Unknown on line 0 activity-add activity-config-set activity-delete activity-move admin-login admin-remove-orphaned-modules

moosh --list-commands >/dev/null will not show the PHP error

Steps to reproduce

Put a config error in php.ini.
Then
$ moosh category-list 2>/dev/null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant