I am having the same problem. :(
PHP7, Oracle and dbal seem to have somre more issues - I'm currently trying to setup an php7 oracle ci system ....
https://ci.owncloud.org/job/doctrine-dbal-oracle/PHP=7.0.0,label=SLAVE/
But there are some issues we need to get sorted out before we see the whole picture ...
Can anyone dig up the list of changes in the oracle driver for PHP7? There may have been breakages there...
http://php.net/ChangeLog-7.php lists only 3 items
OCI8:
Fixed memory leak with LOBs.
Fixed bug #68298 (OCI int overflow).
Corrected oci8 hash destructors to prevent segfaults, and a few other fixes.
That's not the entire list of fixes since 5.6.x.
For instance, RC8 included some LOB fixes - https://github.com/php/php-src/blob/php-7.0.0RC8/NEWS
I can't seem to be able to do a decent search on OCI8/PDO OCI on the php-src issue tracker:
I had problem with the official oci8 2.0.8, and I got a new oci8 2.1.0 changed in a remi repository of the CentOS and this worked with php 7, but with doctrine the problem still happens.
It's the oci8 2.1.0: http://arcostasi.com/download/oci8.so
PHP 7 info:
http://arcostasi.bs2.com.br/info.php
I'm getting the same error when try persist object.
Doctrine\DBAL\Exception\DriverException: An exception occurred while executing
'INSERT INTO log_auth (id, username, type, ip, user_agent, DATA_CRIACAO, id_usuario)
VALUES (?, ?, ?, ?, ?, ?, ?)'
with params [9776, "user", 4, "201.86.94.44", "Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/47.0.2526.80 Safari\/537.36", "2015-12-11 11:56:00", "122"]:
ORA-01862: the numeric value does not match the length of the format item
I did a new test and found something, I set the last field to null and get error in the first field that is required, but the first parameter was set! What I can deduce, the doctrine overwriting all fields with the last param!
ORA-01400: cannot insert NULL into ("LOG_AUTH"."ID")
An exception occurred while executing 'INSERT INTO log_auth (id, username, type, ip, user_agent, created, user_id) VALUES (?, ?, ?, ?, ?, ?, ?)' with params [9794, "test", 4, "201.86.94.44", "cURL", "2015-12-11 15:55:55", null]:
Any previous exceptions that we could look at?
2015-12-11T16:32:05-02:00 CRIT (2): Doctrine\DBAL\Driver\OCI8\OCI8Exception: ORA-01400: cannot insert NULL into ("ANTECIPADO_CHECKIN_TRIAL"."LOG_AUTH"."ID") in /var/www/arcostasi.bs2.com.br/verifica.crmall.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Exception.php:33
Stack trace:
#0 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php(214): Doctrine\DBAL\Driver\OCI8\OCI8Exception::fromErrorInfo(Array)
#1 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php(165): Doctrine\DBAL\Driver\OCI8\OCI8Statement->execute(NULL)
#2 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(281): Doctrine\DBAL\Statement->execute()
#3 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(1018): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->executeInserts()
#4 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(378): Doctrine\ORM\UnitOfWork->executeInserts(Object(Doctrine\ORM\Mapping\ClassMetadata))
#5 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(356): Doctrine\ORM\UnitOfWork->commit(NULL)
#6 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/module/Application/src/Application/Controller/LoginController.php(372): Doctrine\ORM\EntityManager->flush()
#7 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/module/Application/src/Application/Controller/LoginController.php(139): Application\Controller\LoginController->logAuth('arcostasi', 4, Object(Base\Entity\Usuario))
#8 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractActionController.php(82): Application\Controller\LoginController->authenticateAction()
#9 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#10 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#11 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#12 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractController.php(118): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#13 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/module/Application/src/Application/Controller/LoginController.php(341): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#14 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/vendor/zendframework/zendframework/library/Zend/Mvc/DispatchListener.php(93): Application\Controller\LoginController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#15 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#16 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#17 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#18 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/vendor/zendframework/zendframework/library/Zend/Mvc/Application.php(314): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#19 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/public/index.php(25): Zend\Mvc\Application->run()
#20 {main}
Next Doctrine\DBAL\Exception\NotNullConstraintViolationException: An exception occurred while executing 'INSERT INTO log_auth (id, username, type, ip, user_agent, DATA_CRIACAO, id_usuario) VALUES (?, ?, ?, ?, ?, ?, ?)' with params [9803, "arcostasi", 4, "201.86.94.44", "Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/47.0.2526.80 Safari\/537.36", "2015-12-11 16:32:05", null]:
ORA-01400: cannot insert NULL into ("ANTECIPADO_CHECKIN_TRIAL"."LOG_AUTH"."ID") in /var/www/arcostasi.bs2.com.br/verifica.crmall.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractOracleDriver.php:68
Stack trace:
#0 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(116): Doctrine\DBAL\Driver\AbstractOracleDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\OCI8\OCI8Exception))
#1 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php(174): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\OCI8\Driver), Object(Doctrine\DBAL\Driver\OCI8\OCI8Exception), 'INSERT INTO log...', Array)
#2 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(281): Doctrine\DBAL\Statement->execute()
#3 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(1018): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->executeInserts()
#4 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(378): Doctrine\ORM\UnitOfWork->executeInserts(Object(Doctrine\ORM\Mapping\ClassMetadata))
#5 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(356): Doctrine\ORM\UnitOfWork->commit(NULL)
#6 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/module/Application/src/Application/Controller/LoginController.php(372): Doctrine\ORM\EntityManager->flush()
#7 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/module/Application/src/Application/Controller/LoginController.php(139): Application\Controller\LoginController->logAuth('arcostasi', 4, Object(Base\Entity\Usuario))
#8 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractActionController.php(82): Application\Controller\LoginController->authenticateAction()
#9 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#10 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#11 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#12 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractController.php(118): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#13 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/module/Application/src/Application/Controller/LoginController.php(341): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#14 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/vendor/zendframework/zendframework/library/Zend/Mvc/DispatchListener.php(93): Application\Controller\LoginController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#15 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#16 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#17 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#18 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/vendor/zendframework/zendframework/library/Zend/Mvc/Application.php(314): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#19 /var/www/arcostasi.bs2.com.br/verifica.crmall.com/public/index.php(25): Zend\Mvc\Application->run()
#20 {main}
Could you show the state of that OCI8Statement, as well as what is passed to fromErrorInfo?
Hi Ocramius, this is the log of method execute on Statement, I removed only connection params.
error_log('PARAMS: ' . print_r($params, true) . PHP_EOL . print_r($this, true), 3, 'statement-dump.log');
Cleaned it up and this is what is relevant:
PARAMS:
Doctrine\DBAL\Statement Object
(
[sql:protected] => INSERT INTO log_auth (id, username, type, ip, user_agent, DATA_CRIACAO, id_usuario) VALUES (?, ?, ?, ?, ?, ?, ?)
[params:protected] => Array
(
[1] => 9807
[2] => arcostasi
[3] => 4
[4] => 201.86.94.44
[5] => Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36
[6] => Base\Util\DateTimeBr Object
(
[date] => 2015-12-11 16:55:26.000000
[timezone_type] => 3
[timezone] => America/Sao_Paulo
)
[7] =>
)
[types:protected] => Array
(
[1] => bigint
[2] => string
[3] => integer
[4] => string
[5] => string
[6] => datetime
[7] => bigint
)
[stmt:protected] => Doctrine\DBAL\Driver\OCI8\OCI8Statement Object
(
[_dbh:protected] => Resource id #424
[_sth:protected] => Resource id #490
[_conn:protected] => Doctrine\DBAL\Driver\OCI8\OCI8Connection Object
(
[dbh:protected] => Resource id #424
[executeMode:protected] => 0
)
[_defaultFetchMode:protected] => 2
[_paramMap:protected] => Array
(
[1] => :param1
[2] => :param2
[3] => :param3
[4] => :param4
[5] => :param5
[6] => :param6
[7] => :param7
)
)
[platform:protected] => Doctrine\DBAL\Platforms\OraclePlatform Object
( )
[conn:protected] => Doctrine\DBAL\Connection Object
(
)
)
I'm closing this - it is evident that the problem lies inside the implementation of oci_execute, which is outside our scope.
It's quite possible that Doctrine needs to make sure that zvals used at bind time are still available at execute time - as always has been recommended. The core zval ref counting optimizations in PHP 7's VM can cause different behavior to PHP 5.6 and this is known to have affected OCI8 apps.
I think the doctrine support for Oracle is not good!
We have already shown one way to solve, and it was not taken seriously! They do not listen and do nothing about it!
There is an open PR about it (which needs work), see #2386. Moderate your tone, @arcostasi.
Also, we do stuff when we have time, since we're not paid to do any of the free stuff you are using
Ok, just my opinion @Ocramius! I think it's not as free as you talk, many things in my work had to refactor!
@arcostasi yeah, but that's your work, not your free time ;-)
@Ocramius many things I had to do in my free time!
@Ocramius many things I had to do in my free time!
"had to" + free time => collision.
I'm not here to tell you how to fix your work environment issues, tho.
I know @Ocramius, my work is not the problem! We also provide a free fix to solve temporarily some problem that other developer may have. https://github.com/doctrine/dbal/issues/2261
@arcostasi the #2261 adds an issue with Oci-Lob that I'm trying to solve in #2386, I'll work on it asap (we're almost there)
Most helpful comment
@arcostasi the #2261 adds an issue with Oci-Lob that I'm trying to solve in #2386, I'll work on it asap (we're almost there)