Project

General

Profile

Actions

Bug #14218

closed

Deleting a shellcmd entry results in a PHP error and crash report

Added by Chris W 12 months ago. Updated 12 months ago.

Status:
Resolved
Priority:
Normal
Category:
Shellcmd
Target version:
-
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
Affected Version:
Affected Plus Version:
23.01
Affected Architecture:

Description

1. Install the shellcmd package from System > Package Manager.

2. Services > shellcmd >
Command:

touch /tmp/file.txt

Shellcmd Type: shellcmd
Click Save

3. Save again.

4. Now trying to delete that entry results in the browser showing:

Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/shellcmd.inc:44 Stack trace: #0 /usr/local/www/pkg.php(142) : eval()'d code(1): shellcmd_delete_php_command() #1 /usr/local/www/pkg.php(142): eval() #2 {main} thrown in /usr/local/pkg/shellcmd.inc on line 44 PHP ERROR: Type: 1, File: /usr/local/pkg/shellcmd.inc, Line: 44, Message: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/shellcmd.inc:44 Stack trace: #0 /usr/local/www/pkg.php(142) : eval()'d code(1): shellcmd_delete_php_command() #1 /usr/local/www/pkg.php(142): eval() #2 {main} thrown

A crash report is then available on the dashboard with the contents:

[31-Mar-2023 15:19:48 America/Chicago] PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/shellcmd.inc:44
Stack trace:
#0 /usr/local/www/pkg.php(142) : eval()'d code(1): shellcmd_delete_php_command()
#1 /usr/local/www/pkg.php(142): eval()
#2 {main}
  thrown in /usr/local/pkg/shellcmd.inc on line 44

Actions #1

Updated by Chris W 12 months ago

  • Description updated (diff)
Actions #2

Updated by Christopher Cope 12 months ago

  • Status changed from New to Pull Request Review
Actions #3

Updated by Chris W 12 months ago

A diff of the merge request fixes the problem when applied as a system patch. Deleting a shellcmd job doesn't give any errors or other issues.

Actions #4

Updated by Jim Pingle 12 months ago

  • Status changed from Pull Request Review to Feedback
  • Assignee set to Christopher Cope
  • % Done changed from 0 to 100

MR merged

Actions #5

Updated by Danilo Zrenjanin 12 months ago

  • Status changed from Feedback to Resolved

Tested against:

Shellcmd    sysutils    1.0.5_3    

It looks good.

I am marking this ticket resolved.

Actions

Also available in: Atom PDF