Mercurial abort: index ... corrupt

I get the following error when trying to clone from a production repo.

abort: index data/HR3/globals.php.i is corrupted! 

After that, Mercury quickly leaves for me and cannot clone. I tried to delete the question file from the production repo and it failed. I also tried deleting the .hg directory in the production repo and re-adding and writing all the files. This leads to the same error.

Just fyi, I'm trying to clone the current production copy of our application on our test server. Our test server runs in Virtual Box.

UPDATE

I fixed the problem by deleting the globals file and then deleting the .hg directory and restarting "hg init" and "hg add". and "hg commit."

Now I get an internal server error when I try to clone. The following is the clone command that I used.

 sudo hg clone http://10.1.1.25/ www 

Oddly enough, mercurial tells me that the "real" url is "10.1.1.25/HR3/index.php", which is definitely not my mercury repository. I do not know why this is done. I checked the server in my logs and the next error is what Apache removed.

 [Thu Dec 16 12:25:30 2010] [error] [client 10.1.1.102] PHP Parse error: syntax error, unexpected T_STRING in /var/www/.hg/store/data/_h_r3/includes/_b_n_a_s/_b_n_a_s-_h_r_s201.php.i on line 22 

Apparently, the clone command forces Mercurial to run PHP and force it to parse something in the Mercurial data store?

Decision

I suspect this was due to the fact that I have an index.php file in the root directory of my repository that redirects. If you try to go directly to http: 10.1.1.25 on our network, you are automatically redirected to the index page, which is not the index.php page in the root directory. For some reason, I think this caused php to start and try to parse items in the mercurial store. I solved this problem by cloning over ssh.

+4
source share
2 answers

It seems that you are posting your repo using the static-http method from the same server as your development project. This method only works if the web server is not confused with $ URL / .hg, which you think seems to be. check if you can upload the .hg folder with wget -r -np $URL/.hg to a new folder and run hg verify there.

Oddly enough, mercurial tells me that the "real" URL is "10.1.1.25/HR3/index.php", which is definitely not my mercury repository.

I assume your web server is redirecting some Mercurial requests to your index.php url.

+2
source

I have encountered such an error before. Try to run

 hg verify 

in a damaged repository. Then follow the instructions from here:

http://www.softwareprojects.com/resources/programming/t-how-to-fix-mercurial-corrupt-repository-1926.html

+8
source

Source: https://habr.com/ru/post/1332400/


All Articles