This is the error on my terminal:
Authentication failed for 'https://bitbucket.org/railstutorial/sample_app_4th_ed.git/'
This is what I did:
git remote add origin ssh://git#bitbucket.org/kboygitgit/sample_app.git
git push -u origin master
then it asked for my username and password
then the error showed up
remote: Unauthorized
fatal: Authentication failed for 'https://bitbucket.org/railstutorial/sample_app_4th_ed.git/'
Related
I'm trying to configure flow which include git repository
things to note:
i have a git server running in internal network
my jenkin running on one of the machine in the network so it can access git server through local ip
normally i would go like this with my git command
git remote add origin ssh://username#git-server-ip/path-to-folder
after that it prompt me to type in the password for the above username
and i can work on the git repo like normal
The problems:
in Jenkin i already set up credential with "username and password" type
When i paste in the ssh url into the Repository URL, it take a while and return error:
Failed to connect to repository ...
stdout: stderr: Permission denied, please try again. Permission
denied, please try again. username#git-server-ip: Permission denied
(publickey, password). fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository
exists.
i had selected credentials and double check username and password it's correct. i tried running the ls-remote command manually in the terminal
git ls-remote -h -- ssh://username#git-server-ip/path-to-folder HEAD
it prompts to input the password, i typed it in and it run normal without error
Why is the error only happens on Jenkins when i input the repo ssh url? is username and password credential the wrong approach for credential? what else should i use?
there no guide online for Jenkin with internal git ssh url as i known of
the closest i can see my problem related to is this question Jenkins Git ssh setup does not let me use username/password , but it doesn't have an accepted answer yet, and the answer suggest going with "ssh username and private key"
A previously-working jenkins bitbucket user credential has been broken by Atlassian Bitbucket's new enforcement of using app passwords only, even when the new app password is updated in the credential for the same user/credential. This error is displayed in jenkins:
> Failed to connect to repository : Command "git ls-remote -h --
> https://bitbucket.org/<project>/<repo>.git HEAD" returned status code
> 128: stdout: stderr: remote: Bitbucket Cloud recently stopped
> supporting account passwords for Git authentication. remote: See our
> community post for more details:
> https://atlassian.community/t5/x/x/ba-p/1948231 remote: App passwords
> are recommended for most use cases and can be created in your Personal
> settings: remote:
> https://bitbucket.org/account/settings/app-passwords/ fatal:
> Authentication failed for
> 'https://bitbucket.org/<project>/<repo>.git/'
I also tried deleting and recreating the credential with the new app password and this error still happens. How to get the credential working again?
The user in the credential previously was the email address for the Bitbucket account. The user needed to be changed to the actual username for the account as found in BitBucket web interface > User Avatar > Personal Settings > Account Settings > Bitbucket profile settings section > Username.
I unload the application ROR on Heroku and I face a problem: fatal: HTTP request failed and other problem: error: The requested URL returned error: 403 while accessing https://github.com/priroda/first_app.git/info/refs
ark#ark-Aspire-5750G:~$ mkdir rails_projects
ark#ark-Aspire-5750G:~$ cd rails_projects
ark#ark-Aspire-5750G:~/rails_projects$ rails new first_app
ark#ark-Aspire-5750G:~/rails_projects$ cd first_app
ark#ark-Aspire-5750G:~/rails_projects/first_app$ git init
Initialized empty Git repository in /home/ark/rails_projects/first_app/.git/
ark#ark-Aspire-5750G:~/rails_projects/first_app$ git add .
ark#ark-Aspire-5750G:~/rails_projects/first_app$ git commit -m "Initialize repository"
ark#ark-Aspire-5750G:~/rails_projects/first_app$ git log
commit e8586bdf77a1aa260c25987c4860891333659033
Author: Ark <kotinoka2014#rambler.ru>
Date: Fri Jun 20 19:21:19 2014 +0400
Initialize repository
ark#ark-Aspire-5750G:~/rails_projects/first_app$ git remote add origin https://github.com/priroda/first_app.git
ark#ark-Aspire-5750G:~/rails_projects/first_app$ git push -u origin master
Username for 'https://github.com': priroda
Password for 'https://priroda#github.com':
error: The requested URL returned error: 403 while accessing https://github.com/priroda/first_app.git/info/refs
fatal: HTTP request failed
It seems you don't have access rights to the repository. If so:
Check the settings on your repo
Try to push using a SSH URL for the remote (all about git remote URLs here).
Another issue could be that the repo already exists… if you'd try to push to an existing repository, that would fail to prevent data loss.
I'm trying to git push origin master using Michael Hartl's rails tutorials (first_app), but i'm getting this problem:
[first_app]$git push origin master
ERROR: Permission to railstutorial/first_app.git denied to tomkim
fatal: The remote end hung up unexpectedly
I've re-entered an SSH key, but that's not it. I've never had this problem before, but now I am.
Help's greatly appreciated.
You need to add your own repo as the remote (of course you need to create a first_app repo on Github first):
$ git remote rm origin
$ git remote add origin git#github.com:tomkim/first_app.git
$ git push -u origin master
And tomkim is your github account name, right? If not, change it to yours.
I was able to figure this out. I noticed that the origin was showing "railstutorial/first_app.git", when that it should've been tomkim310/first_app.git. The problem to begin with was follow Hartl's tutorial, I was just typing as he was going. Simply doing a new "git remote add origin git#github.com:tomkim310/first_app.git" does not do the trick.
I verified this by typing in: git remote -v which gave origin git#github.com:railstutorial/first_app.git. To change it, i typed: git config remote.origin.url git#github.com:tomkim310/first_app.git.
This then did the trick and git push origin master worked.
I'm trying to follow along Michael Hartl's Ruby on Rails tutorial http://ruby.railstutorial.org/chapters/beginning#fnref:1.16, but I've run across an error. I signed up on GitHub and issued a new SSH key and made a new repository. But when I try to push my repository up to GitHub I get the following error:
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly
Any ideas?
Here are some of the commands I entered into the terminal:
Parkers-MacBook-Pro:.ssh ppreyer$ git remote add origin git#github.com:ppreyer/first_app.git
Parkers-MacBook-Pro:.ssh ppreyer$ git push -u origin master
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly – ppreyer 6 mins ago
And here is what git remote -v shows:
Parkers-MacBook-Pro:.ssh ppreyer$ git remote -v
github git#github.com:ppreyer/first_app.git (fetch)
github git#github.com:ppreyer/first_app.git (push)
origin git#github.com:ppreyer/first_app.git (fetch)
origin git#github.com:ppreyer/first_app.git (push)
Your repository was called "MyFirstRailsApp" but it appears you've deleted it. That's the reason for your error.