zikula / core

Zikula Core Framework
GNU Lesser General Public License v3.0
238 stars 66 forks source link

fresh install of 1.3.6#167 not possible #700

Closed rallek closed 11 years ago

rallek commented 11 years ago

I get the following message when first time going to the installation (no install script was running before):

Uncaught exception Connection failed to database: SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: NO) in /www/htdocs/w00dd23a/www/kleinanzeigen/Zikula/lib/Zikula/Bundle/CoreBundle/EventListener/Doctrine1ConnectorListener.php line, 99

0 [internal function]: Zikula\Bundle\CoreBundle\EventListener\Doctrine1ConnectorListener->doctrineInit(Object(Zikula\Core\Event\GenericEvent))

1 /www/htdocs/w00dd23a/www/kleinanzeigen/Zikula/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(164): call_user_func(Array, Object(Zikula\Core\Event\GenericEvent))

2 /www/htdocs/w00dd23a/www/kleinanzeigen/Zikula/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(53): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'doctrine.init_c...', Object(Zikula\Core\Event\GenericEvent))

3 /www/htdocs/w00dd23a/www/kleinanzeigen/Zikula/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php(167): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('doctrine.init_c...', Object(Zikula\Core\Event\GenericEvent))

4 /www/htdocs/w00dd23a/www/kleinanzeigen/Zikula/lib/Zikula/EventManager.php(97): Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('doctrine.init_c...', Object(Zikula\Core\Event\GenericEvent))

5 /www/htdocs/w00dd23a/www/kleinanzeigen/Zikula/lib/EventHandlers/SystemListeners.php(274): Zikula_EventManager->dispatch('doctrine.init_c...', Object(Zikula\Core\Event\GenericEvent))

6 [internal function]: SystemListeners->initDB(Object(Zikula\Core\Event\GenericEvent))

7 /www/htdocs/w00dd23a/www/kleinanzeigen/Zikula/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(164): call_user_func(Array, Object(Zikula\Core\Event\GenericEvent))

8 /www/htdocs/w00dd23a/www/kleinanzeigen/Zikula/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(53): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'core.preinit', Object(Zikula\Core\Event\GenericEvent))

9 /www/htdocs/w00dd23a/www/kleinanzeigen/Zikula/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php(167): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('core.preinit', Object(Zikula\Core\Event\GenericEvent))

10 /www/htdocs/w00dd23a/www/kleinanzeigen/Zikula/lib/Zikula/EventManager.php(97): Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('core.preinit', Object(Zikula\Core\Event\GenericEvent))

11 /www/htdocs/w00dd23a/www/kleinanzeigen/Zikula/lib/Zikula/Core.php(418): Zikula_EventManager->dispatch('core.preinit', Object(Zikula\Core\Event\GenericEvent))

12 /www/htdocs/w00dd23a/www/kleinanzeigen/Zikula/index.php(23): Zikula_Core->init()

13 {main}

ghost commented 11 years ago

Take the next build - it's another CI problem, the core is working.

nmpetkov commented 11 years ago

Last build 178 from ci.zikula.org can pass a fresh install, as per may test. Only last step hangs (no redirect to "Success install" page). But I checked in database, and all tables are created, and Zikula IS installed and IS working

My browser this time was up-to-date Google Chrome and hanged, maybe because some kind of javascript, but not sure..

I don't know if now is time for test, but quick overview exposed one obvious error:

Fatal error: Class 'Users\Controller\Zikula_Api_AbstractAuthentication' not found in /home/z...y...z/public_html/zktest136/system/Users/Controller/UserController.php on line 233
nmpetkov commented 11 years ago

Ok, now new registration can be started. After click on "Check your entries", a popup spears and new error:

[Semantical Error] line 0, col 24 near 'Users\Entity\UserEntityVerificationEntity': Error: Class 'Users\Entity\UserEntityVerificationEntity' is not defined.
ghost commented 11 years ago

Try now...

nmpetkov commented 11 years ago

Now error disappear. But still can not make new registration - or I'm doing something wrong. Every time I'm returned in registration form (verification stage is OK, but pressing "Proceed with registration" returns me to the form, and many fields are "red" - they was verified in previous stage). Maybe somebody else to test this also.

ghost commented 11 years ago

Thanks. This needs a new ticket. Please open a new one now since Zikula is installable. If you are able to do any debugging, it would be much appreciated as I am working on something else.

nmpetkov commented 11 years ago

I also noticed that this is off-ticket. Ill test again other time and open new one.

rallek commented 11 years ago

you can reopen this ticket. The same error occurs with build189.

rallek commented 11 years ago

Workaround: Put the database configuration into the config.php. Than the installer is starting and requesting all this again. Stange...

shefik commented 11 years ago

It's probably related to this issue I reported a while back, where setting the port is missing in installation.

https://github.com/zikula/core/issues/153

damon18 commented 11 years ago

Similar problem trying fresh install of build 215 from CI. Got the errors below after uploading clean files and going to install.php, then added the database info to config.php revisited install.php. Install started correctly but still asked for database info even though it was already in config.php.

Uncaught exception Connection failed to database: SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: NO) in /home/example/public_html/zk136/lib/Zikula/Bundle/CoreBundle/EventListener/Doctrine1ConnectorListener.php line, 99

0 [internal function]: Zikula\Bundle\CoreBundle\EventListener\Doctrine1ConnectorListener->doctrineInit(Object(Zikula\Core\Event\GenericEvent))

1 /home/example/public_html/zk136/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(164): call_user_func(Array, Object(Zikula\Core\Event\GenericEvent))

2 /home/example/public_html/zk136/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(53): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'doctrine.init_c...', Object(Zikula\Core\Event\GenericEvent))

3 /home/example/public_html/zk136/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php(167): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('doctrine.init_c...', Object(Zikula\Core\Event\GenericEvent))

4 /home/example/public_html/zk136/lib/Zikula/EventManager.php(97): Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('doctrine.init_c...', Object(Zikula\Core\Event\GenericEvent))

5 /home/example/public_html/zk136/lib/EventHandlers/SystemListeners.php(228): Zikula_EventManager->dispatch('doctrine.init_c...', Object(Zikula\Core\Event\GenericEvent))

6 [internal function]: SystemListeners->initDB(Object(Zikula\Core\Event\GenericEvent))

7 /home/example/public_html/zk136/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(164): call_user_func(Array, Object(Zikula\Core\Event\GenericEvent))

8 /home/example/public_html/zk136/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(53): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'core.preinit', Object(Zikula\Core\Event\GenericEvent))

9 /home/example/public_html/zk136/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php(167): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('core.preinit', Object(Zikula\Core\Event\GenericEvent))

10 /home/example/public_html/zk136/lib/Zikula/EventManager.php(97): Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('core.preinit', Object(Zikula\Core\Event\GenericEvent))

11 /home/example/public_html/zk136/lib/Zikula/Core.php(418): Zikula_EventManager->dispatch('core.preinit', Object(Zikula\Core\Event\GenericEvent))

12 /home/example/public_html/zk136/index.php(23): Zikula_Core->init()

13 {main}

ghost commented 11 years ago

Reopening, but until someone can show me what the condition is to get this error, I'm sticking to the original line (that we assume a database test is available with access as root@localhost, no password)

rallek commented 11 years ago

@drak : I sent via email you the access data to a test environment 4 weeks ago. I don't know what I should show you but here you can see it yourself and do all the analyses you need.

Now I resent you the mail again.

rallek commented 11 years ago

by the way: 1.3.5 is installing fine!

rallek commented 11 years ago

Allinkl. is telling me I do not have any root access in my shared hosting. The database user should be used instead of root.

Portugao commented 11 years ago

I just checked an installation with build 215 local under xamp (php 5.4.7) and win8 and 'root' as user and no password. I got installed Zik 136 without an issue.

damon18 commented 11 years ago

@rallek @drak My test was on a live server/domain where I have installed lots of 1.3x builds. Only 1.3.6 fails in this manner.

rallek commented 11 years ago

@damon18 Do you have root access to your MySQL databases?

cmfcmf commented 11 years ago

I have root access, and only one mysql user called root (because it is on my local PC) and have the same problems.

2013/3/13 rallek notifications@github.com

@damon18 https://github.com/damon18 Do you have root access to your MySQL databases?

— Reply to this email directly or view it on GitHubhttps://github.com/zikula/core/issues/700#issuecomment-14831245 .

ghost commented 11 years ago

At the risk of repeating. the assumption is that there is a database called test, with access by root@localhost + no password.

damon18 commented 11 years ago

@rallek @drak I'm confused by your responses, why would there be a database called test and why would install.php check for root mysql access to startup?

It may be that I just don't understand the issue, but I know that I've been able to run install.php on all versions of Zikula 1.3x but not 1.3.6

rallek commented 11 years ago

at the risk of repeating, something ist different between zk135 and zk136. The difference leads to the problem some of us have.

I offered an environment to analyze.

You can not ignore this issue by repeating that this bug should not be there.

ghost commented 11 years ago

At the risk of repeating myself too - I cannot fix a bug I cannot replicate here on my own dev env. Please don't rely on me to fix this as I cannot fix what is working for me on my own dev environment.

rallek commented 11 years ago

and what is the difference in your dev environment? I can only report my problem and give you access to my environment.

You have made the changes. I can not tell you what is going wrong. I am not alown with this issue. please tell me what I can analyse as an user.

If you are ignoring this bug we will have a hard time in support.

craigh commented 11 years ago

I just downloaded build 125. used phpMyAdmin to create a database (as I would usually do) then directed the browser to install.php and received this error:

Uncaught exception Connection failed to database: SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: NO) in /Applications/MAMP/htdocs/136/lib/Zikula/Bundle/CoreBundle/EventListener/Doctrine1ConnectorListener.php line, 99

I agree with the others that this is a change from previous behavior. I am testing this on my local dev box which is a Mac running OSX 10.7.5 and MAMP 2.0.5 with Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8r DAV/2 PHP/5.3.6 and MySQL 5.5.9

I'll try to test this in a shared hosting environment next.

craigh commented 11 years ago

OK, I tested in a shared environment with the same result. you can view it here:

http://www.soundwebdev.com/136/install.php

craigh commented 11 years ago

that environment is Apache version 2.2.23 PHP version 5.3.22 MySQL version 5.0.96-community-log Architecture i686 Operating system linux

craigh commented 11 years ago

I've tried looking into this but it's quite complicated and I can't keep my thoughts straight.

Best I can tell, the doctrine.init_connection event is occurring multiple times through the loading of the install.php file. The first time with lazy set to true but in subsequent times, with a value of false.

the event loads Doctrine1ConnectorListener::doctrineInit() and this is called at least twice before the error occurs.

I think it is loaded again in the Zikula_Core::init() method, but even eliminating that still forced another load. So, I got lost and gave up for now. Drak, I know you are busy, and maybe this will just need to wait until you aren't, but this is beyond me I think.

craigh commented 11 years ago

@rallek @nmpetkov @damon18 @cmfcmf @Portugao please test with this fix - you may have to manually edit your ci build with this change until the ci rebuilds. I don't know how often that happens.

cmfcmf commented 11 years ago

Sorry, that doesn't make any difference. _But I got it working by commentig the line out!_

    public function initDB(Zikula_Event $event)
    {
        #$this->eventManager->dispatch('doctrine.init_connection', new \Zikula\Core\Event\GenericEvent());
        #$this->eventManager->dispatch('doctrine.init_connection', new \Zikula\Core\Event\GenericEvent(null, $event->getArgs()));

        $this->eventManager->dispatch('doctrine.boot', new \Zikula\Core\Event\GenericEvent());
    }

Installation now works well, but after the Install script has run, I have to comment the line in again.

nmpetkov commented 11 years ago

In my case the error remains:

Uncaught exception Connection failed to database: SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: NO) in .../lib/Zikula/Bundle/CoreBundle/EventListener/Doctrine1ConnectorListener.php line, 99

Zikula_Core-1.3.6.build215.zip from http://ci.zikula.org/, database on remote linux server without root@localhost access (ordinary hosting)

craigh commented 11 years ago

@nmpetkov -did you patch the file with my change? It won't be in the CI build.

nmpetkov commented 11 years ago

Yes, of course.

cmfcmf commented 11 years ago

In lib/Zikula/Bundle/CoreBundle/EventListener/Doctrine1ConnectorListener.php

    public function doctrineInit(Zikula_Event $event)
    {
        if (!$this->doctrineManager) {
            Doctrine_Core::debug(System::isDevelopmentMode());
            $this->doctrineManager = Doctrine_Manager::getInstance();
            $internalEvent = new \Zikula\Core\Event\GenericEvent($this->doctrineManager);
            $this->dispatcher->dispatch('doctrine.configure', $internalEvent);

            $internalEvent = new \Zikula\Core\Event\GenericEvent($this->doctrineManager);
            $this->dispatcher->dispatch('doctrine.cache', $internalEvent);
        }

        $lazyConnect = true;//isset($lazy) ? $lazy : false;

If I set the last line here to true, installation works (even without your patch).

craigh commented 11 years ago

well sure, that forces ALL connections to be lazy which is undesired, but solves this one problem. Some connections are not supposed to be lazy though :wink:

nmpetkov commented 11 years ago

Why not in case of install, this error to be caught, and instillation to continue. After entering database information, then connections to be initiated. (I know it is easy to say this, and difficult to implement, but just want to help...)

Portugao commented 11 years ago

I do not understand if there is really something new in the core now in comparison to zik135.

craigh commented 11 years ago

dang. apparently I had changed something else and now I don't know what it was that made it work.

nmpetkov commented 11 years ago

Yes, I found one change: In Zikula 1.3.5 the line is:

$this->addHandlerDefinition('core.init', 'initDB');

but in Zikula 1.3.6 is:

$this->addHandlerDefinition('core.preinit', 'initDB');

core.init ==> core.preinit ?

nmpetkov commented 11 years ago

I tested again with core.preinit ==> core.init and now the error is other;

Uncaught exception An exception occurred while executing 'SELECT t0.id AS id1, t0.modname AS modname2, t0.name AS name3, t0.value AS value4 FROM module_vars t0':

SQLSTATE[42S02]: Base table or view not found: 1146 Table testzk136.module_vars' doesn't exist in .../vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php line, 47
craigh commented 11 years ago

ok - I think I found the other thing I had fixed before you can see the diff here:

https://github.com/zikula/core/pull/769/files

only @drak and possibly @guite will know if these changes have an effect elsewhere.

Guite commented 11 years ago

Sorry, I have no idea about that.