Adding group permission to multiple repositories fails

Issue #207 resolved
DmitriMK
created an issue

Using the beta branch tip (a1ab3e9c7e82).

Created a group. Added the write permission for that group to two repositories successfully, but failed in the 3rd repository with the following message on the web page: error occurred during update of repository rhodecode

The log file contains the following error: {{{ 2011-06-13 18:08:23.771 ERROR [rhodecode.model.repo] Traceback (most recent call last): File "/export/hg/build/rhodecode/rhodecode/model/repo.py", line 146, in update self.sa.add(g2p) File "/opt/rhodecode/lib/python2.6/site-packages/SQLAlchemy-0.7.1-py2.6-solaris-2.10-sun4u.egg/sqlalchemy/orm/session.py", line 1141, in add self.save_or_update_state(state) File "/opt/rhodecode/lib/python2.6/site-packages/SQLAlchemy-0.7.1-py2.6-solaris-2.10-sun4u.egg/sqlalchemy/orm/session.py", line 1157, in _save_or_update_state self._save_or_update_impl(st) File "/opt/rhodecode/lib/python2.6/site-packages/SQLAlchemy-0.7.1-py2.6-solaris-2.10-sun4u.egg/sqlalchemy/orm/session.py", line 1382, in _save_or_update_impl self._update_impl(state) File "/opt/rhodecode/lib/python2.6/site-packages/SQLAlchemy-0.7.1-py2.6-solaris-2.10-sun4u.egg/sqlalchemy/orm/session.py", line 1374, in _update_impl self._attach(state) File "/opt/rhodecode/lib/python2.6/site-packages/SQLAlchemy-0.7.1-py2.6-solaris-2.10-sun4u.egg/sqlalchemy/orm/session.py", line 1408, in _attach state.session_id, self.hash_key)) InvalidRequestError: Object '<UsersGroup at 0x18aa630>' is already attached to session '26072592' (this is '31246160')

2011-06-13 18:08:23.773 ERROR [rhodecode.controllers.admin.repos] Traceback (most recent call last): File "/export/hg/build/rhodecode/rhodecode/controllers/admin/repos.py", line 237, in update repo_model.update(repo_name, form_result) File "/export/hg/build/rhodecode/rhodecode/model/repo.py", line 146, in update self.sa.add(g2p) File "/opt/rhodecode/lib/python2.6/site-packages/SQLAlchemy-0.7.1-py2.6-solaris-2.10-sun4u.egg/sqlalchemy/orm/session.py", line 1141, in add self.save_or_update_state(state) File "/opt/rhodecode/lib/python2.6/site-packages/SQLAlchemy-0.7.1-py2.6-solaris-2.10-sun4u.egg/sqlalchemy/orm/session.py", line 1157, in _save_or_update_state self._save_or_update_impl(st) File "/opt/rhodecode/lib/python2.6/site-packages/SQLAlchemy-0.7.1-py2.6-solaris-2.10-sun4u.egg/sqlalchemy/orm/session.py", line 1382, in _save_or_update_impl self._update_impl(state) File "/opt/rhodecode/lib/python2.6/site-packages/SQLAlchemy-0.7.1-py2.6-solaris-2.10-sun4u.egg/sqlalchemy/orm/session.py", line 1374, in _update_impl self._attach(state) File "/opt/rhodecode/lib/python2.6/site-packages/SQLAlchemy-0.7.1-py2.6-solaris-2.10-sun4u.egg/sqlalchemy/orm/session.py", line 1408, in _attach state.session_id, self.hash_key)) InvalidRequestError: Object '<UsersGroup at 0x18aa630>' is already attached to session '26072592' (this is '31246160') }}}

Comments (6)

  1. DmitriMK reporter

    This appears to affect the repositories that are clones. I again ran into this issue when I created a clone of py-bcrypt (https://py-bcrypt.googlecode.com/hg) in the rhodecode:

    2011-06-18 02:02:38.624 ERROR [rhodecode.model.repo] Traceback (most recent call last):
      File "/export/hg/build/rhodecode/rhodecode/model/repo.py", line 146, in update
        self.sa.add(g2p)
      File "/opt/rhodecode/lib/python2.6/site-packages/SQLAlchemy-0.7.1-py2.6-solaris-2.10-sun4u.egg/sqlalchemy/orm/session.py", line 1141, in add
        self._save_or_update_state(state)
      File "/opt/rhodecode/lib/python2.6/site-packages/SQLAlchemy-0.7.1-py2.6-solaris-2.10-sun4u.egg/sqlalchemy/orm/session.py", line 1157, in _save_or_update_state
        self._save_or_update_impl(st_)
      File "/opt/rhodecode/lib/python2.6/site-packages/SQLAlchemy-0.7.1-py2.6-solaris-2.10-sun4u.egg/sqlalchemy/orm/session.py", line 1382, in _save_or_update_impl
        self._update_impl(state)
      File "/opt/rhodecode/lib/python2.6/site-packages/SQLAlchemy-0.7.1-py2.6-solaris-2.10-sun4u.egg/sqlalchemy/orm/session.py", line 1374, in _update_impl
        self._attach(state)
      File "/opt/rhodecode/lib/python2.6/site-packages/SQLAlchemy-0.7.1-py2.6-solaris-2.10-sun4u.egg/sqlalchemy/orm/session.py", line 1408, in _attach
        state.session_id, self.hash_key))
    InvalidRequestError: Object '<UsersGroup at 0x2e747b0>' is already attached to session '53243504' (this is '48713296')
    
    2011-06-18 02:02:38.627 ERROR [rhodecode.controllers.admin.repos] Traceback (most recent call last):
      File "/export/hg/build/rhodecode/rhodecode/controllers/admin/repos.py", line 237, in update
        repo_model.update(repo_name, form_result)
      File "/export/hg/build/rhodecode/rhodecode/model/repo.py", line 146, in update
        self.sa.add(g2p)
      File "/opt/rhodecode/lib/python2.6/site-packages/SQLAlchemy-0.7.1-py2.6-solaris-2.10-sun4u.egg/sqlalchemy/orm/session.py", line 1141, in add
        self._save_or_update_state(state)
      File "/opt/rhodecode/lib/python2.6/site-packages/SQLAlchemy-0.7.1-py2.6-solaris-2.10-sun4u.egg/sqlalchemy/orm/session.py", line 1157, in _save_or_update_state
        self._save_or_update_impl(st_)
      File "/opt/rhodecode/lib/python2.6/site-packages/SQLAlchemy-0.7.1-py2.6-solaris-2.10-sun4u.egg/sqlalchemy/orm/session.py", line 1382, in _save_or_update_impl
        self._update_impl(state)
      File "/opt/rhodecode/lib/python2.6/site-packages/SQLAlchemy-0.7.1-py2.6-solaris-2.10-sun4u.egg/sqlalchemy/orm/session.py", line 1374, in _update_impl
        self._attach(state)
      File "/opt/rhodecode/lib/python2.6/site-packages/SQLAlchemy-0.7.1-py2.6-solaris-2.10-sun4u.egg/sqlalchemy/orm/session.py", line 1408, in _attach
        state.session_id, self.hash_key))
    InvalidRequestError: Object '<UsersGroup at 0x2e747b0>' is already attached to session '53243504' (this is '48713296')
    
  2. Marcin Kuzminski repo owner

    Is this something that can be reproduced ? I tried hard and couldn't achieve this. I'd push one revision into repo that might help, please test latest tip.

    If you'll get the same problem still please try to apply given patch and test.

    Thanks

  3. Log in to comment