I’m getting a strange warning I can’t fix with Symfony2 version v2.0.12. This was working fine yesterday. The only relevant recent change I suspect is my recent upgrade of symfony2 itself (installed into vendors/symfony) from v2.0.5 to v2.0.12.
Warning: SQLite3Stmt::execute(): Unable to execute statement: attempt to write a readonly database in /Symfony2/vendor/symfony/src/Symfony/Component/HttpKernel/Profiler/SqliteProfilerStorage.php on line 66
Call Stack:
0.0000 329108 1. {main}() /Symfony2/web/app_dev.php:0
0.0015 720736 2. Symfony\Component\HttpKernel\Kernel->handle() /Symfony2/web/app_dev.php:10
0.0102 1461700 3. Symfony\Bundle\FrameworkBundle\HttpKernel->handle() /Symfony2/vendor/symfony/src/Symfony/Component/HttpKernel/Kernel.php:171
0.0102 1462608 4. Symfony\Component\HttpKernel\HttpKernel->handle() /Symfony2/vendor/symfony/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php:47
0.0102 1462608 5. Symfony\Component\HttpKernel\HttpKernel->handleRaw() /Symfony2/vendor/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:71
0.0594 4226612 6. Symfony\Component\HttpKernel\HttpKernel->filterResponse() /Symfony2/vendor/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:139
0.0595 4232664 7. Symfony\Bundle\FrameworkBundle\ContainerAwareEventDispatcher->dispatch() /Symfony2/vendor/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:157
0.0598 4245456 8. Symfony\Component\EventDispatcher\EventDispatcher->dispatch() /Symfony2/vendor/symfony/src/Symfony/Bundle/FrameworkBundle/ContainerAwareEventDispatcher.php:145
0.0599 4246116 9. Symfony\Bundle\FrameworkBundle\Debug\TraceableEventDispatcher->doDispatch() /Symfony2/vendor/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:49
0.0609 4265376 10. call_user_func() /Symfony2/vendor/symfony/src/Symfony/Bundle/FrameworkBundle/Debug/TraceableEventDispatcher.php:82
0.0609 4265404 11. Symfony\Component\HttpKernel\EventListener\ProfilerListener->onKernelResponse() /Symfony2/vendor/symfony/src/Symfony/Bundle/FrameworkBundle/Debug/TraceableEventDispatcher.php:0
0.0640 4470124 12. Symfony\Component\HttpKernel\Profiler\Profiler->saveProfile() /Symfony2/vendor/symfony/src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php:124
0.0640 4470124 13. Symfony\Component\HttpKernel\Profiler\PdoProfilerStorage->write() /Symfony2/vendor/symfony/src/Symfony/Component/HttpKernel/Profiler/Profiler.php:91
0.0650 4516660 14. Symfony\Component\HttpKernel\Profiler\SqliteProfilerStorage->exec() /Symfony2/vendor/symfony/src/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php:103
0.0651 4563392 15. SQLite3Stmt->execute() /Symfony2/vendor/symfony/src/Symfony/Component/HttpKernel/Profiler/SqliteProfilerStorage.php:66
In app/logs/test.log I see lines like
[2012-03-30 14:40:49] profiler.WARNING: Unable to store the profiler information. [] []
Any ideas?
I stepped through SqliteProfilerStorage in a debugger and learned that the Sqlite3 database in question is at app/cache/dev/profiler.db.
$ ls -l app/cache/dev/profiler.db
-rw-r--r--+ 1 adam www-data 51200 2012-03-30 13:56 app/cache/dev/profiler.db
$ getfacl app/cache/test/profiler.db
# file: app/cache/test/profiler.db
# owner: www-data
# group: www-data
user::rw-
user:www-data:rwx #effective:r--
user:adam:rwx #effective:r--
group::rwx #effective:r--
mask::r--
other::r--
I regularly run phpunit tests from the command line and also hit an Apache2 VirtualHost pointed at the same Symfony2 application. I thought ACLs would allow these two to happen interchangeably, but I’m a bit confused by effective:r-- in the ACLs, above.
I set up permissions according to the install doc. I did this:
$ mkdir app/{cache,logs}
$ chmod 775 app/{cache,logs}
$ sudo setfacl -R -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs
$ sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs
And again, this just started causing issues, so I’m suspecting the Symfony2 upgrade. I’m looking through the commits though, and I haven’t found anything yet that might have recently broken this.
umaskfor both my user (adam) andwww-datareturns0002.- I’m using Ubuntu 11.10.
- This thread covers a similar symptom, but the suggested resolution doesn’t work for me.
profiler.dbalways has permissions0644.
maybe it’s only because you forgot to recursively set the 775 permissions on the files.
Try with