can't install onto snow leopard server... is it just me?

9 views
Skip to first unread message

IchBinGlitched

unread,
Dec 19, 2009, 1:01:46 AM12/19/09
to pkcontextcms
Hello. a friend of mine recommended i check out the ol' pkcontextcms/
apostrophe system and i *really* do like what i've seen on the web so
i thought i'd give it a try.

SOOOO... today was the day.

first i spent some time with symfony and after soldiering through some
hiccups i got version 1.4 working as advertised.

Apostrophe was up next and has been a bit trickier so after starting /
restarting a fair dozen times with different branches and different
configurations without success now i'm here to see if there's
something i'm missing.

I've been using the instructions from
http://svn.symfony-project.com/plugins/pkContextCMSPlugin/trunk/README

the instructions were relatively painless, but when it came time for
building the database it kept erroring out:


./symfony doctrine:build-all-load
yieled an error (in a big red box): Task "doctrine:build-all-load" is
not defined.


so i dug through the help a bit and the help offered up
./symfony doctrine:build --all --and-load="data/fixtures/dev/"

after one failure i looked and saw that there wasn't a dev folder so i
dropped it... got the same error next time.

The first attempt was with the version of symfony that was
automatically downloaded by svn (1.4.2 DEV)...
after that i manually downloaded version 1.4.0 and used require-
core.php to reference it. I did the same with version 1.2.11DEV
(couldn't get a non-dev version, but this is the only version of
symfony that i downloaded which works with the "./symfony
doctrine:build-all-load" command)

here are the errors each version generated... they all seem to have to
do with foreign keys, but my MySQL is weak enough that i don't see
where to look to correct this problem.

PHP is version 5.3
MySQL server is 5.0.82
(clean 10.6 install)

symfony version = 1.4.2 DEV
SQLSTATE[HY000]: General error: 1005 Can't create table './
symfony_test/#sql-2f_455.frm' (errno: 150). Failing Query: "ALTER
TABLE pk_context_cms_access ADD CONSTRAINT
pk_context_cms_access_user_id_sf_guard_user_id FOREIGN KEY (user_id)
REFERENCES sf_guard_user(id) ON DELETE CASCADE". Failing Query: ALTER
TABLE pk_context_cms_access ADD CONSTRAINT
pk_context_cms_access_user_id_sf_guard_user_id FOREIGN KEY (user_id)
REFERENCES sf_guard_user(id) ON DELETE CASCADE

symfony version =
1.4.0
SQLSTATE[HY000]: General error: 1005 Can't create table './cmstest/
#sql-2f_46e.frm' (errno: 150). Failing Query: "ALTER TABLE
pk_context_cms_access ADD CONSTRAINT
pk_context_cms_access_user_id_sf_guard_user_id FOREIGN KEY (user_id)
REFERENCES sf_guard_user(id) ON DELETE CASCADE". Failing Query: ALTER
TABLE pk_context_cms_access ADD CONSTRAINT
pk_context_cms_access_user_id_sf_guard_user_id FOREIGN KEY (user_id)
REFERENCES sf_guard_user(id) ON DELETE CASCADE

symfony version = 1.2.11-DEV
SQLSTATE[HY000]: General error: 1005 Can't create table './cmstest/
#sql-2f_474.frm' (errno: 150). Failing Query: ALTER TABLE
pk_context_cms_access ADD FOREIGN KEY (user_id) REFERENCES
sf_guard_user(id) ON DELETE CASCADE

SQLSTATE[HY000]: General error: 1005 Can't create table './cmstest/
#sql-2f_477.frm' (errno: 150). Failing Query: ALTER TABLE
pk_context_cms_access ADD FOREIGN KEY (user_id) REFERENCES
sf_guard_user(id) ON DELETE CASCADE


the 404 error code on the frontend_dev.php page is as follows:

404 | Not Found | sfError404Exception
This request has been forwarded to a 404 error page by the action
"pkContextCMS/show".
stack trace
1 at ()
in SF_ROOT_DIR/lib/vendor/symfony/lib/action/sfAction.class.php line
89 ...
86. {
87. if (!$condition)
88. {
89. throw new sfError404Exception($this->get404Message
($message));
90. }
91. }
92.
2 at sfAction->forward404Unless()
in SF_ROOT_DIR/plugins/pkContextCMSPlugin/lib/pkContextCMSTools.php
line 356 ...
3 at pkContextCMSTools::validatePageAccess(object
('pkContextCMSActions'), )
in SF_ROOT_DIR/plugins/pkContextCMSPlugin/modules/pkContextCMS/lib/
BasepkContextCMSActions.class.php line 30 ...
4 at BasepkContextCMSActions->executeShow(object('sfWebRequest'))
in SF_ROOT_DIR/lib/vendor/symfony/lib/action/sfActions.class.php line
60 ...
5 at sfActions->execute(object('sfWebRequest'))
in SF_ROOT_DIR/lib/vendor/symfony/lib/filter/
sfExecutionFilter.class.php line 92 ...
6 at sfExecutionFilter->executeAction(object('pkContextCMSActions'))
in SF_ROOT_DIR/lib/vendor/symfony/lib/filter/
sfExecutionFilter.class.php line 78 ...
7 at sfExecutionFilter->handleAction(object('sfFilterChain'), object
('pkContextCMSActions'))
in SF_ROOT_DIR/lib/vendor/symfony/lib/filter/
sfExecutionFilter.class.php line 42 ...
8 at sfExecutionFilter->execute(object('sfFilterChain'))
in SF_ROOT_DIR/lib/vendor/symfony/lib/filter/sfFilterChain.class.php
line 53 ...
9 at sfFilterChain->execute()
in SF_ROOT_DIR/lib/vendor/symfony/lib/filter/
sfRenderingFilter.class.php line 33 ...
10 at sfRenderingFilter->execute(object('sfFilterChain'))
in SF_ROOT_DIR/lib/vendor/symfony/lib/filter/sfFilterChain.class.php
line 53 ...
11 at sfFilterChain->execute()
in SF_ROOT_DIR/lib/vendor/symfony/lib/controller/
sfController.class.php line 229 ...
12 at sfController->forward('pkContextCMS', 'show')
in SF_ROOT_DIR/lib/vendor/symfony/lib/controller/
sfFrontWebController.class.php line 48 ...
13 at sfFrontWebController->dispatch()
in SF_ROOT_DIR/lib/vendor/symfony/lib/util/sfContext.class.php line
170 ...
14 at sfContext->dispatch()
in SF_ROOT_DIR/web/frontend_dev.php line 13 ...

sorry if this message was all kinds of garbled or untidy.

any help would be greatly appreciated. I'm looking forward to getting
to work with your system.

Tom Boutell

unread,
Dec 19, 2009, 12:28:12 PM12/19/09
to pkcont...@googlegroups.com
Hello,

You're right, I need to update the docs to cover 1.4.

Do this:

./symfony doctrine:build --all
./symfony doctrine:data-load

Then you should be good to go.

Not sure where the data/fixtures/dev suggestion came from.

I assume you are using MySQL and you have the right settings for your
particular setup in config/databases.yml.

Hope this is helpful!

> --
>
> You received this message because you are subscribed to the Google Groups "pkcontextcms" group.
> To post to this group, send email to pkcont...@googlegroups.com.
> To unsubscribe from this group, send email to pkcontextcms...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pkcontextcms?hl=en.
>
>
>

--
Tom Boutell
P'unk Avenue
215 755 1330
punkave.com
window.punkave.com

IchBinGlitched

unread,
Dec 19, 2009, 3:04:14 PM12/19/09
to pkcontextcms
thanks for the quick response, but i'm afraid the error persists.

I am using mysql (MySQL server is 5.0.82 ) and modded the
databases.yml file to fit my needs.

here's a line by line list of what i did and where the errors come
up. If there's any other info that would help i'd be happy to share
it.

$svn co http://svn.symfony-project.com/plugins/pkContextCMSPlugin/sandbox/trunk
cmstest
$cd cmstest
$cp config/databases.yml.sample config/databases.yml
$cp config/properties.ini.sample config/properties.ini
$nano config/databases.yml (edited username and password to cmstest)
-->no changes were made to properties.ini

$./symfony doctrine:build --all

"This command will remove all data in the following "dev" connection
(s):

- doctrine

Are you sure you want to proceed? (y/N)"
"yes"

all the following lines have a green label and then the tables are
created successfully... the error pops up during the ALTER TABLE
stuff.

>> autoload Resetting application autoloaders
>> file- /Library/WebServer/Documents/site...ev/config/config_autoload.yml.php
>> doctrine generating sql for models
>> dir+ /Library/WebServer/Documents/site...ched/david/Sites/cmstest/data/sql
>> doctrine Generated SQL successfully for models
>> doctrine created tables successfully

SQLSTATE[HY000]: General error: 1005 Can't create table './cmstest/

#sql-2f_4d3.frm' (errno: 150). Failing Query: "ALTER TABLE


pk_context_cms_access ADD CONSTRAINT
pk_context_cms_access_user_id_sf_guard_user_id FOREIGN KEY (user_id)
REFERENCES sf_guard_user(id) ON DELETE CASCADE". Failing Query: ALTER
TABLE pk_context_cms_access ADD CONSTRAINT
pk_context_cms_access_user_id_sf_guard_user_id FOREIGN KEY (user_id)
REFERENCES sf_guard_user(id) ON DELETE CASCADE

$server:cmstest root# ./symfony doctrine:data-
load

>> doctrine Loading data fixtures from "/Libr...avid/Sites/cmstest/data/fixtures"
>> doctrine Loading data fixtures from "/Libr...pkContextCMSPlugin/data/fixtures"
>> doctrine Loading data fixtures from "/Libr...gins/pkMediaPlugin/data/fixtures"
>> doctrine Loading data fixtures from "/Libr...ns/pkToolkitPlugin/data/fixtures"
>> doctrine Loading data fixtures from "/Libr...octrineGuardPlugin/data/fixtures"


Unknown record property / related component "sfguardgroup" on
"sfGuardGroupPermission"

$./symfony project:permissions
$./symfony pkToolkit:rebuild-search-index --env=dev

loading it up in a web browser then gives me a symfony page with a 404
in the middle.

since this is all pretty new to me I was on a google rampage while
trying to figure out the problem... one site i came across seemed to
fit since it's a symfony specific error...:
http://www.brainfault.com/2008/02/15/mysql-error-1005-hy000-cant-create-table-tablefrm-errno-150/

they offered up a suggestion they offered for finding more information
on the fault:
mysql>SHOW ENGINE INNODB STATUS;  

which spit out a bunch of stuff, but this is the relevant part:

------------------------
LATEST FOREIGN KEY ERROR
------------------------
091219 11:13:05 Error in foreign key constraint of table cmstest/
#sql-2f_4d3:
FOREIGN KEY (user_id) REFERENCES sf_guard_user(id) ON DELETE CASCADE:
Cannot find an index in the referenced table where the
referenced columns appear as the first columns, or column types
in the table and the referenced table do not match for constraint.
Note that the internal storage type of ENUM and SET changed in
tables created with >= InnoDB-4.1.12, and such columns in old tables
cannot be referenced by such columns in new tables.
See http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-constraints.html
for correct foreign key definition.


and the solution they came up with seems to be to disable the
constraints check?
SET FOREIGN_KEY_CHECKS = 0; -- TOP  
SET FOREIGN_KEY_CHECKS = 1; -- BOTTOM  

i couldn't find anywhere to insert that code though. it looks like
the schema.sql file is generated on the fly.

dunno if any of that helps or if it was something obvious that i'm too
new to see as obvious, but it would definitely be nice to get to the
bottom of this.

-david

Tom Boutell

unread,
Dec 19, 2009, 3:29:36 PM12/19/09
to pkcont...@googlegroups.com
Aha! Thanks for the detailed report.

My apologies David, I should have done an 'svn update' on my own copy
before declaring it safe and sound.

The issue is this:

Jon Wage decided last week to start making potentially
backwards-incompatible changes in the trunk of sfDoctrineGuardPlugin.

I had thought those changes wouldn't impact the CMS directly, but they
do: I need to be able to set up foreign key references to sfGuard
users, and jwage has stopped specifying 4-byte integers for IDs. He's
using Doctrine's default integer type (bigint) instead.

So for the moment I have changed the svn:externals for the plugins
folder to point to the 1.3 branch of sfDoctrineGuardPlugin, which
maintains backwards compatibility and is also fully Symfony
1.4-compliant. Best to let the dust settle with jwage's new
sfDoctrineGuard stuff before we ask folks to use it.

I'll have to investigate whether I can safely change my own schema.yml
files to use the default integer type for IDs in new installations
since that seems to be where things are going in other Symfony
plugins. That shouldn't pose a backwards compatibility problem for
existing projects. I could also write a task to carry out a Doctrine
migration for the plugin tables altering all of the integer types to
BIGINTs in a single go-round (perhaps removing and then recreating the
foreign key relationships would also be necessary).

* * *

At any rate: I've just committed this change. Type 'svn update' again
and then you should be able to repeat the build and data-load commands
successfully.

Thanks for the detailed bug report!

Tom Boutell

unread,
Dec 19, 2009, 3:31:47 PM12/19/09
to pkcont...@googlegroups.com
P.S. I have experienced some segmentation faults with PHP 5.3 and
Symfony. That shouldn't happen unless there's a bug in PHP itself. PHP
5.3.1 is out and 5.3.2 is not far away, but Apple doesn't seem to have
picked up the clue phone on that yet. So you might be better off
installing MAMP which is sticking with the PHP 5.2.x series for now.

On Sat, Dec 19, 2009 at 1:01 AM, IchBinGlitched
<ichbing...@gmail.com> wrote:

IchBinGlitched

unread,
Dec 19, 2009, 4:08:22 PM12/19/09
to pkcontextcms
aaaaaand.... success!!!

kinda. : )

it worked flawlessly when i started from scratch but that was after my
attempt at updating the pre-existing install failed.

$svn update did what it was supposed to but

$./symfony doctrine:build --all came up with a PHP error. I'm posting
the message just so you can see it and evaluate, but with a clean
checkout of the trunk i was up and running in a couple minutes.

thanks for taking the time to help out with this. I'm really looking
forward to seeing apostrophe at work.

-david

here's that PHP error...

PHP Warning: require(/Library/WebServer/Documents/sites/cmstest/
plugins/sfDoctrineGuardPlugin/lib/model/doctrine/
PluginsfGuardForgotPassword.class.php): failed to open stream: No such
file or directory in /Library/WebServer/Documents/sites/cmstest/lib/
vendor/symfony/lib/autoload/sfSimpleAutoload.class.php on line 123

Warning: require(/Library/WebServer/Documents/sites/cmstest/plugins/
sfDoctrineGuardPlugin/lib/model/doctrine/
PluginsfGuardForgotPassword.class.php): failed to open stream: No such
file or directory in /Library/WebServer/Documents/sites/cmstest/lib/
vendor/symfony/lib/autoload/sfSimpleAutoload.class.php on line 123

PHP Fatal error: require(): Failed opening required '/Library/
WebServer/Documents/sites/cmstest/plugins/sfDoctrineGuardPlugin/lib/
model/doctrine/PluginsfGuardForgotPassword.class.php' (include_path='/
Library/WebServer/Documents/sites/cmstest/lib/vendor:/Library/
WebServer/Documents/sites/cmstest/lib/vendor:.:/usr/lib/php') in /
Library/WebServer/Documents/sites/cmstest/lib/vendor/symfony/lib/
autoload/sfSimpleAutoload.class.php on line 123

Fatal error: require(): Failed opening required '/Library/WebServer/
Documents/sites/cmstest/plugins/sfDoctrineGuardPlugin/lib/model/
doctrine/PluginsfGuardForgotPassword.class.php' (include_path='/
Library/WebServer/Documents/sites/cmstest/lib/vendor:/Library/
WebServer/Documents/sites/cmstest/lib/vendor:.:/usr/lib/php') in /
Library/WebServer/Documents/sites/cmstest/lib/vendor/symfony/lib/
autoload/sfSimpleAutoload.class.php on line 123


Tom Boutell

unread,
Dec 19, 2009, 4:32:13 PM12/19/09
to pkcont...@googlegroups.com
You probably needed a symfony cc, and possibly also symfony
doctrine:clean. I know one of my coworkers saw this last week, perhaps
they will chime in later with what they did to clean it up. But I'm
glad you're up and running with a clean install!

Sid Bachtiar

unread,
Dec 19, 2009, 11:14:56 PM12/19/09
to pkcont...@googlegroups.com
Or save some trouble by using proper OS, e.g.: Linux :P

Juuuuust kidddiiiiing!!!

Merry Christmas and Happy New Year

Peace :D

Alex Gilbert

unread,
Dec 20, 2009, 6:34:01 PM12/20/09
to pkcont...@googlegroups.com
Yeah I dealt with that same error on a project. The forgot password
classes are new in the sfDoctrineGuardPlugin trunk. They get
autogenerated and placed in the project's lib. After I switched back
to the stable version of the plugin, they were still there hanging out
and looking for code that no longer existed. Once I deleted them from
my project I was back in action. Makes sense that you would have no
trouble with a clean install.

Enjoy!

--
Alex Gilbert
P'unk Avenue
215-755-1330
al...@punkave.com

Quentin Dugauthier

unread,
Dec 21, 2009, 2:05:40 AM12/21/09
to pkcont...@googlegroups.com
Just for the record, I experienced a problem with the newer sfDoctrineGuardPlugin as well.
They modified the __toString method of the sfGuardUser class, adding a reference to a firstname and lastname that did not exist in previous version, causing a fatal error in most of my layouts.

I'm rather disapointed of their choice. All my projects are based on this plugin and they will break backward compatibility at a moment where extending their plugin is easier than ever... I can't see the point there!

KR,

Quentin.
Reply all
Reply to author
Forward
0 new messages