dimchris / mdanalysis

Automatically exported from code.google.com/p/mdanalysis
0 stars 0 forks source link

suddenly denied write access to git repo using .netrc #89

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. add username and google code password to ~/.netrc as outlined in 
http://code.google.com/p/mdanalysis/source/checkout
2. 'git push' to either https://code.google.com/p/mdanalysis or 
https://code.google.com/p/mdanalysis.wiki

What is the expected output? What do you see instead?

It should push the changes.

Instead I get the error

 Pushing to https://code.google.com/p/mdanalysis
 fatal: remote error: Invalid username/password.
 You may need to use your generated googlecode.com password; see https://code.google.com/hosting/settings

I changed the google code password but that did not help. About two days ago 
(2011-11-30) it was still all working as expected. Then on 2011-12-01 I got an 
error similar to the following (from memory): 

 fatal: https://code.google.com/p/mdanalysis/info/refs not found: did you run git update-server-info on the server?

and now the above.

WORKAROUND

Apparently (my?) git is ignoring netrc because specifying username explicitly 
in the URL and providing the password works:

  git push -v https://orbeckst@code.google.com/p/mdanalysis master
  Pushing to https://orbeckst@code.google.com/p/mdanalysis
  Password: 
  Counting objects: 21, done.
  ...
  To https://orbeckst@code.google.com/p/mdanalysis
     1750084..f7b4fd5  master -> master

NOTE

I suspect that there's something going on behind the scenes at gcode but if the 
problem persists I'll try to file an Issue for google code.

If anyone else has/had this problem please add comments below.

Cheers,
Oliver

Original issue reported on code.google.com by orbeckst on 2 Dec 2011 at 5:49

GoogleCodeExporter commented 9 years ago
I'm having the exact same problem, except that I'm not using .netrc file :S
And I can pull normally, but not push.

Original comment by clari.al...@gmail.com on 5 Dec 2011 at 12:37

GoogleCodeExporter commented 9 years ago
Hi Clari,

In order to push to the MDAnalysis git repository you would need to be 
registered as a committer on the project. If you want to contribute to the 
development you don't need to be a committer, though: You can simply *clone* 
the repository under your name [1] and work on the clone. Once there are 
feature that you want to contribute, you file an enhancement request on the 
issue tracker and tell us the clone to pull from. We'll then review your 
enhancement and possibly merge it into MDAnalysis.

Oliver

[1] http://code.google.com/p/mdanalysis/source/clones

Original comment by orbeckst on 5 Dec 2011 at 3:50

GoogleCodeExporter commented 9 years ago
Sorry, I didn't made myself clear; I'm working in another proyect, which I own, 
and I have the same problem when trying to push. So it has to do with 
googlecode... I ended up here while looking for a solution to this problem :(

Original comment by clari.al...@gmail.com on 5 Dec 2011 at 9:58

GoogleCodeExporter commented 9 years ago
Clari,

I'm, sorry, I completely misunderstood!

As I said above, pushing worked for me when explicitly adding my username to 
the url. (I also regenerated my gcode password once, as suggested by the error 
message but I have no idea if this helped.)

Oliver

Original comment by orbeckst on 5 Dec 2011 at 11:12

GoogleCodeExporter commented 9 years ago
As of 2011-12-06 the .netrc-based push still does not work. It is possible to 
add the PASSWORD to the command line

  git push https://USERNAME:PASSWORD@code.google.com/p/mdanalysis master

It is also possible to directly use the URL in the .git/config file. For 
instance, I have

  [remote "origin"]
        fetch = +refs/heads/*:refs/remotes/origin/*
        #url = https://code.google.com/p/mdanalysis
        url = https://USERNAME:PASSWORD@code.google.com/p/mdanalysis 
  [branch "master"]
        remote = origin
        merge = refs/heads/master

which allows me (again) to simply push changes to the master in the googlecode 
repo "origin" with

  git push

(Disclaimer: possibly it is less secure to have the password in the url in 
.git/config.)

Original comment by orbeckst on 6 Dec 2011 at 6:33

GoogleCodeExporter commented 9 years ago
Oliver,

Are you still experiencing this issue?

My ~/.netrc is set up as mentioned by 
http://code.google.com/p/mdanalysis/source/checkout and I just pushed a small 
commit to the master branch without trouble.

Here is my .git/config:
[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = https://code.google.com/p/mdanalysis
[branch "master"]
    remote = origin
        merge = refs/heads/master
[branch "testdata"]
        remote = origin
        merge = refs/heads/MDAnalysisTestData

Except for the "testdata" branch, everything was written automatically by git 
when running:
git clone https://code.google.com/p/mdanalysis/

Basically, I just dumbly followed the option 2 from the "Source Checkout" page.

My git version is 1.7.5.4 (from Ubuntu 11.10 repos).

About your disclaimer: I don't think it is more secure to store the password in 
~/.netrc as .git/config is not pushed to remote repos. Just make sure that only 
the owner is able to read the file (use "chown go-rw" for instance)
Anyhow, you always regenerate your GoogleCode.com password on your settings 
page (https://code.google.com/hosting/settings)
Cheers,

Séb

Original comment by sebastie...@gmail.com on 11 Dec 2011 at 11:45

GoogleCodeExporter commented 9 years ago
Still does not work for me (git 1.7.6.1 from MacPorts on Mac OS X 10.6.8):

 git push origin master
 fatal: remote error: Invalid username/password.
 You may need to use your generated googlecode.com password; see https://code.google.com/hosting/settings

Given that the workaround works I downgrade the priority.

Original comment by orbeckst on 19 Dec 2011 at 2:24

GoogleCodeExporter commented 9 years ago
Hi all,

I got the same problem with git, and my solution was to add the password to the 
git push command line.

git push -v https://[USER]:[PASSWORD]@code.google.com/p/project/

Regards

Original comment by luiscamp...@gmail.com on 12 Jan 2012 at 11:20

GoogleCodeExporter commented 9 years ago
Yes, comment #5 worked for me.

Original comment by a.sanchez75 on 10 Feb 2012 at 10:42

GoogleCodeExporter commented 9 years ago
Apparently, the format of .netrc has changed. 
http://code.google.com/p/support/issues/detail?id=5790#c10 pointed out that the 
format has to be

  machine code.google.com login <USERNAME>@gmail.com password <PASSWORD>

I didn't have the "password" token in my ~/.netrc (d'oh!). After adding it 
works again for me (and hence I am closing this issue.)

(All I can say "It worked for me before" ;-) ).

Original comment by orbeckst on 13 Feb 2012 at 4:38

GoogleCodeExporter commented 9 years ago
it works file with:
change the line in .git/config
    url = https://<USERNAME>@code.google.com/p/project/
to
    url = https://code.google.com/p/project/

try it.

Original comment by hight...@gmail.com on 17 Mar 2012 at 3:15

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
last advice is realy work!
Thank!

Original comment by Jarop...@gmail.com on 5 Aug 2012 at 7:19

GoogleCodeExporter commented 9 years ago
Comment #10 was the solution I needed.  Thank you orbeckst!

Original comment by Ja...@lenzplace.org on 26 Aug 2012 at 2:25

GoogleCodeExporter commented 9 years ago
++ For solution #11 ;-)
Thanks.

Original comment by Maquinay...@gmail.com on 30 Jun 2013 at 9:21

GoogleCodeExporter commented 9 years ago
Comment #11 worked for me! Thanks!

Original comment by andrewault on 4 Nov 2013 at 3:30