I am new to Git and I am trying to to push a Java project to Github using Git Bash.
This is what I did:
-
created a Blog repository in GitHub
-
in Git Bash
$ cd C:/Users/Alessandro/workspace/BLOG
$ echo «# Blog» >> README.md
$ git add –-all
$ git commit -m «Initial commit»
$ git remote add origin https://github.com/alerossi82/Blog
$ git push -u origin master
But when I do the push, this is the result I get:
fatal: unable to access ‘https://github.com/username/repository/’: The requested URL returned error: 400
I read somewhere this is could be a login problem, but I checked my config in GitBash and the username and email match with GitHub.
When I commit the push, I I am logged in to my GitHub account and I do not receive any insert password request from GitBash.
Then I tried to push the project directly from Eclipse, but this failed as well, in fact when I push the changes I receive the message:
— master >> master [rejected — non-fast-forward]
I am totally lost, I think all the step are correct however it looks like my local and remote repositories don’t want to talk to each other, and I have no idea why.
Any help?
asked Mar 6, 2016 at 12:51
Alex RedsAlex Reds
1871 gold badge4 silver badges17 bronze badges
3
Had a similar problem and it turned out that I had some issues with my .gitconfig
file since I had earlier run git config --global url."git@github.com:".insteadOf "https://github.com/"
and later git config --global url."https://github.com/".insteadOf "git@github.com:"
which added both lines to my .gitconfig file. So all I did was clean my .gitconfig file using vim in my terminal(Iterm)
:
$ vi $HOME/.gitconfig
Then removed the unwanted lines from the .gitconfig
file using vim editor. Hope it helps.
answered Jun 12, 2019 at 9:08
AwesomeAwesome
3783 silver badges8 bronze badges
You missed the
git add . -A
before the commit so no files were added
cd C:/Users/Alessandro/workspace/BLOG
echo "# Blog" >> README.md
# Here you need to run the git add command
git add -A .
git commit -m "Initial commit"
git remote add origin https://github.com/alerossi82/Blog
git push -u origin master
answered Mar 6, 2016 at 13:09
CodeWizardCodeWizard
121k21 gold badges138 silver badges162 bronze badges
1
You should fist check what files, you have changes and are ready to be committed, using :
git status
If you saw any changed files, stage them for committing, using :
git add .
Then commit your changes.
git commit -m "your commit message"
And finally :
git push -u origin master
answered Mar 6, 2016 at 13:22
Farhad FaghihiFarhad Faghihi
11.8k5 gold badges30 silver badges60 bronze badges
You missed the .git
part, which is important. The url you are adding corresponds to the web page you view on GitHub, not the git repository. You should do:
$ git remote add origin https://github.com/alerossi82/Blog.git
Also, if this is your own repository, you probably want to use the SSH url instead of the HTTPS url:
$ git remote add origin git@github.com:alerossi82/Blog.git
This will make your everyday life easier, as you can use an ssh key for authentication instead of typing your GitHub password every time. More info on GitHub urls here.
answered Mar 6, 2016 at 13:18
m000m000
5,8123 gold badges30 silver badges28 bronze badges
HTTPS cloning errors
There are a few common errors when using HTTPS with Git. These errors usually indicate you have an old version of Git, or you don’t have access to the repository.
Here’s an example of an HTTPS error you might receive:
> error: The requested URL returned error: 401 while accessing
> https://github.com/USER/REPO.git/info/refs?service=git-receive-pack
> fatal: HTTP request failed
> Error: The requested URL returned error: 403 while accessing
> https://github.com/USER/REPO.git/info/refs
> fatal: HTTP request failed
> Error: https://github.com/USER/REPO.git/info/refs not found: did you run git
> update-server-info on the server?
Check your Git version
There’s no minimum Git version necessary to interact with GitHub, but we’ve found version 1.7.10 to be a comfortable stable version that’s available on many platforms. You can always download the latest version on the Git website.
Ensure the remote is correct
The repository you’re trying to fetch must exist on GitHub.com, and the URL is case-sensitive.
You can find the URL of the local repository by opening the command line and
typing git remote -v
:
$ git remote -v
# View existing remotes
> origin https://github.com/ghost/reactivecocoa.git (fetch)
> origin https://github.com/ghost/reactivecocoa.git (push)
$ git remote set-url origin https://github.com/ghost/ReactiveCocoa.git
# Change the 'origin' remote's URL
$ git remote -v
# Verify new remote URL
> origin https://github.com/ghost/ReactiveCocoa.git (fetch)
> origin https://github.com/ghost/ReactiveCocoa.git (push)
Alternatively, you can change the URL through our
GitHub Desktop application.
Provide an access token
To access GitHub, you must authenticate with a personal access token instead of your password. For more information, see «Creating a personal access token.»
If you are accessing an organization that uses SAML SSO and you are using a personal access token (classic), you must also authorize your personal access token to access the organization before you authenticate. For more information, see «About authentication with SAML single sign-on» and «Authorizing a personal access token for use with SAML single sign-on.»
Check your permissions
When prompted for a username and password, make sure you use an account that has access to the repository.
Tip: If you don’t want to enter your credentials every time you interact with the remote repository, you can turn on credential caching. If you are already using credential caching, please make sure that your computer has the correct credentials cached. Incorrect or out of date credentials will cause authentication to fail.
Use SSH instead
If you’ve previously set up SSH keys, you can use the SSH clone URL instead of HTTPS. For more information, see «About remote repositories.»
Error: Repository not found
If you see this error when cloning a repository, it means that the repository does not exist or you do not have permission to access it. There are a few solutions to this error, depending on the cause.
Check your spelling
Typos happen, and repository names are case-sensitive. If you try to clone git@github.com:user/repo.git
, but the repository is really named User/Repo
you will receive this error.
To avoid this error, when cloning, always copy and paste the clone URL from the repository’s page. For more information, see «Cloning a repository.»
To update the remote on an existing repository, see «Managing remote repositories».
Checking your permissions
If you are trying to clone a private repository but do not have permission to view the repository, you will receive this error.
Make sure that you have access to the repository in one of these ways:
- The owner of the repository
- A collaborator on the repository
- A member of a team that has access to the repository (if the repository belongs to an organization)
Check your SSH access
In rare circumstances, you may not have the proper SSH access to a repository.
You should ensure that the SSH key you are using is attached to your personal account on GitHub. You can check this by typing
the following into the command line:
$ ssh -T git@github.com
> Hi USERNAME! You've successfully authenticated, but GitHub does not
> provide shell access.
If the repository belongs to an organization and you’re using an SSH key generated by an OAuth App, OAuth App access may have been restricted by an organization owner. For more information, see «About OAuth App access restrictions.»
For more information, see Adding a new SSH key to your GitHub account.
Check that the repository really exists
If all else fails, make sure that the repository really exists on GitHub.com!
If you’re trying to push to a repository that doesn’t exist, you’ll get this error.
Error: Remote HEAD refers to nonexistent ref, unable to checkout
This error occurs if the default branch of a repository has been deleted on GitHub.com.
Detecting this error is simple; Git will warn you when you try to clone the repository:
$ git clone https://github.com/USER/REPO.git
# Clone a repo
> Cloning into 'repo'...
> remote: Counting objects: 66179, done.
> remote: Compressing objects: 100% (15587/15587), done.
> remote: Total 66179 (delta 46985), reused 65596 (delta 46402)
> Receiving objects: 100% (66179/66179), 51.66 MiB | 667 KiB/s, done.
> Resolving deltas: 100% (46985/46985), done.
> warning: remote HEAD refers to nonexistent ref, unable to checkout.
To fix the error, you’ll need to be an administrator of the repository on GitHub.com.
You’ll want to change the default branch of the repository.
After that, you can get a list of all the available branches from the command line:
$ git branch -a
# Lists ALL the branches
> remotes/origin/awesome
> remotes/origin/more-work
> remotes/origin/new-main
Then, you can just switch to your new branch:
$ git checkout new-main
# Create and checkout a tracking branch
> Branch new-main set up to track remote branch new-main from origin.
> Switched to a new branch 'new-main'
Содержание
- Troubleshooting cloning errors
- In this article
- Help us make these docs great!
- git push heroku master fails by «HTTP 400 curl 22 The requested URL returned error»
- Bitbucket Support
- Knowledge base
- Products
- Jira Software
- Jira Service Management
- Jira Work Management
- Confluence
- Bitbucket
- Resources
- Documentation
- Community
- Suggestions and bugs
- Marketplace
- Billing and licensing
- Viewport
- Confluence
- Git Commands Return Error Code 400
- Related content
- Still need help?
- Symptoms
- Problem #1:
- Problem #2:
- Problem #1:
- Problem #2:
- Resolution
- Problem #1:
- Problem #2:
- 400 Bad Request when using curl callback #5304
- Comments
- How do callback URLs actually work?
- My specific issue
- Build: «The requested URL returned error: 400 Bad Request» #227
- Comments
Troubleshooting cloning errors
In this article
If you’re having trouble cloning a repository, check these common errors.
HTTPS cloning errors
There are a few common errors when using HTTPS with Git. These errors usually indicate you have an old version of Git, or you don’t have access to the repository.
Here’s an example of an HTTPS error you might receive:
Check your Git version
There’s no minimum Git version necessary to interact with GitHub, but we’ve found version 1.7.10 to be a comfortable stable version that’s available on many platforms. You can always download the latest version on the Git website.
Ensure the remote is correct
The repository you’re trying to fetch must exist on GitHub.com, and the URL is case-sensitive.
You can find the URL of the local repository by opening the command line and typing git remote -v :
Alternatively, you can change the URL through our GitHub Desktop application.
Provide an access token
To access GitHub, you must authenticate with a personal access token instead of your password. For more information, see «Creating a personal access token.»
If you are accessing an organization that uses SAML SSO and you are using a personal access token (classic), you must also authorize your personal access token to access the organization before you authenticate. For more information, see «About authentication with SAML single sign-on» and «Authorizing a personal access token for use with SAML single sign-on.»
Check your permissions
When prompted for a username and password, make sure you use an account that has access to the repository.
Tip: If you don’t want to enter your credentials every time you interact with the remote repository, you can turn on credential caching. If you are already using credential caching, please make sure that your computer has the correct credentials cached. Incorrect or out of date credentials will cause authentication to fail.
Use SSH instead
If you’ve previously set up SSH keys, you can use the SSH clone URL instead of HTTPS. For more information, see «About remote repositories.»
Error: Repository not found
If you see this error when cloning a repository, it means that the repository does not exist or you do not have permission to access it. There are a few solutions to this error, depending on the cause.
Check your spelling
Typos happen, and repository names are case-sensitive. If you try to clone git@github.com:user/repo.git , but the repository is really named User/Repo you will receive this error.
To avoid this error, when cloning, always copy and paste the clone URL from the repository’s page. For more information, see «Cloning a repository.»
To update the remote on an existing repository, see «Managing remote repositories».
Checking your permissions
If you are trying to clone a private repository but do not have permission to view the repository, you will receive this error.
Make sure that you have access to the repository in one of these ways:
- The owner of the repository
- A collaborator on the repository
- A member of a team that has access to the repository (if the repository belongs to an organization)
Check your SSH access
In rare circumstances, you may not have the proper SSH access to a repository.
You should ensure that the SSH key you are using is attached to your personal account on GitHub. You can check this by typing the following into the command line:
If the repository belongs to an organization and you’re using an SSH key generated by an OAuth App, OAuth App access may have been restricted by an organization owner. For more information, see «About OAuth App access restrictions.»
Check that the repository really exists
If all else fails, make sure that the repository really exists on GitHub.com! If you’re trying to push to a repository that doesn’t exist, you’ll get this error.
Error: Remote HEAD refers to nonexistent ref, unable to checkout
This error occurs if the default branch of a repository has been deleted on GitHub.com.
Detecting this error is simple; Git will warn you when you try to clone the repository:
To fix the error, you’ll need to be an administrator of the repository on GitHub.com. You’ll want to change the default branch of the repository.
After that, you can get a list of all the available branches from the command line:
Then, you can just switch to your new branch:
Help us make these docs great!
All GitHub docs are open source. See something that’s wrong or unclear? Submit a pull request.
Источник
git push heroku master fails by «HTTP 400 curl 22 The requested URL returned error»
I’m trying to push rails application that shows just «hello, world.».
Then I met an error like below.
I would like to know how to solve this problem.
$git push heroku master
Enumerating objects: 88, done.
Counting objects: 100% (88/88), done.
Delta compression using up to 4 threads.
Compressing objects: 100% (73/73), done.
Writing objects: 100% (88/88), 22.29 KiB | 1.71 MiB/s, done.
Total 88 (delta 2), reused 0 (delta 0)
error: RPC failed; HTTP 400 curl 22 The requested URL returned error: 400 Bad Request
fatal: The remote end hung up unexpectedly
Everything up-to-date
My procedures are below.
1.create rails application like below.
rails new sample
2.fix routes and application_controller to show hello, world. 3.change Gemfile.
3-1.declare sqlite3 in development and test group gem ‘sqlite3’
3-2.declare pg in production group gem ‘pg’, ‘0.20.0’
4.execute bundle install —without production
5.execute git add .
6.execute git commit -m «initial commit for heroku»
7.confirm if it works by rails s and access to localhost:3000
8.execute heroku login and enter id and password.
9.execute heroku keys:add and the SSH key is created by this operation.
10.execute heroku create
11.execute git push heroku master and then I got the error
Each programs’ version is below.
* Rails 5.1.6
* heroku/7.14.1 win32-x64 node-v10.9.0
What is this error and how can I avoid this error?
Please tell me if you need more information.
Источник
Bitbucket Support
Knowledge base
Products
Jira Software
Project and issue tracking
Jira Service Management
Service management and customer support
Jira Work Management
Manage any business project
Confluence
Bitbucket
Git code management
Resources
Documentation
Usage and admin help
Answers, support, and inspiration
Suggestions and bugs
Feature suggestions and bug reports
Marketplace
Billing and licensing
Frequently asked questions
Viewport
Confluence
Git Commands Return Error Code 400
Related content
Still need help?
The Atlassian Community is here for you.
Symptoms
Problem #1:
When trying to create repositories, Git commands return error code 400:
The following can be seen in the atlassian-bitbucket.log :
Problem #2:
When running git commands on your CI applications (i.e. Jenkins), with Bitbucket server DEBUG logs on — refer to Enable debug logging.
The following can be seen on your CI system:
The following can be seen on your Bitbucket Server atlassian-bitbucket.log :
Problem #1:
This happens because the Git server is trying to use the git «dumb» HTTP protocol, which is not supported by Bitbucket Server. Bitbucket Server supports only the «smart» HTTP protocol, which was introduced in Git 1.6.6.
Problem #2:
Resolution
Problem #1:
Update the Git on the system running your Bitbucket server to a supported one (1.6.6 and above).
Problem #2:
Update the Git client to something higher the Git 1.7.1. Although Git dumb protocol is supposed to be used on any Git client above 1.6.6 (see 4.1 Git on the Server — The Protocols). Please upgrade upgrade your Git client to the most of recent supported one as described on our Supported Platforms.
Источник
400 Bad Request when using curl callback #5304
ISSUE TYPE
SUMMARY
Following an upgrade, I’m having difficulty using provisioning callback receiving a 400 error/
ENVIRONMENT
- AWX version: 9.0.1
- AWX install method: kubernetes
- Ansible version: 2.8.5
- Operating System: Coreos
- Web Browser:
STEPS TO REPRODUCE
EXPECTED RESULTS
Callback to initiate ansible
ACTUAL RESULTS
curl: (22) The requested URL returned error: 400 Bad Request
2019-11-12 08:12:46,666 WARNING awx.api.generics status 400 received by user AnonymousUser attempting to access /api/v2/job_templates/18/callback/ from 139.184.228.25
2019-11-12 08:12:46,670 WARNING django.request Bad Request: /api/v2/job_templates/18/callback/
2019-11-12 08:12:46,670 WARNING django.request Bad Request: /api/v2/job_templates/18/callback/
[pid: 133|app: 0|req: 190/1050] 139.184.228.25 () <38 vars in 512 bytes>[Tue Nov 12 08:12:46 2019] POST /api/v2/job_templates/18/callback/ => generated 42 bytes in 628 msecs (HTTP/1.1 400) 8 headers in 247 bytes (1 switches on core 0)
139.184.228.25 — — [12/Nov/2019:08:12:46 +0000] «POST /api/v2/job_templates/18/callback/ HTTP/1.1» 400 42 «-» «curl/7.61.1» «-«
ADDITIONAL INFORMATION
AWX ‘sees’ the correct IP address, and I have set: REMOTE_HOST_HEADERS = [‘REMOTE_HOST, HTTP_X_FORWARDED_FOR’]
The text was updated successfully, but these errors were encountered:
This issue tracker is for tracking feature enhancements and bugs to AWX itself.
If you need help troubleshooting an AWX install, try our mailing list or IRC room:
Should this issue really be closed? I’ve spent the entire day on this and I’m receiving the same error as the original poster. This reddit post also talks about the issue and what he attempted to do to fix it.
If the feature really does work, then the docs are leading quite a few of us into the pit of failure, since it appears to be pretty simple to configure.
I’ll keep hacking away at this, and leave an update if i find out what my personal issue was because as of right now, I can’t find any solutions online.
If it is any help, I found that putting the node IP addresses inthe PROXY_IP_WHITELIST helps:
`kubectl describe pod -n namespace |grep IP: | awk ‘‘
I finally got to the bottom of why so many people likely have these same problems.
How do callback URLs actually work?
The how isn’t really documented. After playing around with various different proxies, and host inventories, it seems to be pretty simple:
- Your AWX instance must be behind a reverse proxy (or I think more accurately, whatever value you have set to the TOWER_URL_BASE setting)
- The IP of the client that is initiating the callback URL request must be sent in a value that AWX is configured to read in the REMOTE_HOST_HEADERS setting
- I didn’t confirm this, but it makes sense that your PROXY_IP_WHILTELIST should be set to all the IPs of your proxy servers.
- The IP address must be resolvable by a reverse DNS lookup (or you have the actual IP in the inventory)
My specific issue
I was accessing my AWX instance from my Nginx reverse proxy that is public facing.
My requests all appeared to be coming from my public external IP, and since this public IP doesn’t exist in the inventory, it complained that the host couldn’t be found (rightfully so).
To solve this, I setup an internal Nginx service on my AWX server. I set the URL to the Nginx endpoint as the value of the TOWER_URL_BASE setting.
Internal clients were now sending internal requests to the instance, and sending their correct IPs.
Once you realize how it’s actually working, it just becomes a simple routing/DNS problem.
Источник
Build: «The requested URL returned error: 400 Bad Request» #227
So we have https://github.com/whatwg/whatwg.org/blob/master/resources.whatwg.org/build/deploy.sh#L90 specifically to check errors and warnings in Bikeshed and yet somehow at times it returns nothing of use whatsoever.
@plinss @tabatkins what’s the way to get it to return a more detailed error message?
(Currently hitting this on whatwg/dom.)
The text was updated successfully, but these errors were encountered:
Previously, see #226 (comment) . As far as I can tell the current set of Bikeshed API configuration would require us to do something like your #223; we should probably just merge that pending something better. Details:
- If you set die-on=warning, there is no reliable way to get the output in failure cases unless you set output=err. In particular, even though it will return a 400 status if your document has warnings, the API will give the built-with-warnings HTML output instead of giving you the warning text
- If you set output=err, you always have to do multiple passes in the success case: once to get an empty string output and a 200 status code, and once to get the real output with a 200 status code.
- If you do what you did in
Force 0 exit status when running bikeshed for errors/warnings #223 , using force=1 , you end up doing multiple passes in both the success and failure cases, because the status code is always 200, so even if there’s a warning or error, you’ll still try again later on.
So right now it seems like the best you could do would be one extra round-trip on success and zero extra round-trips on failure. #223 does one extra round-trip for both, but it’s better than nothing.
Источник
Symptoms
Problem #1:
When trying to create repositories, Git commands return error code 400:
The following can be seen in the atlassian-bitbucket.log
:
2012-10-08 15:04:10,147 INFO [http-7990-32] blah 904x33x1 ky07q7 143.88.25.110 "POST /projects/TEST/repos HTTP/1.1" c.a.s.internal.scm.git.CreateCommand Repository t1 has been created and configured successfully 2012-10-08 15:04:26,327 ERROR [http-7990-8] blah 904x38x1 1e7prrh 143.88.25.110 "GET /scm/TEST/t1.git/info/refs HTTP/1.1" c.a.s.i.scm.git.web.GitSmartRequest Request for repo 't1' of project 'TEST' from 'IP' failed: read process '/usr/local/bin/git http-backend /info/refs' caused an exception Process's error output: warning: unable to access '/root/etc/gitconfig': Permission denied warning: unable to access '/root/etc/gitconfig': Permission denied warning: unable to access '/root/etc/gitconfig': Permission denied warning: unable to access '/root/etc/gitconfig': Permission denied git: 'http-backend' is not a git command. See 'git --help'.
Problem #2:
When running git commands on your CI applications (i.e. Jenkins), with Bitbucket server DEBUG logs on — refer to Enable debug logging.
The following can be seen on your CI system:
Failed to connect to repository : Command "/usr/bin/git -c core.askpass=true ls-remote -h http://jenkins@mybitbucketserver.com:7990/scm/TT/test.git HEAD" returned status code 128:
stdout:
stderr: error: The requested URL returned error: 400 Bad Request while accessing http://jenkins@mybitbucketserver.com:7990/scm/TT/test.git/info/refs
The following can be seen on your Bitbucket Server atlassian-bitbucket.log
:
2016-08-26 14:48:20,317 DEBUG [http-nio-7990-exec-3117] @H5FYGBx888x863255x0 10.138.28.33 "GET /scm/TT/test.git/info/refs HTTP/1.1" c.a.s.i.s.g.p.h.DefaultGitHttpScmRequestHandler It looks like we've received a 'dumb' protocol git request. service=null, pathInfo=/TT/test.git/info/refs
<IP> | http | i@H5FYGBx888x863255x0 | - | 2016-08-26 14:48:20,310 | "GET /scm/TT/test.git/info/refs HTTP/1.1" | "" "git/1.7.1" | - | - | - |
<IP> | http | o@H5FYGBx888x863255x0 | - | 2016-08-26 14:48:20,318 | "GET /scm/TT/test.git/info/refs HTTP/1.1" | "" "git/1.7.1" | - | 8 | - |
Cause
Problem #1:
This happens because the Git server is trying to use the git «dumb» HTTP protocol, which is not supported by Bitbucket Server. Bitbucket Server supports only the «smart» HTTP protocol, which was introduced in Git 1.6.6.
Problem #2:
The Git client is performing a dumb protocol request because it is an old version.
Resolution
Problem #1:
Update the Git on the system running your Bitbucket server to a supported one (1.6.6 and above).
Problem #2:
Update the Git client to something higher the Git 1.7.1. Although Git dumb protocol is supposed to be used on any Git client above 1.6.6 (see 4.1 Git on the Server — The Protocols). Please upgrade upgrade your Git client to the most of recent supported one as described on our Supported Platforms.
Troubleshooting cloning errors
In this article
If you’re having trouble cloning a repository, check these common errors.
HTTPS cloning errors
There are a few common errors when using HTTPS with Git. These errors usually indicate you have an old version of Git, or you don’t have access to the repository.
Here’s an example of an HTTPS error you might receive:
Check your Git version
There’s no minimum Git version necessary to interact with GitHub, but we’ve found version 1.7.10 to be a comfortable stable version that’s available on many platforms. You can always download the latest version on the Git website.
Ensure the remote is correct
The repository you’re trying to fetch must exist on GitHub.com, and the URL is case-sensitive.
You can find the URL of the local repository by opening the command line and typing git remote -v :
Alternatively, you can change the URL through our GitHub Desktop application.
Provide an access token
To access GitHub, you must authenticate with a personal access token instead of your password. For more information, see «Creating a personal access token.»
If you are accessing an organization that uses SAML SSO and you are using a personal access token (classic), you must also authorize your personal access token to access the organization before you authenticate. For more information, see «About authentication with SAML single sign-on» and «Authorizing a personal access token for use with SAML single sign-on.»
Check your permissions
When prompted for a username and password, make sure you use an account that has access to the repository.
Tip: If you don’t want to enter your credentials every time you interact with the remote repository, you can turn on credential caching. If you are already using credential caching, please make sure that your computer has the correct credentials cached. Incorrect or out of date credentials will cause authentication to fail.
Use SSH instead
If you’ve previously set up SSH keys, you can use the SSH clone URL instead of HTTPS. For more information, see «About remote repositories.»
Error: Repository not found
If you see this error when cloning a repository, it means that the repository does not exist or you do not have permission to access it. There are a few solutions to this error, depending on the cause.
Check your spelling
Typos happen, and repository names are case-sensitive. If you try to clone git@github.com:user/repo.git , but the repository is really named User/Repo you will receive this error.
To avoid this error, when cloning, always copy and paste the clone URL from the repository’s page. For more information, see «Cloning a repository.»
To update the remote on an existing repository, see «Managing remote repositories».
Checking your permissions
If you are trying to clone a private repository but do not have permission to view the repository, you will receive this error.
Make sure that you have access to the repository in one of these ways:
- The owner of the repository
- A collaborator on the repository
- A member of a team that has access to the repository (if the repository belongs to an organization)
Check your SSH access
In rare circumstances, you may not have the proper SSH access to a repository.
You should ensure that the SSH key you are using is attached to your personal account on GitHub. You can check this by typing the following into the command line:
If the repository belongs to an organization and you’re using an SSH key generated by an OAuth App, OAuth App access may have been restricted by an organization owner. For more information, see «About OAuth App access restrictions.»
Check that the repository really exists
If all else fails, make sure that the repository really exists on GitHub.com! If you’re trying to push to a repository that doesn’t exist, you’ll get this error.
Error: Remote HEAD refers to nonexistent ref, unable to checkout
This error occurs if the default branch of a repository has been deleted on GitHub.com.
Detecting this error is simple; Git will warn you when you try to clone the repository:
To fix the error, you’ll need to be an administrator of the repository on GitHub.com. You’ll want to change the default branch of the repository.
After that, you can get a list of all the available branches from the command line:
Then, you can just switch to your new branch:
Help us make these docs great!
All GitHub docs are open source. See something that’s wrong or unclear? Submit a pull request.
Источник
Bitbucket Support
Knowledge base
Products
Jira Software
Project and issue tracking
Jira Service Management
Service management and customer support
Jira Work Management
Manage any business project
Confluence
Bitbucket
Git code management
Resources
Documentation
Usage and admin help
Community
Answers, support, and inspiration
Suggestions and bugs
Feature suggestions and bug reports
Marketplace
Billing and licensing
Frequently asked questions
Viewport
Confluence
Git Commands Return Error Code 400
Related content
Still need help?
The Atlassian Community is here for you.
Symptoms
Problem #1:
When trying to create repositories, Git commands return error code 400:
The following can be seen in the atlassian-bitbucket.log :
Problem #2:
When running git commands on your CI applications (i.e. Jenkins), with Bitbucket server DEBUG logs on — refer to Enable debug logging.
The following can be seen on your CI system:
The following can be seen on your Bitbucket Server atlassian-bitbucket.log :
Problem #1:
This happens because the Git server is trying to use the git «dumb» HTTP protocol, which is not supported by Bitbucket Server. Bitbucket Server supports only the «smart» HTTP protocol, which was introduced in Git 1.6.6.
Problem #2:
Resolution
Problem #1:
Update the Git on the system running your Bitbucket server to a supported one (1.6.6 and above).
Problem #2:
Update the Git client to something higher the Git 1.7.1. Although Git dumb protocol is supposed to be used on any Git client above 1.6.6 (see 4.1 Git on the Server — The Protocols). Please upgrade upgrade your Git client to the most of recent supported one as described on our Supported Platforms.
Источник
Ошибка 400 Bad Request: что это означает и как ее исправить
Ошибка 400 Bad Request – это код ответа HTTP , который означает, что сервер не смог обработать запрос, отправленный клиентом из-за неверного синтаксиса. Подобные коды ответа HTTP отражают сложные взаимоотношения между клиентом, веб-приложением, сервером, а также зачастую сразу несколькими сторонними веб-сервисами. Из-за этого поиск причины появления ошибки может быть затруднён даже внутри контролируемой среды разработки.
В этой статье мы разберём, что значит ошибка 400 Bad Request ( переводится как « Неверный запрос »), и как ее исправить
На стороне сервера или на стороне клиента?
Все коды ответа HTTP из категории 4xx считаются ошибками на стороне клиента. Несмотря на это, появление ошибки 4xx не обязательно означает, что проблема как-то связана с клиентом, под которым понимается веб-браузер или устройство, используемое для доступа к приложению. Зачастую, если вы пытаетесь диагностировать проблему со своим приложением, можно сразу игнорировать большую часть клиентского кода и компонентов, таких как HTML , каскадные таблицы стилей ( CSS ), клиентский код JavaScript и т.п. Это также применимо не только к сайтам. Многие приложения для смартфонов, которые имеют современный пользовательский интерфейс, представляют собой веб-приложения.
С другой стороны, ошибка 400 Bad Request означает, что запрос, присланный клиентом, был неверным по той или иной причине. Пользовательский клиент может попытаться загрузить слишком большой файл, запрос может быть неверно сформирован, заголовки HTTP запроса могут быть неверными и так далее.
Мы рассмотрим некоторые из этих сценариев ( и потенциальные решения ) ниже. Но имейте в виду: мы не можем однозначно исключить ни клиент, ни сервер в качестве источника проблемы. В этих случаях сервер является сетевым объектом, генерирующим ошибку 400 Bad Request и возвращающим её как код ответа HTTP клиенту, но возможно именно клиент ответственен за возникновение проблемы.
Начните с тщательного резервного копирования приложения
Важно сделать полный бэкап вашего приложения, базы данных и т.п. прежде , чем вносить какие-либо правки или изменения в систему. Ещё лучше, если есть возможность создать полную копию приложения на дополнительном промежуточном сервере, который недоступен публично.
Подобный подход обеспечит чистую тестовую площадку, на которой можно отрабатывать все возможные сценарии и потенциальные изменения, чтобы исправить или иную проблему без угрозы безопасности или целостности вашего « живого » приложения.
Диагностика ошибки 400 Bad Request
Ошибка 400 Bad Request означает, что сервер ( удалённый компьютер ) не может обработать запрос, отправленный клиентом ( браузером ), вследствие проблемы, которая трактуется сервером как проблема на стороне клиента.
Существует множество сценариев, в которых ошибка 400 Bad Request может появляться в приложении. Ниже представлены некоторые наиболее вероятные случаи:
- Клиент случайно ( или намеренно ) отправляет информацию, перехватываемую маршрутизатором ложных запросов. Некоторые веб-приложения ищут особые заголовки HTTP , чтобы обрабатывать запросы и удостовериться в том, что клиент не предпринимает ничего зловредного. Если ожидаемый заголовок HTTP не найден или неверен, то ошибка 400 Bad Request – возможный результат.
- Клиент может загружать слишком большой файл. Большинство серверов или приложений имеют лимит на размер загружаемого файла, Это предотвращает засорение канала и других ресурсов сервера. Во многих случаях сервер выдаст ошибку 400 Bad Request , когда файл слишком большой и поэтому запрос не может быть выполнен.
- Клиент запрашивает неверный URL . Если клиент посылает запрос к неверному URL ( неверно составленному ), это может привести к возникновению ошибки 400 Bad Request .
- Клиент использует недействительные или устаревшие куки. Это возможно, так как локальные куки в браузере являются идентификатором сессии. Если токен конкретной сессии совпадает с токеном запроса от другого клиента, то сервер/приложение может интерпретировать это как злонамеренный акт и выдать код ошибки 400 Bad Request .
Исправление проблем на стороне клиента
Устранение ошибки 400 Bad Request ( попробуйте позже ) лучше начать с исправления на стороне клиента. Вот несколько советов, что следует попробовать в браузере или на устройстве, которые выдают ошибку.
Проверьте запрошенный URL
Наиболее частой причиной ошибки 400 Bad Request является банальный ввод некорректного URL . Доменные имена ( например, internet-technologies.ru ) нечувствительны к регистру, поэтому ссылка, написанная в смешанном регистре, такая как interNET-technologies.RU работает так же, как и нормальная версия в нижнем регистре internet-technologies.ru. Но части URL , которые расположены после доменного имени, чувствительными к регистру. Кроме случаев, когда приложение/сервер специально осуществляет предварительную обработку всех URL и переводит их в нижний регистр перед исполнением запроса.
Важно проверять URL на неподходящие специальные символы, которых в нем не должно быть. Если сервер получает некорректный URL , он выдаст ответ в виде ошибки 400 Bad Request .
Очистите соответствующие куки
Одной из потенциальных причин возникновения ошибки 400 Bad Request являются некорректные или дублирующие локальные куки. Файлы куки в HTTP – это небольшие фрагменты данных, хранящиеся на локальном устройстве, которые используются сайтами и веб-приложениями для « запоминания » конкретного браузера или устройства. Большинство современных веб-приложений использует куки для хранения данных, специфичных для браузера или пользователя, идентифицируя клиента и позволяя делать следующие визиты быстрее и проще.
Но куки, хранящие информацию сессии о вашем аккаунте или устройстве, могут конфликтовать с другим токеном сессии от другого пользователя, выдавая кому-то из вас ( или вам обоим ) ошибку 400 Bad Request .
В большинстве случаев достаточно рассматривать только ваше приложение в отношении файлов куки, которые относятся к сайту или веб-приложению, выдающему ошибку 400 Bad Request .
Куки хранятся по принципу доменного имени веб-приложения, поэтому можно удалить только те куки, которые соответствуют домену сайта, сохранив остальные куки не тронутыми. Но если вы не знакомы с ручным удалением определённых файлов куки, гораздо проще и безопаснее очистить сразу все файлы куки.
Это можно сделать разными способами в зависимости от браузера, который вы используете:
- Google Chrome;
- Internet Explorer;
- Microsoft Edge;
- Mozilla Firefox;
- Safari.
Загрузка файла меньшего размера
Если вы получаете ошибку 400 Bad Request при загрузке какого-либо файла, попробуйте корректность работы на меньшем по размеру файле, Это включает в себя и «загрузки» файлов, которые не загружаются с вашего локального компьютера. Даже файлы, отправленные с других компьютеров, считаются «загрузками» с точки зрения веб-сервера, на котором работает ваше приложение.
Выйдите и войдите
Попробуйте выйти из системы и войти обратно. Если вы недавно очистили файлы куки в браузере, это приводит к автоматическому выходу из системы при следующей загрузке страницы. Попробуйте просто войти обратно, чтобы посмотреть, заработала ли система корректно.
Также приложение может столкнуться с проблемой, связанной с вашей предыдущей сессией, являющейся лишь строкой, которую сервер посылает клиенту, чтобы идентифицировать клиента при будущих запросах. Как и в случае с другими данными, токен сессии ( или строка сессии ) хранится локально на вашем устройстве в файлах куки и передаётся клиентом на сервер при каждом запросе. Если сервер решает, что токен сессии некорректен или скомпрометирован, вы можете получить ошибку 400 Bad Request .
В большинстве веб-приложений выход повторный вход приводит к перегенерации локального токена сессии.
Отладка на распространённых платформах
Если вы используете на сервере распространённые пакеты программ, которые выдают ошибку 400 Bad Request , изучите стабильность и функциональность этих платформ. Наиболее распространённые системы управления контентом, такие как WordPress , Joomla! и Drupal , хорошо протестированы в своих базовых версиях. Но как только вы начинаете изменять используемые ими расширения PHP , очень легко спровоцировать непредвиденные проблемы, которые выльются в ошибку 400 Bad Request .
Откатите последние изменения
Если вы обновили систему управления контентом непосредственно перед появлением ошибки 400 Bad Request , рассмотрите возможность отката к предыдущей версии, которая была установлена, как самый быстрый и простой способ убрать ошибку 400 bad request .
Аналогично, любые расширения или модули, которые были обновлены, могут вызывать ошибки на стороне сервера, поэтому откат к предыдущим версиям этих расширений также может помочь.
Но в некоторых случаях CMS не предоставляют возможности отката к предыдущим версиям. Так обычно происходит с популярными платформами, поэтому не бойтесь, если вы не можете найти простой способ вернуться к использованию старой версии той или иной программной платформы.
Удалите новые расширения, модули или плагины
В зависимости от конкретной CMS , которую использует приложение, имена этих компонентов будут различаться. Но во всех системах они служат одной и той же цели: улучшение возможностей платформы относительно её стандартной функциональности.
При этом имейте в виду, что расширения могут так или иначе получать полный контроль над системой, вносить изменения в код PHP , HTML , CSS , JavaScript или базу данных. Поэтому мудрым решением может быть удаление любых новых расширений, которые были недавно добавлены.
Проверьте непреднамеренные изменения в базе данных
Даже если удалили расширение через панель управления CMS , это не гарантирует, что внесенные им изменения были полностью отменены. Это касается многих расширений WordPress , которым предоставляется полный доступ к базе данных.
Расширение может изменить записи в базе данных, которые «не принадлежат» ему, а созданы и управляются другими расширениями ( или даже самой CMS ). В подобных случаях модуль может не знать, как откатить назад изменения, внесенные в записи базы данных.
Я лично сталкивался с такими случаями несколько раз. Поэтому лучшим путём будет открыть базу данных и вручную просмотреть таблицы и записи, которые могли быть изменены расширением.
Поиск проблем на стороне сервера
Если вы уверены, что ошибка 400 Bad Request не связана с CMS , вот некоторые дополнительные советы, которые могут помочь найти проблему на стороне сервера.
Проверка на неверные заголовки HTTP
Ошибка, которую вы получаете от приложения, является результатом недостающих или некорректных специальных заголовков HTTP , которые ожидает получить приложение или сервер. В подобных случаях нужно проанализировать заголовки HTTP , которые отправляются на сторону сервера.
Просмотрите логи
Почти любое веб-приложение будет вести логи на стороне сервера. Они представляют собой историю того, что делало приложение. Например, какие страницы были запрошены, к каким серверам оно обращалось, какие результаты предоставлялись из базы данных и т.п.
Логи сервера относятся к оборудованию, на котором выполняется приложение, и зачастую представляют собой детали о статусе подключённых сервисов или даже о самом сервере. Поищите в интернете “ логи [ИМЯ_ПЛАТФОРМЫ] ”, если вы используете CMS , или “ логи [ЯЗЫК_ПРОГРАММИРОВАНИЯ] ” и “ логи [ОПЕРАЦИОННАЯ_СИСТЕМА] ”, если у вас собственное приложение, чтобы получить подробную информацию по поиску логов.
Отладьте код приложения или скриптов
Если это не помогло, проблема может быть в исходном коде, который выполняется внутри приложения. Попытайтесь диагностировать, откуда может исходить проблема, отлаживая приложение вручную и параллельно просматривая логи приложения и сервера.
Создайте копию всего приложения на локальном устройстве для разработки и пошагово повторите тот сценарий, который приводил к возникновению ошибки 400 Bad Request . А затем просмотрите код приложения в тот момент, когда что-то пойдёт не так.
Независимо от причины возникновения ошибки, даже если вам удалось исправить её в этот раз, появление в вашем приложении такой проблемы — это сигнал для того, чтобы внедрить инструмент обработки ошибок, который поможет автоматически обнаруживать их и оповещать в момент возникновения.
Сергей Бензенко автор-переводчик статьи « 400 Bad Request Error What It Is and How to Fix It »
Источник