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

Internal server error on AdminProcessManagment in new session. #3845

Closed
svenoe opened this issue Sep 30, 2024 · 6 comments
Closed

Internal server error on AdminProcessManagment in new session. #3845

svenoe opened this issue Sep 30, 2024 · 6 comments
Assignees
Labels
bug Something isn't working as intended
Milestone

Comments

@svenoe
Copy link
Contributor

svenoe commented Sep 30, 2024

Please try to reproduce on OTOBO 11.0 but see, whether older versions are affected:

  1. Log into OTOBO, go to AdminProcessManagement and open a process.
  2. In another tab remove your session in the session management and login again (to start a new session).
  3. In the first tab directly clock on "new activity"

To my understanding from looking at the code this leads to an undefined ScreensPath:

$Self->{ScreensPath} = $Kernel::OM->Get('Kernel::System::JSON')->Decode(
Data => $SessionData{ProcessManagementScreensPath}
);

And a following

Modification of non-creatable array value attempted, subscript -1 at /opt/otobo/bin/psgi-bin/../../Kernel/Modules/AdminProcessManagementActivity.pm line 672.

in:

if ( $Self->{ScreensPath}->[-1]->{Action} eq 'AdminProcessManagement' ) {

@svenoe svenoe added the bug Something isn't working as intended label Sep 30, 2024
@svenoe svenoe added this to the OTOBO 10.0.23 milestone Sep 30, 2024
@MichaelThumes
Copy link
Contributor

MichaelThumes commented Jan 7, 2025

replicated on ov276 for rel-11_0

Modification of non-creatable array value attempted, subscript -1 at /home/VirtualOTOBO/ov276/bin/psgi-bin/../../Kernel/Modules/AdminProcessManagementActivity.pm line 672

@MichaelThumes MichaelThumes self-assigned this Jan 7, 2025
@bschmalhofer
Copy link
Contributor

perldoc perldiag says:

    Modification of non-creatable array value attempted, %s
        (F) You tried to make an array value spring into existence, and the
        subscript was probably negative, even counting from end of the array
        backwards.

So $Self->{ScreensPath} is either not a reference to an array or a reference to an empty array.

@MichaelThumes
Copy link
Contributor

replicated on 10_0 - Internal Server Error (looks different, probably custom error page instead of default, but nonetheless same Internal Server Error):

Modification of non-creatable array value attempted, subscript -1 at /opt/otobo/bin/psgi-bin/../../Kernel/Modules/AdminProcessManagementActivity.pm line 673.

@MichaelThumes
Copy link
Contributor

https://github.com/RotherOSS/otobo/blob/rel-10_0/Kernel/Modules/AdminProcessManagementActivity.pm#L49

    my %SessionData = $Kernel::OM->Get('Kernel::System::AuthSession')->GetSessionIDData(
        SessionID => $Self->{SessionID},
    );

    # convert JSON string to array
    $Self->{ScreensPath} = $Kernel::OM->Get('Kernel::System::JSON')->Decode(
        Data => $SessionData{ProcessManagementScreensPath}
    );

At this point - if Session got killed/renewed in between - %SessionData will simply NOT hold a ProcessManagementScreensPath Hash key, causing the attempt to JSON decode to fail, resulting in $Self->{ScreensPath} being set to undefined. Treating it as an Array-Reference later on leads to the error msg reported.

Strategies:

  • either display proper error message or
  • reload parent frame and close popup

@stefanhaerter
Copy link
Contributor

The bug described in #4100 actually relates to the changes made for this issue in #4026. Initially, the EntityID is an empty string for newly created activities, therefor the _GetActivityConfig() 'fails'. The new EntityID is only created afterwards, implying the necessity to fetch the activity config again.

@stefanhaerter
Copy link
Contributor

closing the issue with merged #4101

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as intended
Projects
None yet
Development

No branches or pull requests

4 participants