I'm a git & github user that's new to mercurial & bitbucket and I'm trying to use bitbucket for a project.
So far I've got write access to a new private bitbucket repository, and I got started by:
cloning
adding my existing project
committing
trying push, I get authorization failed via:
HTTPS
$ hg push https://mariusbutuc#bitbucket.org/DB2UAdmin/repo
http authorization required
realm: Bitbucket.org HTTP
user: mariusbutuc
password:
pushing to https://mariusbutuc#bitbucket.org/DB2UAdmin/repo
searching for changes
abort: authorization failed
SSH
$ hg push ssh://hg#bitbucket.org/DB2UAdmin/repo
pushing to ssh://hg#bitbucket.org/DB2UAdmin/repo
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 9664 changes to 9664 files
remote: You're not allowed to write to this repository.
remote: transaction abort!
remote: rollback completed
remote: abort: pretxnchangegroup.bb_perm hook failed
also attempted via simple HTTP, got similar results as with HTTPS.
How can I get it to work?
Extra details:
python 2.7.1+
mercurial 1.7.5
on Ubuntu 11.04
The bitbucket account was opened under my gmail address [addr A].
The SSH key was made using the address from my company [addr B].
addr B was added to my account as a secondary address.
I had writing access for the mariusbutuc account, that had both addresses.
...I still couldn't pass the auth test.
Got an invitation form the Admin, on my work address - addr B. With admin rights, not only write.
Trying to accept the invitation, I couldn't: my account already had access to the repository.
Had to revoke my own access, just to be able to
accept the admin rights.
Pushed successfully via SSH:
$ hg push ssh://hg#bitbucket.org/DB2UAdmin/repo
pushing to ssh://hg#bitbucket.org/DB2UAdmin/repo
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 9664 changes to 9664 files
remote: bb/acl: mariusbutuc is allowed. accepted payload.
I still have no idea why pushing via HTTPS [username/password] failed!
For those of you that arrive here from googling "pretxnchangegroup.bb_perm hook failed" this can be caused by trying to merge to a branch that you do not have the "write" permission under "branch permissions" on bitbucket.
Presumably this is because you should have used a pull request for the merge rather than going ahead and merging on your local.
Related
I have tried manually clearing and setting the buildpack for my Rails app to heroku/rails. I have verified that I have a Gemfile, and I still get this error
remote: -----> Using set buildpack heroku/ruby
remote:
remote: ! Push rejected, failed to detect set buildpack heroku/ruby
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected
Which is confusing since I set the buildpack but then it can't detect it. Some of my routes are rendering json as I wanted this app to serve as a backend API. Do I need to add a buildpack for Node? Any other suggestions?
I had the app located within a redundant subfolder in the git repo. I fixed the problem by moving everything up a level, recommitting, and git push heroku master. Heroku was looking for a Gemfile in the top level, so I moved all the application files to the top level (where it should have been all along).
I reinitialized the repo and did it again. Did my commits and pushed. Worked!!!
git init
add heroku as a remote
git remote add heroku https://git.heroku.com/appname.git'
git add .
git commit -m "initial commit"
git push heroku master
MacOs Yosemite
I try clone repository with sourcetree. It began cloning but through some minutes it show me alert "Confirm Delete Repository" with text "You opted to delete repositories on disk but the repository "(null)" contains uncommitted files which will be lost forever if you delete this repository. Are you sure you want to delete the repository on disk?" So i can't clone
I try clone with terminal. After cloning terminal write message: "remote: Connection to bitbucket.org closed by remote host." But it's not clong all my repository and subrepository.
How I can get repository from bitbucket? I have 2 repositories, that I cloning 2-3 monthes ago on my macbook, and it was all good. Repository is cloned on my work under my account too without problems. But now I try get 2 new repositories on my mac, and I have same issues, that I described
In sourcetree I got such error:
hg clone ssh://hg#bitbucket.org/{my_repository}
requesting all changes
adding changesets
adding manifests
adding file changes
added 19 changesets with 115 changes to 58 files
updating to branch default
cloning subrepo framework from ssh://hg#bitbucket.org/{my_repository}
requesting all changes
adding changesets
adding manifests
adding file changes
added 1004 changesets with 4877 changes to 2384 files (+3 heads)
remote: Connection to bitbucket.org closed by remote host.
Completed with errors, see above
I am using SSH to push to the central mercurial repository on the remote server.
I put in a hook so the remote repo will update:
[hooks]
changegroup = hg update >&2
when I try to push to the remote repo, the push succeeds, but I get this output:
remote: added 1 changesets with 1 changes to 1 files
remote: abort: Permission denied: /var/www/sites/businesslicenses/.hgignore
remote: warning: changegroup hook exited with status 255
any ideas for me?? thanks!
If you use SSH and don't setup a dedicated user account on your server, then you will need to ensure that:
the necessary users are in a common group and
newly created files belong to that group
newly created files are group writable
See "The filesystem method" in the wiki for more information. Generally, I find that it's easier to user a dedicated user on the server and then grant people access by adding SSH public keys to .ssh/authorized_keys.
Check if /var/www/sites/businesslicenses/.hgignore is owned by the current user and is not owned by root.
UPDATE - I'm probably being daft, see my last update below.
I just did a hg push and it timed out, and now when I try hg push again I get a message 'no changes found', however I can see in the target repo that all but a few of the changes didn't make it to the repo. How can I push my changes to that repo?
The history behind this is I'm migrating from SVN to Mercurial (bitbucket). I've done the following:
Used svnsync to get a local copy of the SVN repository.
Created a new repo within bitbucket
Cloned the repo to my local machine
Done svnadmin convert from my local SVN repo to my local Hg repo
Run hg push to push the changes to bitbucket
The last command prompts me for HTTP authorisation, then says 'searching for changes', no output for >15 mins, then output 'abort: HTTP Error 504: Gateway Time-out'. Full process was:
C:\dev\sandbox\svn_to_hg\dev_hg>hg push
http authorization required
realm: Bitbucket.org HTTP
user: my_login
password:
pushing to https://bitbucket.org/my_login/dev
searching for changes
abort: HTTP Error 504: Gateway Time-out
C:\dev\sandbox\svn_to_hg\dev_hg>hg push
http authorization required
realm: Bitbucket.org HTTP
user: my_login
password:
pushing to https://bitbucket.org/my_login/dev
searching for changes
no changes found
It seems that because there are so many changes it's taking too long between HTTP auth and when it actually pushes the changes, or something like that, and probably if I set up SSH keys it'd not need to cache the HTTP authentication so it wouldn't time out. Any ideas if that's correct? Regardless, I still need to know how to push these changes that hg now thinks have already been pushed.
In my bitbucket repository there are about 20 changesets from SVN from a few years ago, but there should be several thousand.
UPDATE:
hg out gives me this:
C:\dev\sandbox\svn_to_hg\dev_hg>hg out
http authorization required
realm: Bitbucket.org HTTP
user: my_login
password:
comparing with https://bitbucket.org/my_login/dev
searching for changes
no changes found
Looking at the repo using TortoiseHg repo browser shows there is tons of stuff there.
UPDATE:
Perhaps I'm being daft, now when I look at the repo within bitbucket it does seem that there are lots of changesets. But what timed out? Should I worry that all my changesets didn't make it to the server?
It seems that all changesets did make it - i.e. answer is to retry and then trust Mercurial.
When remotely updating a Mercurial Repository, I am getting the following error from the hg update command that is being run on the remote server after the push. I looked around online for some help for this however was unsuccessful in finding anything useful. At this point, I am hoping for some ideas and / or insight as to what would be causing this problem.
The error is just below. It occurred when pushing two changesets. One changeset included an unrelated index.html file change. The other changeset was a merge, which included the index.html change as well as the renaming of the two image files.
levinaris#server01:/home/web/repository$ hg push
pushing to ssh://10.10.1.12//home/web/repository
searching for changes`remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 2 changesets with 1 changes to 1 files
remote: abort: Operation not permitted: /home/web/repository/html/images/image.gif
remote: warning: changegroup hook exited with status 255
Additional details:
Both images are 10385 bytes in size. (yes, this error occurs on two images I have)
The two images had their names changed in changesets that were already pushed and hg updated due to case-folding collisions when attempting to pull the repositories down to Windows PCs.
The target server has the following hook in /etc/mercurial/hgrc:
[hooks]
changegroup = hg update
As a work-around, I did the following:
Deleted image.gif.
Deleted another image file that produced the error.
Ran hg update - success!
Ran hg revert html/image/image.gif
Ran hg revert html/image/otherimage.gif
At this point, I am trying to better understand the cause of this problem, so that I can ensure a solid, easy-to-use implementation in my environment. I really appreciate your help!!
After using hg --debug update in the hook, I received this output:
levinaris#server01:/home/web/repository$ hg push
pushing to /home/web/staging/repository
searching for changes
adding changesets
adding manifests
adding file changes
added 2 changesets with 1 changes to 1 files
resolving manifests
overwrite False partial False
ancestor 58a5edb95c9a local 58a5edb95c9a+ remote 3aafb97b148c
searching for copies back to rev 6
html/index.php: remote is newer -> g
html/images/otherimage.gif.casefolding: update permissions -> e
html/images/image.gif: update permissions -> e
abort: Operation not permitted: /home/web/staging/repository/html/images/image.gif
warning: changegroup hook exited with status 255
Additional Permission Information:
All 3 files in the 2 changesets have 775 permission with the webuser:dev user:group.
My Global hgrc file has the webuser trusted
[trusted]
users = webuser
Is it possible that the permissions that file on the server were such that it couldn't be overwitten by the person doing the push?
If, for example, two different people have done that push (and thus update) the second person isn't going to be able to overwrite the files created by the first person's push triggered update.
Maybe try changing the hook to this for a test (you don't actually have those single quotes on your hook, right?):
[hooks]
changegroup = hg --debug update
If it is a permissions issue the usual fix is to put everyone who will be pushing and updating into the same group (I call mine 'hg') and then using the sticky group bit on all the directories in the repo to make sure new files have that group.