Incorrect integer value secure_only

Once an hour, this error is logged:

Error in Matomo (tracker): Error query: Error query: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: ‘’ for column ‘secure_only’ at row 1
In query: INSERT INTO matomo_user_token_auth (login, description, password, date_created, date_expired, system_token, hash_algo, secure_only) VALUES (?, ?, ?, ?, ?, ?, ?, ?) Parameters: array (0 => ‘xxx’, 1 => ‘System generated CliMultiNonAsyncArchive’, 2 => ‘3035b…’, 3 => ‘2024-11-03-12:35:00’, 4 => ‘2024-11-05 00:35:00’, 5 => 1, 6 => ‘sha512’, 7 => false,)

In this update file the secure_only column was changed to TINYINT:

./core/Updates/5.0.0-rc2.php
Line 39:
$migrations = $this->migration->db->changeColumn(‘user_token_auth’, ‘post_only’, ‘secure_only’, “TINYINT(2) UNSIGNED NOT NULL DEFAULT ‘0’”);

But there is still a bool set for secure_only instead of an int in these 2 files:

./plugins/UsersManager/Controller.php
Line 395:
$secureOnly = \Piwik\Request::fromRequest()->getBoolParameter(‘secure_only’, false);
Line 401:
$this->userModel->addTokenAuth($login, $generatedToken, $description, Date::now()->getDatetime(), null, false, $secureOnly);

./plugins/UsersManager/Model.php
Line 338:
public function addTokenAuth(
$login,
$tokenAuth,
$description,
$dateCreated,
$dateExpired = null,
$isSystemToken = false,
bool $secureOnly = false
)
Line 363:
$insertSql = "INSERT INTO " . $this->tokenTable . ’ (login, description, password, date_created, date_expired, system_token, hash_algo, secure_only) VALUES (?, ?, ?, ?, ?, ?, ?, ?)';
Line 370:
[$login, $description, $tokenAuth, $dateCreated, $dateExpired, $isSystemToken, self::TOKEN_HASH_ALGO, $secureOnly]

Can this getting fixed please?

Hi @lb777
Looking at your error, it seems you use a RC (quite old) version of Matomo: 5.0.0 RC.
Try maybe moving to a younger version…