Closed zedar187 closed 1 year ago
After digging through the sources, I've found the issue. The origin is in ramsey/uuid instead of the uuid-doctrine. It seems that there has been an issue in 2016 about this: ramsey/uuid#133.
The server is running on a vpn network, which interface hasn't got a mac address (as in: 00-00-00-00-00-00
). As this interface is the first one listed by SystemNodeProvider->getIfconfig()
it takes the mentioned zeroed mac address as the returned node.
When going through the interfaces, I've put a quick if-statement to it:
Ramsey\Uuid\Provider\Node\SystemNodeProvider.php
line 138
if (preg_match_all(self::IFCONFIG_PATTERN, $ifconfig, $matches, PREG_PATTERN_ORDER)) {
foreach($matches[1] as $iface) {
if($iface!="00-00-00-00-00-00"){
$node = $iface;
}
}
}
This cycles through all interfaces and takes the first "usable" one, while dismissing zero'd entries.
I'm using uuid-doctrine with
UuidBinaryOrderedTimeType
as an id field on multiple sql tables, which is working fine on a local dev environment. When using same code on the prod server (identical config, versions etc) the node of each UUID is always just 0.How do I debug/ how can I get any more info of this problem, as to why the node is always zero'd? Unfortunately there is no exception thrown...
php-fpm 7.4, ramsey/uuid-doctrine 1.8.1, doctrine/orm 2.13.2