DoliCloud/SellYourSaas

Unknown column 'deployment_ip' on new installation

priojk opened this issue · 1 comments

Describe the bug

On a fresh installation of SellYourSaas (with Dolibarr v16.0.1), it is not possible to create new customer instances because the check for too many instances from same IP is immediately triggered.

Looking into the root cause, the Dolibarr log ist saying:
DoliDBMysqli::query SQL Error message: DB_ERROR_NOSUCHFIELD Unknown column 'deployment_ip' in 'where clause'

Running the installation again did not solve this.

Looking into the source in file myaccount/register_instance.php,
when the SQL check fails, since the column does not exist, $nbofinstancewithsameip is set to -1.
The range check explicitly fails, when this value is < 0.

I think this check for <0 needs to be removed but I am unsure regarding side effects.

BTW whitelisting the IP does not help as a quick fix, since the hourly check ($MAXDEPLOYMENTPERIPPERHOUR) fails as well for the same reason of the missing column and cannot be overridden by whitelisting.

Still don't know, why this field was missing. But it can easily be created as an extrafield.