freeze when i select existing mysql database

Bug #574370 reported by pinguinodentro
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Griffith
New
Undecided
Unassigned

Bug Description

Hi, i have 2 copy of griffith in 2 computer. Griffith database is on another computer with mysql installed.

I have add all film with one of two computer, after that i have tried to open griffith on the second computer. In previous version of griffith this operation work fine. Now if i open griffith i obtain this error:

simone@simone:~$ griffith -D
2010-05-03T12:41:40: DEBUG: Griffith(gconsole:86): Starting Griffith 0.11
2010-05-03T12:41:40: DEBUG: Griffith(gconsole:87): Platform: Linux-2.6.32-21-generic-i686-with-Ubuntu-10.04-lucid (posix)
2010-05-03T12:41:40: DEBUG: Griffith(gconsole:88): Dependencies:
gtk :: 2.17.0
gtk.glade :: 2.17.0
sqlalchemy :: 0.5.8
sqlite3 :: 2.4.1
reportlab :: 2.4
PIL :: True
psycopg2 :: 2.0.13 (dt dec mx ext pq3)
MySQLdb :: 1.2.2.final.0
chardet :: 2.0.1
sqlite :: False
2010-05-03T12:41:40: DEBUG: Griffith(griffith:1467): config file used: /home/simone/.griffith/griffith.cfg
2010-05-03T12:41:40: INFO: Griffith(initialize:102): Using Griffith directory: /home/simone/.griffith
/usr/share/griffith/lib/initialize.py:140: GtkWarning: GtkSpinButton: setting an adjustment with non-zero page size is deprecated
  define_widgets(self, gtk.glade.XML(gf))
/usr/share/griffith/lib/widgets.py:364: DeprecationWarning: Use the new widget gtk.Tooltip
  self.widgets['tooltips'] = gtk.Tooltips()
/usr/share/griffith/lib/widgets.py:365: DeprecationWarning: Use the new widget gtk.Tooltip
  self.widgets['tooltips'].set_tip(self.widgets['preferences']['epdf_reader'], _('Define here the PDF reader you want to use within Griffith. Popular choices are xpdf, gpdf, evince or kpdf. Make sure you have this program installed and working first.'))
/usr/share/griffith/lib/widgets.py:366: DeprecationWarning: Use the new widget gtk.Tooltip
  self.widgets['tooltips'].set_tip(self.widgets['preferences']['spell_lang'], _("Here you can define the desired language to use while spell checking some fields. Use you locale setting. For example, to use european portuguese spell checking enter 'pt'"))
/usr/share/griffith/lib/widgets.py:367: DeprecationWarning: Use the new widget gtk.Tooltip
  self.widgets['tooltips'].set_tip(self.widgets['preferences']['mail_smtp_server'], _("Use this entry to define the SMTP server you want to use to send e-mails. On *nix systems, 'localhost' should work. Alternatively, you can use your Internet Service Provider's SMTP server address."))
/usr/share/griffith/lib/widgets.py:368: DeprecationWarning: Use the new widget gtk.Tooltip
  self.widgets['tooltips'].set_tip(self.widgets['preferences']['mail_email'], _("This is the from e-mail address that should be used to all outgoing e-mail. You want to include your own e-mail address here probably."))
/usr/share/griffith/lib/widgets.py:369: DeprecationWarning: Use the new widget gtk.Tooltip
  self.widgets['tooltips'].set_tip(self.widgets['preferences']['mail_smtp_port'], _("Here you can define the smtp server port to use. If you want to use your gmail account service to send e-mails, try to enter '587' here. Default (and the most common one) is '25'"))
/usr/share/griffith/lib/widgets.py:370: DeprecationWarning: Use the new widget gtk.Tooltip
  self.widgets['tooltips'].set_tip(self.widgets['preferences']['mail_use_tls'], _("If you need TLS support, please check this checkbox. This is needed, for example, when using gmail service to send your reminder e-mails."))
/usr/share/griffith/lib/plugins/extensions/__init__.py:70: DeprecationWarning: object.__new__() takes no parameters
  obj = object.__new__(class_, *args, **kwargs)
/usr/share/griffith/lib/initialize.py:537: DeprecationWarning:
  ext.toolbar_icon_widget = toolbar.insert_stock(module.toolbar_icon, module.description, None, ext._on_toolbar_icon_clicked, None, -1)
/usr/share/griffith/lib/main_treeview.py:152: DeprecationWarning: Use the new widget gtk.Tooltip
  self.widgets['tooltips'].set_tip(w['region'], self._regions[0]) # N/A
2010-05-03T12:41:41: DEBUG: Griffith(sql:262): SELECT movies.number, movies.o_title, movies.title, movies.director, movies.poster_md5, movies.genre, movies.seen, movies.year, movies.runtime, movies.rating
FROM movies ORDER BY movies.number ASC
2010-05-03T12:41:59: INFO: Griffith(preferences:454): DATABASE: connecting to new db server...
2010-05-03T12:41:59: INFO: Griffith(preferences:472): New database Engine: mysql
2010-05-03T12:42:00: DEBUG: Griffith(sql:262): SELECT movies.movie_id, movies.number, movies.collection_id, movies.volume_id, movies.medium_id, movies.ratio_id, movies.vcodec_id, movies.poster_md5, movies.loaned, movies.seen, movies.rating, movies.color, movies.cond, movies.layers, movies.region, movies.media_num, movies.runtime, movies.year, movies.width, movies.height, movies.barcode, movies.o_title, movies.title, movies.director, movies.screenplay, movies.cameraman, movies.o_site, movies.site, movies.trailer, movies.country, movies.genre, movies.studio, movies.classification, movies.cast, movies.plot, movies.notes, movies.image
FROM movies ORDER BY movies.number ASC
Traceback (most recent call last):
  File "/usr/bin/griffith", line 272, in save_preferences
    save_preferences(self)
  File "/usr/share/griffith/lib/preferences.py", line 481, in save_preferences
    self.filter_txt(None)
  File "/usr/bin/griffith", line 1129, in filter_txt
    quick_filter.change_filter(self)
  File "/usr/share/griffith/lib/quick_filter.py", line 46, in change_filter
    self.populate_treeview(statement)
  File "/usr/bin/griffith", line 976, in populate_treeview
    main_treeview.populate(self, statement, where)
  File "/usr/share/griffith/lib/main_treeview.py", line 489, in populate
    filename = gutils.get_image_fname(movie.poster_md5, self.db, "s")
  File "/usr/share/griffith/lib/gutils.py", line 736, in get_image_fname
    if not os.path.isfile(file_name) and not create_image_cache(md5sum, gsql):
  File "/usr/share/griffith/lib/gutils.py", line 666, in create_image_cache
    poster = session.query(db.Poster).filter_by(md5sum=md5sum).first()
  File "/usr/lib/pymodules/python2.6/sqlalchemy/orm/query.py", line 1300, in first
    ret = list(self[0:1])
  File "/usr/lib/pymodules/python2.6/sqlalchemy/orm/query.py", line 1221, in __getitem__
    return list(res)
  File "/usr/lib/pymodules/python2.6/sqlalchemy/orm/query.py", line 1361, in __iter__
    return self._execute_and_instances(context)
  File "/usr/lib/pymodules/python2.6/sqlalchemy/orm/query.py", line 1364, in _execute_and_instances
    result = self.session.execute(querycontext.statement, params=self._params, mapper=self._mapper_zero_or_none())
  File "/usr/lib/pymodules/python2.6/sqlalchemy/orm/session.py", line 752, in execute
    return self.__connection(engine, close_with_result=True).execute(
  File "/usr/lib/pymodules/python2.6/sqlalchemy/orm/session.py", line 717, in __connection
    return self.transaction._connection_for_bind(engine)
  File "/usr/lib/pymodules/python2.6/sqlalchemy/orm/session.py", line 329, in _connection_for_bind
    conn = bind.contextual_connect()
  File "/usr/lib/pymodules/python2.6/sqlalchemy/engine/base.py", line 1229, in contextual_connect
    return self.Connection(self, self.pool.connect(), close_with_result=close_with_result, **kwargs)
  File "/usr/lib/pymodules/python2.6/sqlalchemy/pool.py", line 142, in connect
    return _ConnectionFairy(self).checkout()
  File "/usr/lib/pymodules/python2.6/sqlalchemy/pool.py", line 304, in __init__
    rec = self._connection_record = pool.get()
  File "/usr/lib/pymodules/python2.6/sqlalchemy/pool.py", line 161, in get
    return self.do_get()
  File "/usr/lib/pymodules/python2.6/sqlalchemy/pool.py", line 631, in do_get
    raise exc.TimeoutError("QueuePool limit of size %d overflow %d reached, connection timed out, timeout %d" % (self.size(), self.overflow(), self._timeout))
sqlalchemy.exc.TimeoutError: QueuePool limit of size 5 overflow 10 reached, connection timed out, timeout 30

I have already tried to edit add.py with the instruction of "Freezes when adding 8th movie" bug 512484, but doesn't work.

I have tried to copy the folder .griffith in /home from one computer to other, and now work.

Griffith seems unable to download film from database due to too many connections not closed.

In database i have about 1000 film.

I do not speak English well, I hope you understand me

Revision history for this message
Jonathon James (isamaranga) wrote :

I am encountering the same error in a similar situation. The griffith database is located on a server networked with two clients. One client can access the database and is able too add, remove, edit and retrieve records. The other client, however, encounters the same error as above ("sqlalchemy.exc.TimeoutError: QueuePool limit of size 5 overflow 10 reached, connection timed out, timeout 30"). I tested the connection on both machines when there were approximately 10 movies in the database. Now there are ~130, and the second machine can no longer access the database.
Thanks for your help!

Revision history for this message
Jonathon James (isamaranga) wrote :

To be more specific: the second machine IS able to achieve limited access to the database. It is able to display the total number of movies in the database in the status bar before it freezes and crashes with the above error.

Revision history for this message
Michael (mikej06) wrote :

I tried to describe a possible solution in another griffith forum:
http://forum.griffith.cc/index.php/topic,1082.msg3981.html#msg3981

I describe some changes you can make and check out. Perhaps
that will fix the error:

    * open the file sql.py
    * change the line

from sqlalchemy.orm import sessionmaker
to
from sqlalchemy.orm import scoped_session, sessionmaker

    * add the line

Session = scoped_session(sessionmaker())
after the line
log = logging.getLogger("Griffith")

Revision history for this message
lolo (n-contact-laurent-beaulaton-fr) wrote :

Hi all,

I have had more or less the same bug.
I have a griffith database (postgresql) on my windows pc with 364 movies (with 361 posters).
I try to switch on my ubuntu pc. I copy my postgresql database and try to open griffith. It crashes before being fully opened.
I read this post and edit the sql.py, but still not opening.

I finally find two workaround:
- I just paste and copy the posters folder from my windows pc to my ubuntu pc, and then griffith work
- I run griffith (through griffith --debug option) again and again. I see the posters folder growing up until in fact all poster are in it. and then griffith opened.

I hope this will help some people and help the developper to fix this bug.

Griffith is a very usefull software. thanks for that

Revision history for this message
Michael (mikej06) wrote :

I finally found a possible fix/workaround. Most of the steps I described in my previous post are the same, last one differs:

    * open the file sql.py
    * change the line

from sqlalchemy.orm import sessionmaker
to
from sqlalchemy.orm import scoped_session, sessionmaker

    * look for the line

self.Session = sessionmaker(bind=engine) ...

    * change it to

self.Session = scoped_session(sessionmaker(bind=engine)) ...

Revision history for this message
Celso Macêdo (celsovsm) wrote :

Hello!!!

I had the same problem and your workaround(#5) fixed the error.

Thank you!!!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.