Concurrent record locked when publishing layout in self-hosted Xibo CMS 4.5.1 without docker

I’m selfhosting Xibo CMS without Docker. At this moment I’m still troubleshooting why I’m unable to publish new and exisiting layouts.

Trying to modify and publish a lay-out of which a player is using that layout, results in the player displaying a blank screen with only the XIBO logo. The layout will stay in draft.

I couldn’t reproduce this when setting up a fresh Xibo 4.5.1 installation using Docker and my own self-hosting method. It’s something specific to my production environment.

As for the logs inside of the CMS:

Level: Error
Display: (All of them)
Page: Schedule
Message: Carbon\\Carbon::createFromTimestamp(): Argument #1 ($timestamp) must be of type string|int|float, null given, called in /srv/xibo-cms/lib/Helper/DateFormatHelper.php on line 55

When opening the layout editor, in the console the following error pops up right away:

An unexpected error occured..: layoutEditor.bundle.min.js?v=4.5.1&rev=7275f1d017a57c876f02928b33dd760e8d01e73a:2

Which points to this specific line:

lD.toggleLockedMode(t.extra.isLocked.lockedUser, moment(t.extra.isLocked.expires, systemDateFormat).format(jsDateFormat)))) : t.login ? LoginBox() : null == t.message ? console.error(t) : console.error(t.message)

Attempting to publish the lay-out eventually logs the following error:

Concurrent record locked, time out.

In my configuration auto publishing of layouts was set to enabled. After I disabled this, it no longer hangs on publishing a layout, however displays are not showing content and the errors are still present.

I got everything operational again. I’m not sure what might have caused this, but with a combination of checking Xibo’s logs, checking the database, and adding more logging to the code I’ve managed to pin it down.

Unable to publish the layout:
Head to Administration → Settings → Defaults →
Disable the following setting: “Should Layouts be automatically Published?”

Displays don’t show content and only XIBO logo on the bottom right
Head to Schedule → Events
Delete all scheduled commands.

in my non docker installation while waiting for an official fix I did a dirty quick one:

edit lib/Helper/DateFormatHelper.php
replace around line 55
public static function createFromTimestamp($timestamp): Carbon
{
return Carbon::createFromTimestamp($timestamp, date_default_timezone_get());
}

with:
public static function createFromTimestamp($timestamp): Carbon
{
try {
return Carbon::createFromTimestamp($timestamp, date_default_timezone_get());
} catch (InvalidArgumentException | TypeError $e) {
return Carbon::createFromTimestamp(0, date_default_timezone_get());
}
}