Page MenuHomePhabricator

Keep getting 403 error when trying to push to a repository
Closed, InvalidPublic

Description

I have a repository set up in Phabricator, with the following http address:
http://phabricator.vonji.fr/diffusion/VJ/

When I try to run this command:
git push --set-upstream origin master

I obtain this:
fatal: unable to access 'http://phabricator.vonji.fr/diffusion/VJ/': The requested URL returned error: 403

Whether I change those various parameters:
with or without policy.allow-public
with or without a VCS password
with or without diffusion.allow-http-auth

No combination fixes it.

Event Timeline

Ephasme updated the task description. (Show Details)
Ephasme added a subscriber: Ephasme.

Not exactly because my result is:

fatal: unable to access 'http://phabricator.vonji.fr/diffusion/VJ/': The requested URL returned error: 403

And not:

fatal: Authentication failed for 'https://phablab.krautspace.de/diffusion/M/morecms.git/'

Voilà ce que j'obtiens en faisant un clone.

Cloning into 'testrepo'...
* Couldn't find host phabricator.vonji.fr in the .netrc file; using defaults
* Hostname was NOT found in DNS cache
*   Trying 62.210.236.42...
* Connected to phabricator.vonji.fr (62.210.236.42) port 80 (#0)
> GET /diffusion/TR/testrepo.git/info/refs?service=git-upload-pack HTTP/1.1
User-Agent: git/1.9.1
Host: phabricator.vonji.fr
Accept: */*
Accept-Encoding: gzip
Pragma: no-cache

* HTTP 1.0, assume close after body
< HTTP/1.0 401 You must log in to access repositories.
< Date: Sun, 29 Nov 2015 00:38:47 GMT
< Server: Apache/2.4.7 (Ubuntu)
< X-Powered-By: PHP/5.5.9-1ubuntu4.14
< WWW-Authenticate: Basic realm="Phabricator Repositories"
< Content-Length: 43
< Connection: close
< Content-Type: text/html
< 
* Closing connection 0
Username for 'http://phabricator.vonji.fr': loup.peluso
Password for 'http://loup.peluso@phabricator.vonji.fr': 
* Couldn't find host phabricator.vonji.fr in the .netrc file; using defaults
* Hostname was found in DNS cache
*   Trying 62.210.236.42...
* Connected to phabricator.vonji.fr (62.210.236.42) port 80 (#1)
> GET /diffusion/TR/testrepo.git/info/refs?service=git-upload-pack HTTP/1.1
User-Agent: git/1.9.1
Host: phabricator.vonji.fr
Accept: */*
Accept-Encoding: gzip
Pragma: no-cache

* HTTP 1.0, assume close after body
< HTTP/1.0 401 You must log in to access repositories.
< Date: Sun, 29 Nov 2015 00:39:36 GMT
< Server: Apache/2.4.7 (Ubuntu)
< X-Powered-By: PHP/5.5.9-1ubuntu4.14
< WWW-Authenticate: Basic realm="Phabricator Repositories"
< Content-Length: 43
< Connection: close
< Content-Type: text/html
< 
* Closing connection 1
* Issue another request to this URL: 'http://phabricator.vonji.fr/diffusion/TR/testrepo.git/info/refs?service=git-upload-pack'
* Couldn't find host phabricator.vonji.fr in the .netrc file; using defaults
* Hostname was found in DNS cache
*   Trying 62.210.236.42...
* Connected to phabricator.vonji.fr (62.210.236.42) port 80 (#2)
* Server auth using Basic with user 'loup.peluso'
> GET /diffusion/TR/testrepo.git/info/refs?service=git-upload-pack HTTP/1.0
Authorization: Basic bG91cC5wZWx1c286XlVxSlBvQzhiOHEyS3paJTN5Rnk=
User-Agent: git/1.9.1
Host: phabricator.vonji.fr
Accept: */*
Accept-Encoding: gzip
Pragma: no-cache

* HTTP 1.0, assume close after body
< HTTP/1.0 403 This repository is not available over HTTP.
< Date: Sun, 29 Nov 2015 00:39:36 GMT
< Server: Apache/2.4.7 (Ubuntu)
< X-Powered-By: PHP/5.5.9-1ubuntu4.14
< Content-Length: 47
< Connection: close
< Content-Type: text/html
< 
* Closing connection 2
fatal: unable to access 'http://phabricator.vonji.fr/diffusion/TR/testrepo.git/': The requested URL returned error: 403

Authentication Failure
This Phabricator install is not configured with any enabled authentication providers which can be used to log in. If you have accidentally locked yourself out by disabling all providers, you can use phabricator/bin/auth recover <username> to recover access to an administrative account.

I get this when I visit your site. I'm not sure how to reproduce the errors you're seeing. Can you provide clear, reproducible steps for us? See Contributing Bug Reports.

Ephasme closed this task as Invalid.EditedNov 29 2015, 10:31 AM
Ephasme claimed this task.

My bad, I didn't activate the option serving this repository over HTTP!
This wasn't a bug at all it's just I didn't ready the instruction carefully.
I missed this line:

Make sure you've added an SSH public key to your account. You can do this in SettingsSSH Public Keys.