Closed cleverdevil closed 10 years ago
Are you using the code from the 0.9.3 release (which is current master codebase)? It looks like the /feeds query has been improperly written.
Also, which version of Pewee and database backend are you using?
Yes, on master:
(coldsweat)dhc-user@feeds:~/coldsweat$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: .gitignore
# modified: coldsweat/app.py
#
Installed packages:
(coldsweat)dhc-user@feeds:~/coldsweat$ pip freeze
Tempita==0.5.1
WebOb==1.3.1
argparse==1.2.1
distribute==0.6.34
feedparser==5.1.3
gunicorn==18.0
peewee==2.2.5
psycopg2==2.5.2
requests==2.3.0
wsgiref==0.1.2
I am using PostgreSQL:
(coldsweat)dhc-user@feeds:~/coldsweat$ psql --version
psql (PostgreSQL) 9.1.11
HTH!
Cannot reproduce the problem with a fresh installation cloned from master. I tried both with SQLite and MySQL. Unfortunately right now I cannot test with PostgreSQL.
I was running Peewee 2.2.3, but even after the upgrade to version 2.2.5 things ran smoothly.
Can you reproduce the error with SQLite?
Just tried to reproduce in sqlite, and could not. It appears to be a Peewee issue with PostgreSQL.
Ha! I think I figured out what the problem is. I'll fix & test more thoroughly in the next release. However, in the meantime if you want to patch by yourself open up coldsweat/frontend.py file and at line 555 replace the get_feeds()
function with:
def get_feeds(user, *select):
select = select or [Feed, Icon, fn.Count(Entry.id).alias('entries')]
q = Feed.select(*select).join(Icon).switch(Feed).join(Entry, JOIN_LEFT_OUTER).switch(Feed).join(Subscription).where(Subscription.user == user).group_by(Feed, Icon)
return q
That indeed did work. Its a bit slow, but at least its not crashing now :)
The good news is that Icon model will be removed in the future (see #26) so we'll spare that join/group_by too.
I get the following stack trace: