Package Manager crashed by loading getDate (MODX 3.0.1-pl)

Hi, I used the package manager in MODX 3.0.1-pl to load the getDate snippet. Now the package manager doesn’t work anymore. The “package update check” runs infinite.

The dashboard shows only error messages (the path has been anonymised by me):

TypeError: count(): Argument #1 ($value) must be of type Countable|array, string given
Errors:
 /var/www/vhosts/…/httpdocs/core/src/Revolution/Processors/Workspace/Packages/GetList.php:218
 MODX\Revolution\Processors\Workspace\Packages\GetList->checkForUpdates() in /var/www/vhosts/…/httpdocs/manager/controllers/default/dashboard/widget.updates.php:78
 modDashboardWidgetUpdates->render() in /var/www/vhosts/…/httpdocs/core/src/Revolution/modDashboardWidgetInterface.php:81
 MODX\Revolution\modDashboardWidgetInterface->process() in /var/www/vhosts/…/httpdocs/core/src/Revolution/modDashboardWidget.php:134
 MODX\Revolution\modDashboardWidget->getContent() in /var/www/vhosts/…/httpdocs/core/src/Revolution/modDashboard.php:122
 MODX\Revolution\modDashboard->render() in /var/www/vhosts/…/httpdocs/manager/controllers/default/welcome.class.php:109
 WelcomeManagerController->process() in /var/www/vhosts/…/httpdocs/core/src/Revolution/modManagerController.php:178
 MODX\Revolution\modManagerController->render() in /var/www/vhosts/…/httpdocs/core/src/Revolution/modManagerResponse.php:114
 MODX\Revolution\modManagerResponse->outputContent() in /var/www/vhosts/…/httpdocs/core/src/Revolution/modManagerRequest.php:173
 MODX\Revolution\modManagerRequest->prepareResponse() in /var/www/vhosts/…/httpdocs/core/src/Revolution/modManagerRequest.php:143
 MODX\Revolution\modManagerRequest->handleRequest() in /var/www/vhosts/…/httpdocs/manager/index.php:60

Is there a solution to solve the problem? What can I do? Please help, I’m not able to solve this myself. Many thanks!

Hi @videoschlumpf

I’ve had this issue a few times and the only solution I’ve found is to remove the offending extra from the modx_transport_packages table in the database.

You may want to backup your database, or at least that table, first.

1 Like

Many thanks. Checked the database and the table modx_transport_packages. Removed getDate from the table and now it’s ok.

1 Like

The problem seems to be, that the manager tries to check for package updates by calling the API https://rest.modx.com/extras/package/update?...&signature=getdate-1.0.0-pl....

But for some reason the API returns an error for the getDate package

<error>
	<success>false</success>
	<message>No Package release found.</message>
	<object/>
	<status>404</status>
	<description>
		No published versions of the Package could be found supporting your environment.
	</description>
</error>

and this is not handled gracefully by the code.


As a temporary fix, you could also just change the value of the column “provider” to 0 for the offending row in the database table modx_transport_packages (instead of deleting the whole row).
This should prevent the code from checking for updates.

2 Likes

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.