MODX Community

Code: -1 transaction aborted undefined - in Media Browser

I have taken over maintenance of a Modx website. I am new to Modex.

In the Admin, when going to Media --> Media Browser, there is a dely and then we get the error:
‘Code: -1 transaction aborted undefined’

We click OK and then try again. It works the 2nd time. The midea files are listed.

This error does not generate an entry in the log file.

Perhaps I am looking in the wrong log file? I know of only one log file.

Any suggestions?

Modx version: 2.7.3-pl
Hosting: A2 Hosting
Apache Version: 2.4.43
PHP Version: 7.3.17
|MySQL Version: 10.3.22-MariaDB-cll-lve
Architecture: x86_64
Operating System: linux

Probably a timeout.
What is the type of your default media source? ‘File system’ or ‘Amazon S3’?

Thanks for helping.
I do think it is a timeout.
I am using the local file system.
I check the log file after it happens but there is no entries at all around the time it happens.
Could there more log files I am not aware of?
I thought it could be permissions, but it works the 2nd time, so… not permissions.
I could be a session issue. Wrong permissions first try. Sessions is refreshed and the permissions are correct? I really don’t know.
Hard to debug without logs.

Darren

Maybe if you open the ‘Network’-Tab of the ‘Developer Tools’ in your browser, you can find out which AJAX-call exactly needs so much time to execute.

Do you have a lot of media-files in 1 directory? Maybe it helps if you could move them to different subfolders.

There are a lot of files in the first directory.

Good idea to try to find the AJAX call. Sorry I didn’t think of that. Here are the results (both times out after 30 sec.):

https://www.womeninfootball.co.uk/connectors(....removed...)/index.php?action=browser/directory/getList&id=/

https://www.womeninfootball.co.uk/connectors(....removed...)/index.php?action=resource/getNodes&id=web_0&type=modContext

These are basic calls. Any ideas?

The call to ‘browser/directory/getList’ basically executes the function getContainerList() in the file core/model/modx/sources/modfilemediasource.class.php (Source-Code).

The code iterates through all the files in the directory and does permission checks an other stuff.

/* iterate through directories */
/** @var DirectoryIterator $file */
foreach (new DirectoryIterator($fullPath) as $file) {
  ....
}

This process probably just takes up too much time on your system.

Oooh. Thanks. I am new to Modx. Sorry.

I could increase the timeout on the site. I should be able to do that through the INI file or cPanel.

That would fix the timeout while I deal with the large number of files.

Huge thanks!
Darren

Unfortunately that didn’t solve the problem. I am still getting errors after 30 sec.
This morning I got them on the following:

  • /connectorsSUtk83J7z3sfvQGn/index.php (5 of these timed out)
  • /connectorsSUtk83J7z3sfvQGn/index.php?action=resource/getNodes&id=web_0&type=modContext

Any ideas?

I appreciate your help.