Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What causes git push to fail all of a sudden with "User was holding a relation lock for too long"? [closed]

Tags:

git

bitbucket

I came back to some code I had open after a few hours and made some changes to the code and then pushed it. All of a sudden, I am getting this error:

sura@raitorial:~/workspace/conse (master) $ git push  Counting objects: 15, done. Delta compression using up to 8 threads. Compressing objects: 100% (6/6), done. Writing objects: 100% (6/6), 492 bytes | 0 bytes/s, done. Total 6 (delta 5), reused 0 (delta 0) remote: canceling statement due to conflict with recovery remote: LINE 1: ...er"."date_joined" FROM "bb_repository" INNER JOIN "auth_user... remote:                                                              ^ remote: DETAIL:  User was holding a relation lock for too long. remote:  To [email protected]:sureumar__/conse.git  ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to '[email protected]:sureumar__/conse.git' sura@raitorial:~/workspace/conse (master) $  

How can I diagnose the cause of this error?

like image 455
LovingRails Avatar asked Jun 16 '16 01:06

LovingRails


People also ask

How do I fix a pre declined git hook?

To fix this error, you can: Mark the master branch as unprotected (in settings > protected branches). Give yourself the permission to push (if you are not the administrator of the git repository, you will need to ask an administrator to permit you to push to the main branch).

What does pre receive Hook declined mean?

Your commits were rejected by the pre-receive hook of that repo (that's a user-configurable script that is intended to analyze incoming commits and decide if they are good enough to be accepted into the repo). It is also a good idea to ask that person to update the hook, so it would print the reasons for the rejection.

What is push command in git?

The git push command is used to upload local repository content to a remote repository. Pushing is how you transfer commits from your local repository to a remote repo. It's the counterpart to git fetch , but whereas fetching imports commits to local branches, pushing exports commits to remote branches.


1 Answers

As the message indicates, this is a problem on Bitbucket's end. You can check the status of their services by visiting http://status.bitbucket.org/, which will inform you (for example):

Verifying - We are gradually restoring inbox content to mitigate any further replication issues. Any messages you'd expect to be there should re-appear slowly as we incrementally complete scheduled maintenance.
Jun 16, 03:22 UTC

Update - Maintenance on the primary database caused excessive lag on replicas used for authenticating Git and Mercurial operations over HTTPS. We've failed over to a spare replica and restored service. Please contact our support team if you're still experiencing problems with your pushes or pulls.
Jun 16, 02:48 UTC

In progress - We're seeing unanticipated complications on gitweb and hgweb traffic, which we are currently working to resolve. Please watch this page for updates.
Jun 16, 02:03 UTC

If no current issues are listed there, contact support.

like image 97
kuvic Avatar answered Sep 20 '22 07:09

kuvic