Issue with modules based off blog engine

98 views
Skip to first unread message

gerard....@leadfusion.com

unread,
Jan 6, 2012, 12:17:31 PM1/6/12
to diem-users
Hi,

I've been wrestling with this one for awhile. Basically custom
modules do not work as intended. They save as records, can be managed
in admin, produce errors on save, do not show up in the list widget,
but loremize-generated ones do show up on the front end.

The short of it: I create models in schema.yml. I run php symfony
doctrine:build --sql and then php symfony doctrine:insert-sql instead
of doctrine:migrate. The reason is doctrine:migrate no longer builds
successfully.

I would love to be able to 'reset' doctrine:migrate, starting over on
migration_version, but I'm unsure as to how and simply removing lib/
migrations and resetting the db migration_version alone does not do
it. I've also removed all the generated tables, ect and nothing seems
to work. My only concern is losing all the dmFront content created on
the site thus far unrelated to list/show modules. There isn't any
clear direction for doing this online.

So after doctrine:insert-sql, I run dm:setup and then modify dm/
modules.yml. The show/list shows up on dmFront, but in dev, produces
the following error when more then one entry is added: [EXCEPTION]
SQLSTATE[HY000]: General error: 2014 Cannot execute queries while
other unbuffered queries are active. Consider using
PDOStatement::fetchAll(). Alternatively, if your code is only ever
going to run against mysql, you may enable query buffering by setting
the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.

I don't believe this is an error with doctrine as I did some digging,
updated php, tried declaring the mysql attribute, ect.

Here is what my schema.yml looks like:

News:
actAs: [ Timestampable, Sortable, DmVersionable ]
columns:
title: { type: string(255), notnull: true }
date: { type: date, notnull: true, unique: false }
excerpt: { type: string(800) }
body: { type: clob, extra: ckeditor }
image_id: { type: integer }
is_active: { type: boolean, notnull: true, default: false }
relations:
Image:
class: DmMedia
local: image_id

Event:
actAs: [ Timestampable, Sortable, DmVersionable ]
columns:
title: { type: string(255), notnull: true }
date: { type: date, notnull: true }
summary: { type: string(800) }
body: { type: clob, extra: ckeditor }
image_id: { type: integer }
is_active: { type: boolean, notnull: true, default: false }
relations:
Image:
class: DmMedia
local: image_id

Job:
actAs: [ Timestampable, Sortable, DmVersionable ]
columns:
title: { type: string(255), notnull: true }
summary: { type: string(800) }
body: { type: clob, extra: ckeditor }
is_active: { type: boolean, notnull: true, default: false }

And here is my modules.yml:

Content:

Global:

main: # the main module is required, and must not be
removed.
components:
header:
footer:

Articles:

news:
page: true

components:
show:
list:

event:
page: true

components:
show:
list:

Listings:

job:
page: true

components:
show:
list:


Any help with this is much appreciated... Thanks a lot


4levels

unread,
Jan 6, 2012, 1:38:40 PM1/6/12
to diem-...@googlegroups.com

Hi Gerard,

I think the culprid could be the use of a model named Event.  I remember having similar seemingly unexplainable errors when using a model named Event.  If I remember correctly, it is Doctrine interpreting the name Event that's causing the issue.

Can you try with a different name and see if this helps?  You can still name your modules Event if you need..

Hope this helps,

Kind regards,

Erik Van Kelst
IT specialist - OpenSource developer
--
sent from my mobile phone

gerard....@leadfusion.com

unread,
Jan 6, 2012, 1:49:48 PM1/6/12
to diem-users
This came up in the error logs for the event list.

Unknown record property / related component "summary" on "Event"

I had 'summary' named as 'excerpt' at some point, but I'm confused
because the database field matches summary as does the doctrine field
definition in admin. I might be missing something on the dmFront side
of things? Also, this is a sort of, one off error... the dmFront list/
show widgets produce errors even when this error is not present in
other models.

I would love to just delete every model/module I've attempted to
create and start over. It would be great to transfer records, but I
don't have so many that reentering is off the table...

I cannot afford to wipe everything clean though, I need all the
dmPages and such in tact.

Anyone have any thoughts on this?


On Jan 6, 9:17 am, "gerard.finne...@leadfusion.com"

gerard....@leadfusion.com

unread,
Jan 6, 2012, 1:55:20 PM1/6/12
to diem-users
Hi,

Thanks, I was wondering about that as well as the date field. In
addition, I ran into an error when I named a model "release", but
doctrine actually let me know that was a reserved word.

Any tips on wiping all these models and starting fresh? When i clear
schema.yml and delete the modules.yml references, there still seems to
be artifacts from those modules (for instance, I created an Article
model... removed it, but I can still find it places.)

I hope I'm not too 'all-over-the-map' on this thread.

On Jan 6, 10:38 am, 4levels <4lev...@gmail.com> wrote:
> Hi Gerard,
>
> I think the culprid could be the use of a model named Event.  I remember
> having similar seemingly unexplainable errors when using a model named
> Event.  If I remember correctly, it is Doctrine interpreting the name Event
> that's causing the issue.
>
> Can you try with a different name and see if this helps?  You can still
> name your modules Event if you need..
>
> Hope this helps,
>
> Kind regards,
>
> Erik Van Kelst
> IT specialist - OpenSource developer
> --
> sent from my mobile phone
> On Jan 6, 2012 6:17 PM, "gerard.finne...@leadfusion.com" <

4levels

unread,
Jan 6, 2012, 2:20:35 PM1/6/12
to diem-...@googlegroups.com

Hi Gerard,

You can clean your model files with a symfony doctrine task after removing them from your schema.yml.  Just type php symfony, you should find the command in the list.

Alternatively, you can delete all your custom model, form and filter files in your lib dir inclusive those in the base folders.  Also make sure to clean any autogenerated admin modules and drop the corresponding tables in your database. Empty the cache folder and do a php symfony cc(c)

Then try adding model by model and look for an alternative name for Event, I spent hours finding that on out.

Kind regards,

Erik Van Kelst
IT specialist - OpenSource developer
--
sent from my mobile phone

Stéphane

unread,
Jan 6, 2012, 7:26:16 PM1/6/12
to diem-...@googlegroups.com
doctrine:clean-model-files

If you are running into problems like "I see something I shouldn't see anymore", think of cache issue. Try restarting your apache/mysql + clearing your cache.

Regards,

gerard....@leadfusion.com

unread,
Jan 8, 2012, 2:24:54 AM1/8/12
to diem-users
The problem is actually that records do not seem to update their slug
correctly or not at all.

The models shown above do not seem to generate slugs for the 'show'
view properly. The show link on the admin side instead links to '/'
and the list view in dev shows the following instead of the title:
[EXCEPTION] SQLSTATE[HY000]: General error: 2014 Cannot execute
queries while other unbuffered queries are active. Consider using
PDOStatement::fetchAll(). Alternatively, if your code is only ever
going to run against mysql, you may enable query buffering by setting
the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.

I can post the full stack trace if that would help anyone.

The weird thing is if I loremize, those records display in the list
view just fine with proper slugs and titles, except they do not
loremize the body field, which uses ckeditor instead of markdown. If
I try to edit any of the loremized records via the admin interface I
receive the following:
Exception exception 'Doctrine_Transaction_Exception' with message
'Rollback failed. There is no active transaction.' in /home/webapps/
lfcms2/releases/20111018175912/lib/vendor/diem/symfony/lib/plugins/
sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Transaction.php:319

The changes show up in the database record and admin view even with
the error, but the record's slug was not updated to reflect the
changed title.

The scenario occurs with every module I create and has me totally
stumped. Could that really be just a caching issue? I always run
symfony cc(c) as part of my troubleshooting along with clearing the dm
front and admin caches.

I was concerned this issue was happening because I broke the
migration_version and thought it could be caused by using
doctrine:build --sql, doctrine:insert-sql, dm:setup instead of
doctrine:migrate, but that may not be the case.

I'll give your suggestions a try tonight and see what happens, but my
real issue may actually be something else?

Thanks again.

On Jan 6, 4:26 pm, Stéphane <stephane.er...@gmail.com> wrote:
> doctrine:clean-model-files
>
> If you are running into problems like "I see something I shouldn't see
> anymore", think of cache issue. Try restarting your apache/mysql + clearing
> your cache.
>
> Regards,
>
>
>
>
>
>
>
> On Fri, Jan 6, 2012 at 8:20 PM, 4levels <4lev...@gmail.com> wrote:
> > Hi Gerard,
>
> > You can clean your model files with a symfony doctrine task after removing
> > them from your schema.yml.  Just type php symfony, you should find the
> > command in the list.
>
> > Alternatively, you can delete all your custom model, form and filter files
> > in your lib dir inclusive those in the base folders.  Also make sure to
> > clean any autogenerated admin modules and drop the corresponding tables in
> > your database. Empty the cache folder and do a php symfony cc(c)
>
> > Then try adding model by model and look for an alternative name for Event,
> > I spent hours finding that on out.
>
> > Kind regards,
>
> > Erik Van Kelst
> > IT specialist - OpenSource developer
> > --
> > sent from my mobile phone
> > On Jan 6, 2012 7:55 PM, "gerard.finne...@leadfusion.com" <

gerard....@leadfusion.com

unread,
Jan 8, 2012, 2:56:16 AM1/8/12
to diem-users
Oh and project update stalls at page syncronization.

On Jan 7, 11:24 pm, "gerard.finne...@leadfusion.com"

Kye Etherton

unread,
Jan 8, 2012, 3:15:53 AM1/8/12
to diem-...@googlegroups.com
How many blogs do you have?

Sent from my iPhone

Jacek Jędrzejewski

unread,
Jan 8, 2012, 4:08:03 AM1/8/12
to diem-...@googlegroups.com
Remove tables, remove schema, manually delete models and base models, same for filters and forms, remove from modules.yml and delete modules from app/front and app/admin.

Then delete all contents of cache directory and run dm:setup. It MUST work.

gerard....@leadfusion.com

unread,
Jan 8, 2012, 5:46:40 AM1/8/12
to diem-users
Followed suggestions. Still the same issue with front list displays
and slugs, but updating project no longer stalls.

I removed tables, but there are still records in tables like
dm_auto_seo and dm_page_view. I removed everything from schema.yml or
are you referring to some other schema files (e.g. tmp/
timestamp_schema)?

I manually deleted models, filters, forms, removed references in
modules.yml and deleted modules from front and admin.
I ran doctrine:build --sql, doctrine:insert-sql, dm:setup

I recreated the news object and it was unfortunately exhibiting the
same bug.

I'm using symfony 1.4.7-DEV php 5.3.8

I also migrated the project from a local wamp instance to lamp
(centOS, AWS, rightscale deployment). Not sure if the difference in
environment could have affected things.

Kye, I don't have any blogs. One site, where I'm trying to create
three modules that resemble the Article example, but without comments,
author or translation. I also added a date field.


On Jan 8, 1:08 am, Jacek Jędrzejewski <jacek.jedrzejew...@gmail.com>
wrote:

gerard....@leadfusion.com

unread,
Jan 8, 2012, 6:22:54 AM1/8/12
to diem-users
And the site tree and xml site map still generate urls for all the
modules that were created and deleted including the individual records
that no longer exist...


On Jan 8, 2:46 am, "gerard.finne...@leadfusion.com"
<gerard.finne...@leadfusion.com> wrote:
> Followed suggestions.  Still the same issue with front list displays
> and slugs, but updating project no longer stalls.
>
> I removed tables, but there are still records in tables like
> dm_auto_seo and dm_page_view.  I removed everything from schema.yml or
> are you referring to some other schema files (e.g. tmp/
> timestamp_schema)?
>
> I manually deleted models, filters, forms, removed references in
> modules.yml and deleted modules from front and admin.
> I ran doctrine:build --sql, doctrine:insert-sql, dm:setup
>
> I recreated the news object and it was unfortunately exhibiting the
> same bug.
>
> I'm using symfony 1.4.7-DEV php 5.3.8
>
> I also migrated the project from a local wamp instance to lamp
> (centOS, AWS, rightscale deployment).  Not sure if the difference in
> environment could have affected things.
>
> Kye, I don't have any blogs.  One site, where I'm trying to create
> three modules that resemble the Article example, but without comments,
> author or translation.  I also added a date field.
>
> On Jan 8, 1:08 am, Jacek Jêdrzejewski <jacek.jedrzejew...@gmail.com>

4levels

unread,
Jan 8, 2012, 6:52:43 AM1/8/12
to diem-...@googlegroups.com

Hi Gerard,

This starts to sound really weird, I never experienced anything alike.  Have you restarted apache / php?  Are you using apc?

Kind regards,

Erik Van Kelst
IT specialist - OpenSource developer
--
sent from my mobile phone

gerard....@leadfusion.com

unread,
Jan 8, 2012, 7:10:46 AM1/8/12
to diem-users
Yeah, I use service httpd restart and service mysql restart. I use APC
and have only cleared opcode cache.

It definitely is very weird, especially because everything else works
great. I'm at the point where I may start with a fresh project and
rebuild, but I would have really liked to avoid that.

On Jan 8, 3:52 am, 4levels <4lev...@gmail.com> wrote:
> Hi Gerard,
>
> This starts to sound really weird, I never experienced anything alike.
> Have you restarted apache / php?  Are you using apc?
>
> Kind regards,
>
> Erik Van Kelst
> IT specialist - OpenSource developer
> --
> sent from my mobile phone
> On Jan 8, 2012 12:23 PM, "gerard.finne...@leadfusion.com" <

gerard....@leadfusion.com

unread,
Jan 8, 2012, 7:40:28 AM1/8/12
to diem-users
So, I created a new diem project from git, completed the installation
process and when I ran dm:setup, it failed with the same error I'm
experiencing in my current project. I've been trying to research this
error, but all I could dig up is that it never turns out to be too
descriptive of the actual problem :-/

>> tokens /home/webapps/lfcms/lib/model/doctrine/dmUserPlugin/base/BaseDmRecordPermissionGroup.class.php
>> tokens /home/webapps/lfcms/lib/model/doctrine/dmUserPlugin/base/BaseDmRecordPermissionUser.class.php
>> autoload Resetting application autoloaders
>> file- /home/webapps/lfcms/cache/admin/dev/config/config_autoload.yml.php
>> autoload Resetting application autoloaders
>> file- /home/webapps/lfcms/cache/admin/dev/config/config_autoload.yml.php
>> diem Loading adminConfiguration...
>> doctrine dropping tables

SQLSTATE[HY000]: General error: 2014 Cannot execute queries while
other unbuffered queries are active. Consider using
PDOStatement::fetchAll(). Alternatively, if your code is only ever
going to run against mysql, you may enable query buffering by setting
the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.



On Jan 8, 4:10 am, "gerard.finne...@leadfusion.com"

gerard....@leadfusion.com

unread,
Jan 9, 2012, 1:15:53 PM1/9/12
to diem-users
Built a new server, there was definitely an issue there, but there
still is a problem with the slugs on my model/modules. I ran
dm_check, only thing I don't have is pdo_pgsql and now apc, but
original server had apc.

So, new server same code base, same problems.

Going to try and scrub the db of all custom model records, not just
the tables.

Going to build a new project and see if it works there, then migrate
my site.


On Jan 9, 3:35 am, "k...@pimlicoplumbers.com"
<i...@pimlicoplumbers.com> wrote:
> if the install process itself finished then you can use dm_check.php
> to see if something is broken on the server.

gerard....@leadfusion.com

unread,
Jan 9, 2012, 8:08:03 PM1/9/12
to diem-users
There is definitely something wrong with my Diem project and how the
slugs are generated.

New server, this is the stack trace error I receive, same as the old
server:

Exception exception 'Doctrine_Transaction_Exception' with message
'Rollback failed. There is no active transaction.' in /home/webapps/
lfcms2/releases/20111018175912/lib/vendor/diem/symfony/lib/plugins/
sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Transaction.php:319
Stack trace: #0 /home/webapps/lfcms2/releases/20111018175912/lib/
vendor/diem/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/
Doctrine/Connection.php(1414): Doctrine_Transaction->rollback(NULL)
#1 /home/webapps/lfcms2/releases/20111018175912/lib/vendor/diem/
symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/
Connection/UnitOfWork.php(152): Doctrine_Connection->rollback() #2 /
home/webapps/lfcms2/releases/20111018175912/lib/vendor/diem/symfony/
lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/
Record.php(1718): Doctrine_Connection_UnitOfWork-
>saveGraph(Object(DmError)) #3 /home/webapps/lfcms2/releases/
20111018175912/lib/vendor/diem/dmCorePlugin/lib/debug/
dmErrorWatcher.php(96): Doctrine_Record->save() #4 /home/webapps/
lfcms2/releases/20111018175912/lib/vendor/diem/dmCorePlugin/lib/debug/
dmErrorWatcher.php(52): dmErrorWatcher-
>storeInDb(Object(dmErrorDescription)) #5 /home/webapps/lfcms2/
releases/20111018175912/lib/vendor/diem/dmCorePlugin/lib/debug/
dmErrorWatcher.php(34): dmErrorWatcher-
>handleException(Object(PDOException)) #6 [internal function]:
dmErrorWatcher->listenToThrowException(Object(sfEvent)) #7 /home/
webapps/lfcms2/releases/20111018175912/lib/vendor/diem/symfony/lib/
event_dispatcher/sfEventDispatcher.php(96): call_user_func(Array,
Object(sfEvent)) #8 /home/webapps/lfcms2/releases/20111018175912/lib/
vendor/diem/symfony/lib/exception/sfException.class.php(141):
sfEventDispatcher->notifyUntil(Object(sfEvent)) #9 /home/webapps/
lfcms2/releases/20111018175912/lib/vendor/diem/symfony/lib/exception/
sfException.class.php(110):
sfException::outputStackTrace(Object(PDOException)) #10 /home/webapps/
lfcms2/releases/20111018175912/lib/vendor/diem/symfony/lib/controller/
sfFrontWebController.class.php(56): sfException->printStackTrace()
#11 /home/webapps/lfcms2/releases/20111018175912/lib/vendor/diem/
dmCorePlugin/lib/context/dmContext.php(280): sfFrontWebController-
>dispatch() #12 /home/webapps/lfcms2/releases/20111018175912/web/
dev.php(7): dmContext->dispatch() #13 {main} thrown while notifying
exception exception 'PDOException' with message 'SQLSTATE[HY000]:
General error: 2014 Cannot execute queries while other unbuffered
queries are active. Consider using PDOStatement::fetchAll().
Alternatively, if your code is only ever going to run against mysql,
you may enable query buffering by setting the
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.' in /home/webapps/lfcms2/
releases/20111018175912/lib/vendor/diem/dmCorePlugin/lib/doctrine/
database/dmDb.php:57 Stack trace: #0 /home/webapps/lfcms2/releases/
20111018175912/lib/vendor/diem/dmCorePlugin/lib/doctrine/database/
dmDb.php(57): PDOStatement->execute(Array) #1 /home/webapps/lfcms2/
releases/20111018175912/lib/vendor/diem/dmCorePlugin/lib/i18n/
sfMessageSource_dm.php(45): dmDb::pdo('SELECT EXISTS(S...', Array) #2 /
home/webapps/lfcms2/releases/20111018175912/lib/vendor/diem/
dmCorePlugin/lib/i18n/sfMessageSource_dm.php(114): sfMessageSource_dm-
>isValidSource('messages.en') #3 /home/webapps/lfcms2/releases/
20111018175912/lib/vendor/diem/symfony/lib/i18n/
sfMessageFormat.class.php(139): sfMessageSource_dm->load('messages')
#4 /home/webapps/lfcms2/releases/20111018175912/lib/vendor/diem/
dmCorePlugin/lib/i18n/dmMessageFormat.php(35): sfMessageFormat-
>loadCatalogue('messages') #5 /home/webapps/lfcms2/releases/
20111018175912/lib/vendor/diem/dmCorePlugin/lib/i18n/dmI18n.php(69):
dmMessageFormat->formatFastOrFalse('Your modificati...', Array,
'messages') #6 /home/webapps/lfcms2/releases/20111018175912/lib/vendor/
diem/dmFrontPlugin/lib/i18n/dmFrontI18n.php(16): dmI18n-
>__orFalse('Your modificati...', Array, 'messages') #7 /home/webapps/
lfcms2/releases/20111018175912/lib/vendor/diem/dmFrontPlugin/modules/
dmCodeEditor/actions/actions.class.php(80): dmFrontI18n->__('Your
modificati...') #8 /home/webapps/lfcms2/releases/20111018175912/lib/
vendor/diem/symfony/lib/action/sfActions.class.php(60):
dmCodeEditorActions->executeSave(Object(dmWebRequest)) #9 /home/
webapps/lfcms2/releases/20111018175912/lib/vendor/diem/symfony/lib/
filter/sfExecutionFilter.class.php(92): sfActions-
>execute(Object(dmWebRequest)) #10 /home/webapps/lfcms2/releases/
20111018175912/lib/vendor/diem/symfony/lib/filter/
sfExecutionFilter.class.php(78): sfExecutionFilter-
>executeAction(Object(dmCodeEditorActions)) #11 /home/webapps/lfcms2/
releases/20111018175912/lib/vendor/diem/symfony/lib/filter/
sfExecutionFilter.class.php(42): sfExecutionFilter-
>handleAction(Object(sfFilterChain), Object(dmCodeEditorActions)) #12 /
home/webapps/lfcms2/releases/20111018175912/lib/vendor/diem/symfony/
lib/filter/sfFilterChain.class.php(53): sfExecutionFilter-
>execute(Object(sfFilterChain)) #13 /home/webapps/lfcms2/releases/
20111018175912/lib/vendor/diem/dmFrontPlugin/lib/filter/
dmFrontInitFilter.php(34): sfFilterChain->execute() #14 /home/webapps/
lfcms2/releases/20111018175912/lib/vendor/diem/symfony/lib/filter/
sfFilterChain.class.php(53): dmFrontInitFilter-
>execute(Object(sfFilterChain)) #15 /home/webapps/lfcms2/releases/
20111018175912/lib/vendor/diem/symfony/lib/filter/
sfBasicSecurityFilter.class.php(72): sfFilterChain->execute() #16 /
home/webapps/lfcms2/releases/20111018175912/lib/vendor/diem/symfony/
lib/filter/sfFilterChain.class.php(53): sfBasicSecurityFilter-
>execute(Object(sfFilterChain)) #17 /home/webapps/lfcms2/releases/
20111018175912/lib/vendor/diem/dmCorePlugin/plugins/dmUserPlugin/lib/
dmRememberMeFilter.class.php(56): sfFilterChain->execute() #18 /home/
webapps/lfcms2/releases/20111018175912/lib/vendor/diem/symfony/lib/
filter/sfFilterChain.class.php(53): dmRememberMeFilter-
>execute(Object(sfFilterChain)) #19 /home/webapps/lfcms2/releases/
20111018175912/lib/vendor/diem/symfony/lib/filter/
sfRenderingFilter.class.php(33): sfFilterChain->execute() #20 /home/
webapps/lfcms2/releases/20111018175912/lib/vendor/diem/symfony/lib/
filter/sfFilterChain.class.php(53): sfRenderingFilter-
>execute(Object(sfFilterChain)) #21 /home/webapps/lfcms2/releases/
20111018175912/lib/vendor/diem/symfony/lib/controller/
sfController.class.php(233): sfFilterChain->execute() #22 /home/
webapps/lfcms2/releases/20111018175912/lib/vendor/diem/symfony/lib/
controller/sfFrontWebController.class.php(48): sfController-
>forward('dmCodeEditor', 'save') #23 /home/webapps/lfcms2/releases/
20111018175912/lib/vendor/diem/dmCorePlugin/lib/context/
dmContext.php(280): sfFrontWebController->dispatch() #24 /home/webapps/
lfcms2/releases/20111018175912/web/dev.php(7): dmContext->dispatch()
#25 {main}

On Jan 9, 10:15 am, "gerard.finne...@leadfusion.com"
Message has been deleted

gerard....@leadfusion.com

unread,
Jan 11, 2012, 7:36:35 PM1/11/12
to diem-users
So I built a new server with a new install of diem.
Followed the blog/article exactly.

When I get to adding the components/list, diem's "update project"
fails.

When I run dm:sync, I receive the following error:

SQLSTATE[HY000]: General error: 2014 Cannot execute queries while
other unbuffered queries are active. Consider using
PDOStatement::fetchAll(). Alternatively, if your code is only ever
going to run against mysql, you may enable query buffering by setting
the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.. Failing Query:
"SELECT COUNT(*) AS num_results FROM dm_page d"

When I run this query from command line, I have no issue.

Could this be an issue with diem code, not using closecursor() or
fetchall()?

Is setting this attribute the answer?
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY.

I need to launch this site tomorrow and now I'm going to have to do so
without including any custom modules, which is no fun. :-(

Javier Neyra

unread,
Jan 11, 2012, 9:12:48 PM1/11/12
to diem-...@googlegroups.com
i made a little a research and found that the problem could be the
server (for example diferents version for mysql client and mysql
server).

if u give me ur code base and a database backup i can try to run it on
my instalation and see if it runs or give me the same error, maybe
that can help...

2012/1/11 gerard....@leadfusion.com <gerard....@leadfusion.com>:

Javier Neyra

unread,
Jan 11, 2012, 9:40:18 PM1/11/12
to diem-...@googlegroups.com
and for the problem u describe with the migrations, they can really be
a pain in the ass... i has been fighting with them long before
diem.... but they are really usefull.

first thing u need to know about migrations is DDL QUERYS CANT RUN IN
TRANSACTIONS (AT LEAST IN MYSQL) SO, THEY CANT BE ROLLED BACK.
second thing is: DOCTRINE DOESNT MAKE SAFE DDL QUERYS this means
doctrine doesnon put yours fields names between [`] (i dont know the
name of that character :P) so YOU CANT USE SQL RESERVED WORDS FOR
FIELDS OR TABLE NAMES (for example you canot use order, or exists for
a field name, this is the full list
http://dev.mysql.com/doc/refman/5.5/en/reserved-words.html)

when u dont have that 2 things in mind (like me, long time ago) u do
things like this one:

u define this table:


News:
actAs: [ Timestampable, Sortable, DmVersionable ]
columns:
title: { type: string(255), notnull: true }
date: { type: date, notnull: true, unique: false }
excerpt: { type: string(800) }
body: { type: clob, extra: ckeditor }
image_id: { type: integer }
is_active: { type: boolean, notnull: true, default: false }


run migrations, a creates the tables and all run fine.

and then u change your model like this

News:
actAs: [ Timestampable, Sortable, DmVersionable ]
columns:
title: { type: string(255), notnull: true }
date: { type: date, notnull: true, unique: false }
excerpt: { type: string(800) }
body: { type: clob, extra: ckeditor }
image_id: { type: integer }
is_active: { type: boolean, notnull: true, default: false }

user_id: { type: integer }
order: { type: integer }
relations:
User:
class: User
local: user_id

User:
columns:
name: { type: string(255), notnull: true }


looks fine right? well this kind of thing can mess ur life, the
migration version generated here will not run complete,

it will first create the user table, wich is OK
then it will try to add the 2 fields in the News tables
user id is OK
but ORDER its a reserved word, and this will throw an error, but for
the time this happend the user table is already in the database and
the user_id field is in the news table

u cant be able to roll it back, beacause it wont update the migration version,
and when u find the error is the field named order and change the name
and generate a new version you will find migrations broken and not
running saying than table exists, or field exist or someting like
that, and the only way to fix it is manually,
u need to find where the migrations scipt breaks and undo query by
query manually, then delete the broken version files, then fix ure
schema, and start again.

its a fucking pain in the ass... but with caution... u dont need to worry...

that is my expierience... and the only real issue i found in migrations.

2012/1/11 Javier Neyra <javier....@gmail.com>:

Evgeny Sinitsyn

unread,
Jan 11, 2012, 11:31:36 PM1/11/12
to diem-...@googlegroups.com
I faced with same isssue long time ago. And it have been solved.

I dunno about migrations, but for me everything worked fine with table named 'order'.
Only one thing you need it is specify 'quote_identifier: true' attribute in the databases.yml:

all:
  doctrine:
    class: sfDoctrineDatabase
    param:
      dsn: 'mysql:host=localhost;dbname=ASD'
      username: USERNAME
      password: MYPWD
      attributes:
        default_table_collate: utf8_general_ci
        default_table_charset: utf8
        quote_identifier: true


Regards

2012/1/12 Javier Neyra <javier....@gmail.com>

Jacek Jędrzejewski

unread,
Jan 12, 2012, 2:45:41 AM1/12/12
to diem-...@googlegroups.com
Javier Neyra - As far as I know, mysql engine MyISAM (which is a default table engine) does not support transactions.
Use InnoDB all the time, it is much better:

(schema.yml)

options:
  type: InnoDB

gerard....@leadfusion.com

unread,
Jan 12, 2012, 4:53:41 AM1/12/12
to diem-users
Yeah I did find that out the hard way for sure. I really appreciate
you all helping me get to the bottom of things.

I'm running a clean installation of diem now, in a new server
instance. My migrations run smoothly, without any errors, now that
things are fresh and I'm not falling for the same pitfalls that got me
into the original mess.

Here's the problem:

When I follow the diem 5.1 blog engine tutorial on creating articles
for the blog (not posts or comments), doctrine:migrate works, dm:setup
works, but when I go in to the admin and create any new "Articles",
they save without a slug and do not show up in the list widget. After
this, the project refresh fails at page synchronization. I'm using the
exact syntax for schema.yml and modules.yml as instructed in the
tutorial.

So, at this point, I try dm:sync, I receive the following error:

SQLSTATE[HY000]: General error: 2014 Cannot execute queries while
other unbuffered queries are active. Consider using
PDOStatement::fetchAll(). Alternatively, if your code is only ever
going to run against mysql, you may enable query buffering by setting
the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.. Failing Query:
"SELECT COUNT(*) AS num_results FROM dm_page d"

This query runs fine from command line and from what I've found
obsessively Googling this issue is that this type of error is caused
by using fetchone() without closing the cursor and instead of
fetchall(), which I do see happening in the page synchronization
code. I also read it could be php 5.2.3 being incompatible with i18n
and versionable. I'll need to try updating php, but I cant imagine
that I'm the only one using 5.2.3 with diem.

All my records in dm_page and the other associated tables are main
pages created through the front app.

I use the following plugins (perhaps one of them is
unstable)
'dmCkEditorPlugin',
'dmWidgetGalleryPlugin',
'dmContactPlugin',
'dmWidgetGalleryBackgroundPlugin',
'dmGoogleMapPlugin',
'dmWidgetNivoGalleryPlugin',
'dmFlowPlayerPlugin'

I'm starting to grasp at straws. My next step will be to run a dm
project fresh and only try following the blog engine tutorial. If I
experience the same issue in that situation at least I can say its
narrowed down to my environment, diem or the tutorial. I figure with
so many other people using diem and the tutorial without this issue,
its likely my environment.





On Jan 11, 6:40 pm, Javier Neyra <javier.javi...@gmail.com> wrote:
> and for the problem u describe with the migrations, they can really be
> a pain in the ass... i has been fighting with  them long before
> diem.... but they are really usefull.
>
> first thing u need to know about migrations is DDL QUERYS CANT RUN IN
> TRANSACTIONS (AT LEAST IN MYSQL) SO, THEY CANT BE ROLLED BACK.
> second thing is: DOCTRINE DOESNT MAKE SAFE DDL QUERYS this means
> doctrine doesnon put yours fields names between [`] (i dont know the
> name of that character :P) so YOU CANT USE SQL RESERVED WORDS FOR
> FIELDS OR TABLE NAMES (for example you canot use order, or exists for
> a field name, this is the full listhttp://dev.mysql.com/doc/refman/5.5/en/reserved-words.html)
> 2012/1/11 Javier Neyra <javier.javi...@gmail.com>:
>
>
>
>
>
>
>
> > i made a little a research and found that the problem could be the
> > server (for example diferents version for mysql client and mysql
> > server).
>
> > if u give me ur code base and a database backup i can try to run it on
> > my instalation and see if it runs or give me the same error, maybe
> > that can help...
>
> > 2012/1/11 gerard.finne...@leadfusion.com <gerard.finne...@leadfusion.com>:

Jacek Jędrzejewski

unread,
Jan 12, 2012, 5:08:55 AM1/12/12
to diem-...@googlegroups.com
I don't see "slug" or Sluggable behavior in Article model of blog tutorial ;) Are you sure your schema is ok? Could you share it?

gerard....@leadfusion.com

unread,
Jan 12, 2012, 6:50:42 AM1/12/12
to diem-users
Sorry, I think I used the wrong term. I meant the urls generated for
module records when setting page: true. The URLs that are supposed to
be dynamically generated and removed with the module records

Schema and modules were copied exactly from the tutorial.

On Jan 12, 2:08 am, Jacek Jędrzejewski <jacek.jedrzejew...@gmail.com>
wrote:

gerard

unread,
Jan 29, 2012, 10:39:26 PM1/29/12
to diem-users
This does not seem to work with Doctrine.

Fatal error: Undefined class constant
'Doctrine_Core::ATTR_MYSQL_ATTR_USE_BUFFERED_QUERY' in /var/www/lfcms/
lib/vendor/diem-5.1.3/symfony/lib/plugins/sfDoctrinePlugin/lib/
database/sfDoctrineDatabase.class.php on line 81

On Jan 8, 9:28 am, Jacek Jędrzejewski <jacek.jedrzejew...@gmail.com>
wrote:
> oh wait it's for propel..
>
> maybe like this in your databases.yml
>
> all:
>   doctrine:
>     class: sfDoctrineDatabase
>     param:
>       dsn: 'mysql:....'
>       username: ...
>       password: ...
>       attributes:
>         mysql_attr_use_buffered_query: true

gerard

unread,
Jan 29, 2012, 11:35:19 PM1/29/12
to diem-users
These attributes don't work for me.

According to http://www.symfony-project.org/reference/1_4/en/07-Databases

Scroll to the bottom, there's only a few doctrine attributes that can
be set.

On Jan 11, 8:31 pm, Evgeny Sinitsyn <cuh...@gmail.com> wrote:
> I faced with same isssue long time ago. And it have been solved.
>
> I dunno about migrations, but for me everything worked fine with table
> named 'order'.
> Only one thing you need it is specify
> 'quote_identifier<http://www.google.ru/search?sourceid=chrome&ie=UTF-8&q=quote_identifi...>:
> true' attribute in the databases.yml:
>
> all:
>   doctrine:
>     class: sfDoctrineDatabase
>     param:
>       dsn: 'mysql:host=localhost;dbname=ASD'
>       username: USERNAME
>       password: MYPWD
>       attributes:
>         default_table_collate: utf8_general_ci
>         default_table_charset: utf8
> *        quote_identifier: true*
>
> Regards
>
> 2012/1/12 Javier Neyra <javier.javi...@gmail.com>
> > 2012/1/11 Javier Neyra <javier.javi...@gmail.com>:
> > > i made a little a research and found that the problem could be the
> > > server (for example diferents version for mysql client and mysql
> > > server).
>
> > > if u give me ur code base and a database backup i can try to run it on
> > > my instalation and see if it runs or give me the same error, maybe
> > > that can help...
>
> > > 2012/1/11 gerard.finne...@leadfusion.com <gerard.finne...@leadfusion.com
> > >:

Jacek Jędrzejewski

unread,
Jan 8, 2012, 12:24:19 PM1/8/12
to diem-...@googlegroups.com
Have you tried solutions from google like this:


?

Looks like you have some non-standard configuration or smth.. dunno

W dniu niedziela, 8 stycznia 2012, 13:40:28 UTC+1 użytkownik gerard....@leadfusion.com napisał:
So, I created a new diem project from git, completed the installation
process and when I ran dm:setup, it failed with the same error I'm
experiencing in my current project.  I've been trying to research this
error, but all I could dig up is that it never turns out to be too
descriptive of the actual problem :-/

>> tokens    /home/webapps/lfcms/lib/model/doctrine/dmUserPlugin/base/BaseDmRecordPermissionGroup.class.php
>> tokens    /home/webapps/lfcms/lib/model/doctrine/dmUserPlugin/base/BaseDmRecordPermissionUser.class.php
>> autoload  Resetting application autoloaders
>> file-     /home/webapps/lfcms/cache/admin/dev/config/config_autoload.yml.php
>> autoload  Resetting application autoloaders
>> file-     /home/webapps/lfcms/cache/admin/dev/config/config_autoload.yml.php
>> diem      Loading adminConfiguration...
>> doctrine  dropping tables

  SQLSTATE[HY000]: General error: 2014 Cannot execute queries while
other unbuffered queries are active.  Consider using
PDOStatement::fetchAll().  Alternatively, if your code is only ever
going to run against mysql, you may enable query buffering by setting
the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.



On Jan 8, 4:10 am, "gerard....@leadfusion.com"
<gerard....@leadfusion.com> wrote:
> Yeah, I use service httpd restart and service mysql restart. I use APC
> and have only cleared opcode cache.
>
> It definitely is very weird, especially because everything else works
> great.  I'm at the point where I may start with a fresh project and
> rebuild, but I would have really liked to avoid that.
>
> On Jan 8, 3:52 am, 4levels <4le...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi Gerard,
>
> > This starts to sound really weird, I never experienced anything alike.
> > Have you restarted apache / php?  Are you using apc?
>
> > Kind regards,
>
> > Erik Van Kelst
> > IT specialist - OpenSource developer
> > --
> > sent from my mobile phone
> > On Jan 8, 2012 12:23 PM, "gerard....@leadfusion.com" <
>
> > gerard....@leadfusion.com> wrote:
> > > And the site tree and xml site map still generate urls for all the
> > > modules that were created and deleted including the individual records
> > > that no longer exist...
>
> > > On Jan 8, 2:46 am, "gerard....@leadfusion.com"
> > > <gerard....@leadfusion.com> wrote:
> > > > Followed suggestions.  Still the same issue with front list displays
> > > > and slugs, but updating project no longer stalls.
>
> > > > I removed tables, but there are still records in tables like
> > > > dm_auto_seo and dm_page_view.  I removed everything from schema.yml or
> > > > are you referring to some other schema files (e.g. tmp/
> > > > timestamp_schema)?
>
> > > > I manually deleted models, filters, forms, removed references in
> > > > modules.yml and deleted modules from front and admin.
> > > > I ran doctrine:build --sql, doctrine:insert-sql, dm:setup
>
> > > > I recreated the news object and it was unfortunately exhibiting the
> > > > same bug.
>
> > > > I'm using symfony 1.4.7-DEV php 5.3.8
>
> > > > I also migrated the project from a local wamp instance to lamp
> > > > (centOS, AWS, rightscale deployment).  Not sure if the difference in
> > > > environment could have affected things.
>
> > > > Kye, I don't have any blogs.  One site, where I'm trying to create
> > > > three modules that resemble the Article example, but without comments,
> > > > author or translation.  I also added a date field.
>
> > > > On Jan 8, 1:08 am, Jacek Jêdrzejewski <jacek.jed...@gmail.com>

Jacek Jędrzejewski

unread,
Jan 8, 2012, 12:28:05 PM1/8/12
to diem-...@googlegroups.com
oh wait it's for propel..

maybe like this in your databases.yml

all:
  doctrine:
    class: sfDoctrineDatabase
    param:

i...@pimlicoplumbers.com

unread,
Jan 8, 2012, 4:22:57 PM1/8/12
to diem-users
Just a few things

php symfony doctrine:migrate 20 //rolls back to migration 20. You said
you wanted to know how. Just use a numebr after migrate!

php symfony doctrine:clean //Removes all unused model files to save
deleting by hand.

gerard....@leadfusion.com

unread,
Jan 8, 2012, 7:18:01 PM1/8/12
to diem-users
Yeah I tried that.
I also confirmed the conditional added to doctrine in Connection.php
to account for PDO constants as per http://www.doctrine-project.org/jira/browse/DC-59

I'm thinking it must be something with my server configuration, since
I couldn't even run the initial dm:setup after a clean install of
diem.

I just have no specific idea about what... I'm thinking pdo/pdo_mysql
not installed properly or...something.

With respect to doctrine:migrate my migration versions were very
broken, so migrating up or down did not work, I didn't try
doctrine:clean until the damage was done, so now I have no migration
files to move up and down through and reset the migration_version in
the table back to 0. But when I attempt doctrine:migrate it says no
files in the migration folder... however that's more an after thought
right now to the issue with PDO, since I can't even perform a clean
project install as it is currently.

On Jan 8, 1:22 pm, "k...@pimlicoplumbers.com"

i...@pimlicoplumbers.com

unread,
Jan 9, 2012, 6:35:25 AM1/9/12
to diem-users
Reply all
Reply to author
Forward
0 new messages