paster setup-app fails to create schema

53 views
Skip to first unread message

MHCPU

unread,
Dec 11, 2012, 10:50:09 AM12/11/12
to turbo...@googlegroups.com
Can anyone give me some guidance where to look for this problem?  I written a Turbogears app that I've been repeatedly installing as I continue development.  I have a test instance and when the database schema changes my re-installation includes dropping the database and running "paster setup-app production.ini".  This worked fine until recently and created the schema as expected.  Now it seems to quietly do nothing.  I run the command, it terminates with no output, and no tables are created.  Oddly, this was "fixed" once by logging out and back in and running it.  But that no longer helps.  Where might paster end before it does anything?

Thanks for any help,
Matthew

MHCPU

unread,
Dec 11, 2012, 3:39:27 PM12/11/12
to turbo...@googlegroups.com
More info: It seems that the setup_app function in websetup/__init__.py is not being called.  It seems as though that's what would call setup_schema in websetup/schema.py.

I'm running TG 2.1.5 with Python 2.6.6.

Matthew

MHCPU

unread,
Dec 11, 2012, 5:00:30 PM12/11/12
to turbo...@googlegroups.com
Re-ran the installation with TG 2.20 -- same problem.

Matthew

Carlos Daniel Ruvalcaba Valenzuela

unread,
Dec 11, 2012, 5:51:18 PM12/11/12
to turbo...@googlegroups.com
Hi,

What database are you using?, is this problem the same with different
databases (sqlite for example)?, did you include your models inside
models/__init__.py ?

Regards,
Carlos Ruvalcaba
> --
> You received this message because you are subscribed to the Google Groups
> "TurboGears" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/turbogears/-/rvK9H9xeeAEJ.
>
> To post to this group, send email to turbo...@googlegroups.com.
> To unsubscribe from this group, send email to
> turbogears+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/turbogears?hl=en.

Matthew Cahn

unread,
Dec 11, 2012, 6:22:24 PM12/11/12
to turbo...@googlegroups.com
Good question -- MySQL.  It worked with sqlite, and then I switched to MySQL for deployment, and it still worked.  Then it suddenly stopped working.  Yes, the table classes are imported into models/__init__.py.

Matthew

Carlos Daniel Ruvalcaba Valenzuela

unread,
Dec 11, 2012, 6:35:25 PM12/11/12
to turbo...@googlegroups.com
Have you tried switching to sqlite to check if it still works?, it
could also be a problem with MySQL permissions, connectivity with the
DB, etc.

You could try adding the -v option (for verbose), to see of you can
get some output:

paster setup-app -v production.ini

There is also the options to simulate and to run it interactively, but
quite frankly I haven't seen them work at all.

Regards,
Carlos Ruvalcaba

Matthew Cahn

unread,
Dec 12, 2012, 9:20:53 AM12/12/12
to turbo...@googlegroups.com
Thanks for the suggestions.  Unfortunately switching to sqlite did the same thing -- "paster setup-app production.ini" quietly does nothing.  Adding -v made no difference.  I don't think it's a MySQL permissions or connectivity problem, because I can log into the database with the same credentials used by the app with no problem, and those things haven't changed.  I think that for some reason the code that's supposed to create the tables is simply never called, but I haven't tracked down what's supposed to call it.

Matthew

Alessandro Molina

unread,
Dec 13, 2012, 4:23:52 PM12/13/12
to TurboGears .
If paster-setup is not calling your websetup module at all (you can check this by adding a print or something like that to the websetup/__init__,py) the issue is probably related to the .ini file.

Paster setup-app command checks for a section named app:main inside the ini file and reads the top_level.txt file inside the egg-info.
This file reports a list of directories which are checked for a websetup module inside of them and the setup_app function inside the module is called.

if your setup_app function is not called at all you should check the configuration .ini file, top_level.txt, and the websetup/__init__.py probably one of them is not in shape.

Matthew Cahn

unread,
Dec 13, 2012, 5:46:26 PM12/13/12
to turbo...@googlegroups.com
Thanks Alessandro.  The problem was in fishdb.egg-info/top_level.txt as it relates to my directory structure.  top_level.txt contained a list of my application modules, including websetup.  But I was running paster from a directory one level up, named fishdb.  Changing top_level.txt to simply read "fishdb" caused it to work.  I must be doing something inconsistent in how I create the egg info vs how I run paster that I'll have to track down. Anyway, you hit the nail on the head, thanks for your help.

Matthew
Reply all
Reply to author
Forward
0 new messages