Bug 5971 - "repository changed while pushing" error should be clearer that it's the remote repository that changed
Summary: "repository changed while pushing" error should be clearer that it's the remo...
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 3.7.3
Hardware: All All
: normal bug
Assignee: Bugzilla
URL:
Keywords: easy
Depends on:
Blocks:
 
Reported: 2018-08-26 15:21 UTC by teo8976
Modified: 2018-10-20 00:00 UTC (History)
4 users (show)

See Also:
Python Version: ---


Attachments
Added keyword remote to 'repository changed while pushing' error (32.50 KB, patch)
2018-10-10 08:47 UTC, Taapas Agrawal
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description teo8976 2018-08-26 15:21 UTC
I am trying to push a repository where the latest commits contain lots of changes (thousands of added files), so it is expected that it takes long.

At the first attempt I got a "gateway timeout" error, probably the server's fault.

At the second attempt, however, and after several minutes uploading data, I got a bullshit error: "repository changed while pushing. Please try again".

Nothing changed in the repository. If something really changed by just stadning idle in front of the computer, and doesn't show up doing "hg status", then it's something irrelevant that shouldn't cause this error.

When performing such operations that take long is precisely when one needs the software to be more resilient. That stuff fails in the middle of uploading several megabytes after several minutes, is particularly annoying because it makes you waste a lot of time.
Comment 1 Boris Feld 2018-08-27 05:31 UTC
I've put the ticket in priority normal according to our bug triaging process https://www.mercurial-scm.org/wiki/ManagingBugs#Priorities.

The "repository changed while pushing" message is indicating that the server repository changed during the second push. What may happened is the first push data correctly arrived to the hg server but the configured timeout in your gateway (often 60s) was not enough for the hg server to finish processing it. In addition, the hg server continues to process data even in case the connection is dropped by the gateway.

When you tried to pushed a second time, the server was still processing the first push and when it finished, it told you that between the time it received the second push and the time it starts processing it, the server repository changed.

You can try two things:
- Increase your timeout duration
- If you have this kind of errors while pushing multiple independent heads, you can tune the concurent push mode setting (`hg help server.concurrent-push-mode` is your friend).
Comment 2 teo8976 2018-08-27 06:50 UTC
I see.

The error should be clearer, e.g. "REMOTE repository changed while pushing".

It's not obvious, I thought it referred to local changes.
Comment 3 Augie Fackler 2018-08-28 14:08 UTC
Sure, someone should add "remote" somewhere in that error message.
Comment 4 Taapas Agrawal 2018-10-10 08:47 UTC
Created attachment 2021 [details]
Added keyword remote to 'repository changed while pushing' error
Comment 5 HG Bot 2018-10-12 10:10 UTC
Fixed by https://mercurial-scm.org/repo/hg/rev/58ebf5083843
Taapas Agrawal <taapas2897@gmail.com>
push: add "remote" to 'repository changed while pushing' messages (issue5971)

Differential Revision: https://phab.mercurial-scm.org/D4933

(please test the fix)
Comment 6 Bugzilla 2018-10-20 00:00 UTC
Bug was set to TESTING for 7 days, resolving