How to add local renku project to renkulab?

I used to be able to create a renku project locally using renku init or renku init --force, then create an empty project on renkulab.io, add the path to the remote and push to it. However, there is no more “empty project” in the drop-down list of templates, and if I choose “Minimal renku project” and then try to push to it, the push gets rejected because the remote contains work that I don’t have locally. The documentation at https://renku.readthedocs.io/en/latest/tutorials/02_migrating_to_renku.html does not help with this problem. What is the preverred way of doing this in the current version? Thanks for your help!

1 Like

Hello @schymans , you don’t need to create the new empty project on RenkuLab before pushing. Any non-taken valid name should work fine when pushing.

You can follow the steps here, starting from the section Common steps: How to move projects between different RenkuLab Deployments .

1 Like

I just tried this, but for some reason, I keep getting Authentication failures. To test it, I did:

git clone https://renkulab.io/gitlab/wave/thermodynamic_optimality_blueprint.git
cd thermodynamic_optimality_blueprint
git remote remove origin
git remote add origin https://renkulab.io/gitlab/wave/thermodynamic_optimality_principles.git
git push origin master

For some reason, I was able to clone without being asked for a password, but when I tried to push to a new repo name, I was asked for a username and password, and I keep getting Authentication failures when I use my username stanislaus.schymanski. Any idea what I am doing wrong?

For some reason, I was able to clone without being asked for a password […]

That makes sense since the project is public

I was asked for a username and password, and I keep getting Authentication failures […]

Could you copy/paste here the output you get when running the git command with the verbose option -v? Hide any sensible information

git push origin master -v

This may help in understanding the source of this error.

Another test you can do to be sure there aren’t problems with the group permissions, is pushing to your personal namespace stanislaus.schymanski instead of the wave namespace.
I just tried to replicate your exact steps with my own namespace and it worked fine, so it should be something with permissions/credentials.

Thanks, lorenzo. Yes it must have something to do with my permissions, as even if I push to my personal space I get:

$ git push origin master -v
Pushing to https://renkulab.io/gitlab/stanislaus.schymanski/thermodynamic_optimality_principles.git
Username for 'https://renkulab.io': stanislaus.schymanski
Password for 'https://stanislaus.schymanski@renkulab.io': 
remote: HTTP Basic: Access denied
fatal: Authentication failed for 'https://renkulab.io/gitlab/stanislaus.schymanski/thermodynamic_optimality_principles.git/'

Thanks for trying that. It’s possible the password is not correctly set up in GitLab. The current credential situation is a bit confusing since the user creates an account on RenkuLab. That doesn’t set automatically a password in GitLab.

The first option to fix this would be setting up the password manually to be sure it’s the one you are providing. You can do that from here: https://renkulab.io/gitlab/profile/password/edit
You could also check the actual email address in GitLab and provide that as user credential https://renkulab.io/gitlab/profile

The alternative would be using an access token to push. You can create one on the fly from here https://renkulab.io/gitlab/profile/personal_access_tokens (be sure to include the write_repository scope) and use it to push directly by changing the origin to include the token. The format is: https://oauth2:<access_token>@<git_url>.
In you case, it should be something like this

https://oauth2:bXiMy4UvTa5xszU7a-kG@renkulab.io/wave/thermodynamic_optimality_principles.git

Thanks a lot, @lorenzo! Your first guess seems to be right: I cannot change the password at https://renkulab.io/gitlab/profile/password/edit. It keeps returning: “You must provide your current password in order to change it.” I tried typing the same password I use to log into renkulab and also the one my browser had saved, but always with the same result.
Your second guess is also right. I have a different email address set up in my renkulab-profile than in my local git profile. Is this a problem? It shouldn’t be, as I have different gitlab and github profiles but I am still able to push to them as long as my ssh keys are set up.

The different addresses are not a problem, but it’s important to push with the correct credentials (using the basic authentication and inserting the GitLab email address on the relevant repository should be enough).
Now the problem is resetting your password since the “forgot password” link doesn’t work. You can contact one of us privately and we can manually assist you.

Using the access token is a viable alternative. I’ll expand the other post I linked at the beginning to include more details on this. Your setup is not uncommon at all, and these problems probably happen to other users.

We are working on simplifying all this by adding a sort of renku login command in the cli, so that your RenkuLab credentials can be used from the command line as well. This is likely going to be added in the near future, bit it still requires a bit of work.

1 Like

Thanks so much, @lorenzo! I asked @rrrrrok to reset my password and now it works smoothly, i.e. I was able to create a new project on gitlab with the first push. Is there a way to set up an access token globally, so that I would be able to push through HTTPS to all my projects without having to provide user name and password? Otherwise, I will just change the remote back to SSH after the initial push and not bother with the access tokens.

Hi @schymans - there is a way to store the token and have it used automatically for all repos on renkulab, but it requires a few steps.

step 0 - create the token here - choose the read/write repository scopes

then:

  1. create a file called .gitcredentials in your home directory
  2. put in this string: https://oauth2:<token>@renkulab.io where <token> is the token you copied from step 0
  3. run this command: git config --global credential.helper "store --file=<full-path-to-.gitcredentials>"

Now the token will be injected automatically into every https git request to renkulab.io. If for some reason you want this to be applied for an individual repository, go into the repository directory before running the git config command and do not include the --global flag.

Hope that helps!

Note: I had to use the full path to .gitcredentials, i.e. it wasn’t enough to do ~/.gitcredentials but ymmv

2 Likes