Project

General

Profile

Actions

Bug #5444

open

Error while creating a pull request on a Mercurial repository

Added by Michael Davis over 6 years ago. Updated over 6 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
28.02.2018
Due date:
% Done:

0%

Estimated time:
Sorting:
Commit Number:
Affected Version:

Description

We installed the update to RhodeCode Enterprise 4.11.5 last night (we were previously on 4.10.6, I think). Today, one of our users reported an error when trying to create a pull request on a Mercurial repository. Digging into the log files, I found these errors logged:

From enterprise.log:

2018-02-28 14:35:48.989 ERROR [rhodecode.apps.repository.views.repo_pull_requests] Error occurred during creation of this pull request.
Traceback (most recent call last):
  File "/opt/rhodecode/store/hrv1v1186rjwls7qbb8c3h45dv9n1frd-python2.7-rhodecode-enterprise-ce-4.11.5/lib/python2.7/site-packages/rhodecode/apps/repository/views/repo_pull_requests.py", line 837, in pull_request_create
    pullrequest_title, description, reviewer_rules
  File "/opt/rhodecode/store/hrv1v1186rjwls7qbb8c3h45dv9n1frd-python2.7-rhodecode-enterprise-ce-4.11.5/lib/python2.7/site-packages/rhodecode/model/pull_request.py", line 524, in create
    pull_request, user=created_by_user, translator=translator)
  File "/opt/rhodecode/store/hrv1v1186rjwls7qbb8c3h45dv9n1frd-python2.7-rhodecode-enterprise-ce-4.11.5/lib/python2.7/site-packages/rhodecode/model/pull_request.py", line 1629, in validate
    pull_request, translator=translator)
  File "/opt/rhodecode/store/hrv1v1186rjwls7qbb8c3h45dv9n1frd-python2.7-rhodecode-enterprise-ce-4.11.5/lib/python2.7/site-packages/rhodecode/model/pull_request.py", line 1228, in merge_status
    resp = self._try_merge(pull_request)
  File "/opt/rhodecode/store/hrv1v1186rjwls7qbb8c3h45dv9n1frd-python2.7-rhodecode-enterprise-ce-4.11.5/lib/python2.7/site-packages/rhodecode/model/pull_request.py", line 1291, in _try_merge
    pull_request, target_vcs, target_ref)
  File "/opt/rhodecode/store/hrv1v1186rjwls7qbb8c3h45dv9n1frd-python2.7-rhodecode-enterprise-ce-4.11.5/lib/python2.7/site-packages/rhodecode/model/pull_request.py", line 1324, in _refresh_merge_state
    close_branch=close_branch)
  File "/opt/rhodecode/store/hrv1v1186rjwls7qbb8c3h45dv9n1frd-python2.7-rhodecode-enterprise-ce-4.11.5/lib/python2.7/site-packages/rhodecode/lib/vcs/backends/base.py", line 478, in merge
    use_rebase=use_rebase, close_branch=close_branch)
  File "/opt/rhodecode/store/hrv1v1186rjwls7qbb8c3h45dv9n1frd-python2.7-rhodecode-enterprise-ce-4.11.5/lib/python2.7/site-packages/rhodecode/lib/vcs/backends/hg/repository.py", line 785, in _merge_repo
    source_ref, use_rebase=use_rebase, dry_run=dry_run)
  File "/opt/rhodecode/store/hrv1v1186rjwls7qbb8c3h45dv9n1frd-python2.7-rhodecode-enterprise-ce-4.11.5/lib/python2.7/site-packages/rhodecode/lib/vcs/backends/hg/repository.py", line 619, in _local_merge
    self._update(target_ref.commit_id)
  File "/opt/rhodecode/store/hrv1v1186rjwls7qbb8c3h45dv9n1frd-python2.7-rhodecode-enterprise-ce-4.11.5/lib/python2.7/site-packages/rhodecode/lib/vcs/backends/hg/repository.py", line 579, in _update
    self._remote.update(revision, clean=clean)
  File "/opt/rhodecode/store/hrv1v1186rjwls7qbb8c3h45dv9n1frd-python2.7-rhodecode-enterprise-ce-4.11.5/lib/python2.7/site-packages/rhodecode/lib/vcs/client_http.py", line 125, in f
    return self._call(name, *args, **kwargs)
  File "/opt/rhodecode/store/hrv1v1186rjwls7qbb8c3h45dv9n1frd-python2.7-rhodecode-enterprise-ce-4.11.5/lib/python2.7/site-packages/rhodecode/lib/vcs/client_http.py", line 144, in _call_with_logging
    return RemoteRepo._call(self, name, *args, **kwargs)
  File "/opt/rhodecode/store/hrv1v1186rjwls7qbb8c3h45dv9n1frd-python2.7-rhodecode-enterprise-ce-4.11.5/lib/python2.7/site-packages/rhodecode/lib/vcs/exceptions.py", line 212, in wrapper
    raise _EXCEPTION_MAP[kind](*args)
UnhandledException: dirty() got an unexpected keyword argument 'missing'

From vcsserver.log:

2018-02-28 14:35:48.839 ERROR [vcsserver.hg] Unhandled exception in hg remote call
Traceback (most recent call last):
  File "/opt/rhodecode/store/dfz1mkwm7v373c40jim1njh17sqgdnlh-python2.7-rhodecode-vcsserver-4.11.5/lib/python2.7/site-packages/vcsserver/hg.py", line 76, in wrapper
    return func(*args, **kwargs)
  File "/opt/rhodecode/store/dfz1mkwm7v373c40jim1njh17sqgdnlh-python2.7-rhodecode-vcsserver-4.11.5/lib/python2.7/site-packages/vcsserver/hg.py", line 659, in update
    commands.update(baseui, repo, node=node, clean=clean)
  File "/opt/rhodecode/store/hgp03jrdni84hg60af1pw36swfwq3rm4-python2.7-mercurial-4.4.2/lib/python2.7/site-packages/mercurial/commands.py", line 5517, in update
    updatecheck=updatecheck)
  File "/opt/rhodecode/store/hgp03jrdni84hg60af1pw36swfwq3rm4-python2.7-mercurial-4.4.2/lib/python2.7/site-packages/mercurial/hg.py", line 817, in updatetotally
    ret = _update(repo, checkout, updatecheck=updatecheck)
  File "/opt/rhodecode/store/hgp03jrdni84hg60af1pw36swfwq3rm4-python2.7-mercurial-4.4.2/lib/python2.7/site-packages/mercurial/hg.py", line 754, in update
    stats = updaterepo(repo, node, False, updatecheck=updatecheck)
  File "/opt/rhodecode/store/hgp03jrdni84hg60af1pw36swfwq3rm4-python2.7-mercurial-4.4.2/lib/python2.7/site-packages/mercurial/hg.py", line 750, in updaterepo
    updatecheck=updatecheck)
  File "/opt/rhodecode/store/hgp03jrdni84hg60af1pw36swfwq3rm4-python2.7-mercurial-4.4.2/lib/python2.7/site-packages/hgext/largefiles/overrides.py", line 1441, in mergeupdate
    result = orig(repo, node, branchmerge, force, *args, **kwargs)
  File "/opt/rhodecode/store/hgp03jrdni84hg60af1pw36swfwq3rm4-python2.7-mercurial-4.4.2/lib/python2.7/site-packages/mercurial/merge.py", line 1892, in update
    if not branchmerge and not wc.dirty(missing=True):
  File "/opt/rhodecode/store/hgp03jrdni84hg60af1pw36swfwq3rm4-python2.7-mercurial-4.4.2/lib/python2.7/site-packages/mercurial/context.py", line 1532, in dirty
    if self.sub(s).dirty(missing=missing):
TypeError: dirty() got an unexpected keyword argument 'missing'
Actions #1

Updated by Marcin Kuzminski [CTO] over 6 years ago

Hi Michael,

This looks like a bug in Mercurial internals, is that repo with problems an largefiles repo ? (do you have largefiles extension enabled in rhodecode?)

Actions #2

Updated by Michael Davis over 6 years ago

Marcin Kuzminski [staff] wrote:

Hi Michael,

This looks like a bug in Mercurial internals, is that repo with problems an largefiles repo ? (do you have largefiles extension enabled in rhodecode?)

Yes, the largefiles extension is enabled.

Actions #3

Updated by Marcin Kuzminski [CTO] over 6 years ago

Hi Michael,

It looks like in case of subrepos something in Mercurial handling got changed.

We're going to work on a fix, for now, please locate a file called
hgpatches.py it should be located at: /opt/rhodecode/store/dfz1mkwm7v373c40jim1njh17sqgdnlh-python2.7-rhodecode-vcsserver-4.11.5/lib/python2.7/site-packages/vcsserver/hgpatches.py

Inside that file, please change the dirty() function to one below:

        def dirty(self, ignoreupdate=False, missing=False):
            """returns true if the dirstate of the subrepo is dirty or does not
            match current stored state. If ignoreupdate is true, only check
            whether the subrepo has uncommitted changes in its dirstate.
            """
            return False

close and save the file, and also remove compiled PYC file at /opt/rhodecode/store/dfz1mkwm7v373c40jim1njh17sqgdnlh-python2.7-rhodecode-vcsserver-4.11.5/lib/python2.7/site-packages/vcsserver/hgpatches.pyc

After that and restart of vcsserver things should be ok!

Actions #4

Updated by Michael Davis over 6 years ago

I made those changes and we were able to get the pull request to go through successfully. Thanks!

Actions #5

Updated by Redmine Integration over 6 years ago

  • Status changed from New to Resolved
Actions #6

Updated by Redmine Integration over 6 years ago

Commit f24cf18d7d3f by Marcin Kuzminski marcin@rhodecode.com on default branch changed this issue. https://code.rhodecode.com/rhodecode-vcsserver/changeset/f24cf18d7d3ffa71086097cd18cc98578bf869a9

Actions

Also available in: Atom PDF