Pull request error

Pavel's Avatar

Pavel

06 Sep, 2016 07:04 PM

Hi, when i try "close pull request" or comment "pull request" i get error 500. In log file:
Error - <class 'sqlalchemy.orm.exc.FlushError'>: New instance <UserNotification at 0x7f8a400f8ad0> with identity key (<class 'rhodecode.model.db.UserNotification'>, (35, 4905)) conflicts with persistent instance <UserNotification at 0x7f8a40253590>
File '/opt/rhodecode/store/4awiprfqs8sg65b6r45rp214ycfbylab-python2.7-WebError-0.10.3/lib/python2.7/site-packages/weberror/errormiddleware.py', line 162 in __call__
  app_iter = self.application(environ, sr_checker)
File '/opt/rhodecode/store/05h54mqfk3krpzqqb618jr3n6qim7ixd-python2.7-Beaker-1.7.0/lib/python2.7/site-packages/beaker/middleware.py', line 155 in __call__
  return self.wrap_app(environ, session_start_response)
File '/opt/rhodecode/store/czjm7r1lv8dcgyrwyrs0xqh53z02x8yw-python2.7-Routes-1.13/lib/python2.7/site-packages/routes/middleware.py', line 131 in __call__
  response = self.app(environ, start_response)
File '/opt/rhodecode/store/aprj8ivps6hmxdnwsfxi5dcxa2i3zc64-python2.7-Pylons-1.0.2/lib/python2.7/site-packages/pylons/wsgiapp.py', line 103 in __call__
  response = self.dispatch(controller, environ, start_response)
File '/opt/rhodecode/store/aprj8ivps6hmxdnwsfxi5dcxa2i3zc64-python2.7-Pylons-1.0.2/lib/python2.7/site-packages/pylons/wsgiapp.py', line 313 in dispatch
  return controller(environ, start_response)
File '/opt/rhodecode/store/jlh7kck7wnm99l9i338gqvxrpg1zll5i-python2.7-RhodeCodeEnterprise-3.6.1/lib/python2.7/site-packages/rhodecode/lib/base.py', line 458 in __call__
File '/opt/rhodecode/store/aprj8ivps6hmxdnwsfxi5dcxa2i3zc64-python2.7-Pylons-1.0.2/lib/python2.7/site-packages/pylons/controllers/core.py', line 214 in __call__
  response = self._dispatch_call()
File '/opt/rhodecode/store/aprj8ivps6hmxdnwsfxi5dcxa2i3zc64-python2.7-Pylons-1.0.2/lib/python2.7/site-packages/pylons/controllers/core.py', line 164 in _dispatch_call
  response = self._inspect_call(func)
File '/opt/rhodecode/store/aprj8ivps6hmxdnwsfxi5dcxa2i3zc64-python2.7-Pylons-1.0.2/lib/python2.7/site-packages/pylons/controllers/core.py', line 107 in _inspect_call
  result = self._perform_call(func, args)
File '/opt/rhodecode/store/aprj8ivps6hmxdnwsfxi5dcxa2i3zc64-python2.7-Pylons-1.0.2/lib/python2.7/site-packages/pylons/controllers/core.py', line 57 in _perform_call
  return func(**args)
File '<string>', line 2 in comment
File '/opt/rhodecode/store/jlh7kck7wnm99l9i338gqvxrpg1zll5i-python2.7-RhodeCodeEnterprise-3.6.1/lib/python2.7/site-packages/rhodecode/lib/auth.py', line 1093 in __wrapper
File '<string>', line 2 in comment
File '/opt/rhodecode/store/jlh7kck7wnm99l9i338gqvxrpg1zll5i-python2.7-RhodeCodeEnterprise-3.6.1/lib/python2.7/site-packages/rhodecode/lib/auth.py', line 1133 in __wrapper
File '<string>', line 2 in comment
File '/opt/rhodecode/store/jlh7kck7wnm99l9i338gqvxrpg1zll5i-python2.7-RhodeCodeEnterprise-3.6.1/lib/python2.7/site-packages/rhodecode/lib/auth.py', line 1189 in __wrapper
File '<string>', line 2 in comment
File '/opt/rhodecode/store/jlh7kck7wnm99l9i338gqvxrpg1zll5i-python2.7-RhodeCodeEnterprise-3.6.1/lib/python2.7/site-packages/rhodecode/lib/auth.py', line 1012 in __wrapper
File '<string>', line 2 in comment
File '/opt/rhodecode/store/jlh7kck7wnm99l9i338gqvxrpg1zll5i-python2.7-RhodeCodeEnterprise-3.6.1/lib/python2.7/site-packages/rhodecode/lib/utils.py', line 948 in jsonify
File '/opt/rhodecode/store/jlh7kck7wnm99l9i338gqvxrpg1zll5i-python2.7-RhodeCodeEnterprise-3.6.1/lib/python2.7/site-packages/rhodecode/controllers/pullrequests.py', line 647 in comment
File '/opt/rhodecode/store/jlh7kck7wnm99l9i338gqvxrpg1zll5i-python2.7-RhodeCodeEnterprise-3.6.1/lib/python2.7/site-packages/rhodecode/model/comment.py', line 231 in create
File '/opt/rhodecode/store/jlh7kck7wnm99l9i338gqvxrpg1zll5i-python2.7-RhodeCodeEnterprise-3.6.1/lib/python2.7/site-packages/rhodecode/model/notification.py', line 101 in create
File '/opt/rhodecode/store/jlh7kck7wnm99l9i338gqvxrpg1zll5i-python2.7-RhodeCodeEnterprise-3.6.1/lib/python2.7/site-packages/rhodecode/model/db.py', line 3347 in create
File '/opt/rhodecode/store/62hhxag8g8faldg26yfmjixzgxxcpkph-python2.7-SQLAlchemy-0.9.9/lib/python2.7/site-packages/sqlalchemy/orm/attributes.py', line 239 in __get__
  return self.impl.get(instance_state(instance), dict_)
File '/opt/rhodecode/store/62hhxag8g8faldg26yfmjixzgxxcpkph-python2.7-SQLAlchemy-0.9.9/lib/python2.7/site-packages/sqlalchemy/orm/attributes.py', line 591 in get
  value = self.callable_(state, passive)
File '/opt/rhodecode/store/62hhxag8g8faldg26yfmjixzgxxcpkph-python2.7-SQLAlchemy-0.9.9/lib/python2.7/site-packages/sqlalchemy/orm/strategies.py', line 535 in _load_for_state
  return self._emit_lazyload(session, state, ident_key, passive)
File '<string>', line 1 in <lambda>
File '/opt/rhodecode/store/62hhxag8g8faldg26yfmjixzgxxcpkph-python2.7-SQLAlchemy-0.9.9/lib/python2.7/site-packages/sqlalchemy/orm/strategies.py', line 604 in _emit_lazyload
  result = q.all()
File '/opt/rhodecode/store/62hhxag8g8faldg26yfmjixzgxxcpkph-python2.7-SQLAlchemy-0.9.9/lib/python2.7/site-packages/sqlalchemy/orm/query.py', line 2323 in all
  return list(self)
File '/opt/rhodecode/store/jlh7kck7wnm99l9i338gqvxrpg1zll5i-python2.7-RhodeCodeEnterprise-3.6.1/lib/python2.7/site-packages/rhodecode/lib/caching_query.py', line 84 in __iter__
File '/opt/rhodecode/store/62hhxag8g8faldg26yfmjixzgxxcpkph-python2.7-SQLAlchemy-0.9.9/lib/python2.7/site-packages/sqlalchemy/orm/query.py', line 2440 in __iter__
  self.session._autoflush()
File '/opt/rhodecode/store/62hhxag8g8faldg26yfmjixzgxxcpkph-python2.7-SQLAlchemy-0.9.9/lib/python2.7/site-packages/sqlalchemy/orm/session.py', line 1264 in _autoflush
  self.flush()
File '/opt/rhodecode/store/62hhxag8g8faldg26yfmjixzgxxcpkph-python2.7-SQLAlchemy-0.9.9/lib/python2.7/site-packages/sqlalchemy/orm/session.py', line 1985 in flush
  self._flush(objects)
File '/opt/rhodecode/store/62hhxag8g8faldg26yfmjixzgxxcpkph-python2.7-SQLAlchemy-0.9.9/lib/python2.7/site-packages/sqlalchemy/orm/session.py', line 2103 in _flush
  transaction.rollback(_capture_exception=True)
File '/opt/rhodecode/store/62hhxag8g8faldg26yfmjixzgxxcpkph-python2.7-SQLAlchemy-0.9.9/lib/python2.7/site-packages/sqlalchemy/util/langhelpers.py', line 60 in __exit__
  compat.reraise(exc_type, exc_value, exc_tb)
File '/opt/rhodecode/store/62hhxag8g8faldg26yfmjixzgxxcpkph-python2.7-SQLAlchemy-0.9.9/lib/python2.7/site-packages/sqlalchemy/orm/session.py', line 2067 in _flush
  flush_context.execute()
File '/opt/rhodecode/store/62hhxag8g8faldg26yfmjixzgxxcpkph-python2.7-SQLAlchemy-0.9.9/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py', line 372 in execute
  rec.execute(self)
File '/opt/rhodecode/store/62hhxag8g8faldg26yfmjixzgxxcpkph-python2.7-SQLAlchemy-0.9.9/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py', line 526 in execute
  uow
File '/opt/rhodecode/store/62hhxag8g8faldg26yfmjixzgxxcpkph-python2.7-SQLAlchemy-0.9.9/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py', line 46 in save_obj
  uowtransaction)
File '/opt/rhodecode/store/62hhxag8g8faldg26yfmjixzgxxcpkph-python2.7-SQLAlchemy-0.9.9/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py', line 171 in _organize_states_for_save
  state_str(existing)))
FlushError: New instance <UserNotification at 0x7f9c6ed95e50> with identity key (<class 'rhodecode.model.db.UserNotification'>, (35, 4905)) conflicts with persistent instance <UserNotification at 0x7f9c6ed84e90>

CGI Variables
-------------
  CONTENT_TYPE: 'application/x-www-form-urlencoded'
  HTTP_ACCEPT: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
  HTTP_ACCEPT_ENCODING: 'gzip, deflate'
  HTTP_ACCEPT_LANGUAGE: 'ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4'
  HTTP_CACHE_CONTROL: 'max-age=0'
  HTTP_CONNECTION: 'close'
  HTTP_COOKIE: 'session=f22cf8de-f27f-4155-bd0b-6c6b48942d81; rhodecode=b8df2b5018a6e3b11630601a41d5e8d4c8e4934522bd94d0fbb94bf0a483ee6514975142'
  HTTP_HOST: 'rhodecode.brn.ru'
  HTTP_ORIGIN: 'http://rhodecode.brn.ru'
  HTTP_REFERER: 'http://rhodecode.brn.ru/Barrier/gui/pull-request/1905'
  HTTP_UPGRADE_INSECURE_REQUESTS: '1'
  HTTP_USER_AGENT: 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36'
  HTTP_X_FORWARDED_FOR: '192.168.61.130'
  HTTP_X_REAL_IP: '192.168.61.130'
  PATH_INFO: '/Barrier/gui/pull-request-comment/1905'
  RAW_URI: '/Barrier/gui/pull-request-comment/1905'
  REMOTE_ADDR: '192.168.62.139'
  REMOTE_PORT: '37004'
  REQUEST_METHOD: 'POST'
  SERVER_NAME: '0.0.0.0'
  SERVER_PORT: '5000'
  SERVER_PROTOCOL: 'HTTP/1.0'
  SERVER_SOFTWARE: 'gunicorn/19.3.0'

WSGI Variables
--------------
  application: <beaker.middleware.SessionMiddleware object at 0x7f9c73198c90>
  beaker.get_session: <bound method SessionMiddleware._get_session of <beaker.middleware.SessionMiddleware object at 0x7f9c73198c90>>
  beaker.session: {'_creation_time': 1471530019.5178, 'csrf_token': '67b00eaa760564b1b51ee42815834542cba3016f', 'rhodecode_user': {'username': u'pavel', 'password': 'a32898f8cd6aa02ca245', 'is_authenticated': True, 'user_id': 49}, '_accessed_time': 1473175788.083754}
  gunicorn.socket: <socket._socketobject object at 0x7f9c6f8c98a0>
  paste.registry: <paste.registry.Registry object at 0x7f9c6ef8e250>
  paste.throw_errors: True
  pylons.action_method: <bound method PullrequestsController.comment of <rhodecode.controllers.pullrequests.PullrequestsController object at 0x7f9c6ed86b50>>
  pylons.controller: <rhodecode.controllers.pullrequests.PullrequestsController object at 0x7f9c6ed86b50>
  pylons.environ_config: {'session': 'beaker.session', 'cache': 'beaker.cache'}
  pylons.log_debug: True
  pylons.pylons: <pylons.util.PylonsContext object at 0x7f9c6e9cda50>
  pylons.routes_dict: {'repo_name': u'Barrier/gui, 'pull_request_id': u'1905', 'controller': u'pullrequests', 'action': u'comment'}
  routes.cached_hostinfo: {'host': 'rhodecode.brn.ru', 'protocol': 'http'}
  routes.route: <routes.route.Route object at 0x7f9c73af6ad0>
  routes.url: <routes.util.URLGenerator object at 0x7f9c6f04ac50>
  webob._body_file: (<_io.BufferedReader>, <cStringIO.StringI object at 0x7f9c6edac140>)
  webob._parsed_post_vars: (MultiDict([('text', u'test'), ('changeset_status', u''), ('save', u'Comment')]), <_io.BufferedReader>)
  webob._parsed_query_vars: (GET([]), '')
  webob.adhoc_attrs: {'errors': 'ignore'}
  webob.is_body_readable: True
  webob.is_body_seekable: False
  wsgi process: 'Multiprocess'
  wsgi._org_proto: 'http'
  wsgi.file_wrapper: <class 'gunicorn.http.wsgi.FileWrapper'>
  wsgiorg.routing_args: (<routes.util.URLGenerator object at 0x7f9c6f04ac50>, {'repo_name': u'Barrier/gui', 'pull_request_id': u'1905', 'controller': u'pullrequests', 'action': u'comment'})

It fix when i delete reviewers from pull request, after this it works fine.

  1. Support Staff 1 Posted by Marcin Kuzminsk... on 13 Oct, 2016 06:36 PM

    Marcin Kuzminski's Avatar

    Hi,

    could you provide a way to reproduce this issue ?
    Also what database are you using ?

  2. 2 Posted by Pavel on 24 Oct, 2016 05:55 AM

    Pavel's Avatar

    Hi, we use sqlite, and i think that is the problem, so i will migrate to postgresql.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

15 Oct, 2018 12:10 PM
15 Oct, 2018 05:20 AM
10 Oct, 2018 08:11 AM
03 Oct, 2018 01:16 PM
01 Oct, 2018 08:41 AM

 

28 Sep, 2018 10:12 AM
26 Sep, 2018 04:34 AM
21 Sep, 2018 04:40 PM
20 Sep, 2018 07:42 PM
18 Sep, 2018 03:30 PM
11 Sep, 2018 09:12 AM