Jason Harder
Jason Harder

Reputation: 441

Deploying to dokku (repo does not exist)

Hi I've been having trouble with dokku and basically it boils down to this:

git remote add dokku [email protected]:ruby-getting-started

and then I get:

git push dokku master
[email protected]'s password:
fatal: 'ruby-getting-started' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

dokku ssh-keys:list - had my SSH key included. (created in Dokku and added to github)

dokku apps:create appname 

seemed to create the app

    git remote -v returns dokku [email protected]:ruby-getting-started (fetch)
dokku   [email protected]:ruby-getting-started (push)
origin  [email protected]:myuser/ruby-getting-started.git (fetch)
origin  [email protected]:myuser/ruby-getting-started.git (push)

Seemed to create the app since its in the list. so what am i missing?

update ssh'd into my instance and added this

cat ~/.ssh/id_rsa.pub| sudo sshcommand acl-add dokku Jason_Laptop
[sudo] password for jasonh:
SHA256:*******************

update

cat ~/.ssh/public_dokku.pub - then copied the contents to my dokku RSA file.

output of the command is the same cat ~/.ssh/id_rsa.pub (cept i named my file dokku rsa or something)

Here is my git remote -v

dokku   [email protected]:sameappnameaswhatIcreated

Listing SSH brings this key (and others) which i can verify as the name i picked.

SHA256:*********** NAME="Jason_Harder" SSHCOMMAND_ALLOWED_KEYS="no-agent-forwarding,no-user-rc,no-X11-forwarding,no-port-forwarding"

My config file in ~./ssh since my main ssh is for github. Host * AddKeysToAgent yes UseKeychain yes IdentityFile ~/.ssh/public_dokku

Update:

My remote was improperly added originally as git add remote [email protected] or w.e when it should have been [email protected].

Upvotes: 1

Views: 1203

Answers (1)

VonC
VonC

Reputation: 1328562

Following the dokku deployment guide, check first your ssh connection.

The fact you see [email protected]'s password: means SSH does not find your public key in dokku remote server, and falls back to the account password.
Add it, as explained here.

That is:

cd ~/.ssh
ssh-keygen -t rsa -m PEM -P "" -f dokku

# copy dokku.pub to [email protected]:~/.ssh/authorized_keys
# make sure it is copied as one line.

# edit your local ~/.ssh/config file
# add to it:

Host dokku
  Hostname app.app.com
  User jasonh
  IdentityFile ~/.ssh/dokku

Check this is working with ssh -v dokku

You can then change your remote URL to:

git remote set-url dokku dokku:sameappnameaswhatIcreated

Upvotes: 1

Related Questions