scttnlsn / dandelion

Incremental Git repository deployment.
http://scttnlsn.github.io/dandelion
MIT License
738 stars 60 forks source link

Reference 'refs/heads/master' not found (Rugged::ReferenceError) #139

Closed ghost closed 8 years ago

ghost commented 8 years ago

Get the following error when trying to deploy with Dandelion:

/home/user/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/dandelion-0.4.14/lib/dandelion/workspace.rb:69:in `head': Reference 'refs/heads/master' not found (Rugged::ReferenceError)
    from /home/user/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/dandelion-0.4.14/lib/dandelion/workspace.rb:69:in `local_sha'
    from /home/user/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/dandelion-0.4.14/lib/dandelion/workspace.rb:29:in `local_commit'
    from /home/user/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/dandelion-0.4.14/lib/dandelion/command/deploy.rb:24:in `execute!'
    from /home/user/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/dandelion-0.4.14/lib/dandelion/cli.rb:73:in `execute!'
    from /home/user/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/dandelion-0.4.14/bin/dandelion:8:in `<top (required)>'
    from /home/user/.rbenv/versions/2.2.2/bin/dandelion:23:in `load'
    from /home/user/.rbenv/versions/2.2.2/bin/dandelion:23:in `<main>'

Could the Ruby version I am using be the problem (ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux])?

scttnlsn commented 8 years ago

For future reference- what was the issue?

ghost commented 8 years ago

In order to test Dandelion, I had created a folder with some sample files on my localhost, which I initalized with Git, but I had not committed any changes. After the first commit, the initial error message did not come up again.

However, strange thing is that when I am trying to deploy the test folder to to a live server (http://example.com/dandelion_test, i.e. /var/www/html/dandelion_test - I have not created this folder yet on the live server), the script says that changes are deployed, but the files cannot be found on the server:

Connecting to sftp://MyUsername@107.177.777.777/var/www/html
Remote revision:    0f475648538c1061e56d35fee39bf4b1576f982e
Deploying revision: 419c725515ac910e44c17420ac8a9c1e95670431
Deploying changes...
Writing file:  contact.html
Skipping file: dandelion.yml
Writing file:  index.html

This is my configuration file:

adapter: sftp
host: 107.177.777.777
username: MyUsername
password: MyPassword
port: 21001
path: var/www/html

exclude:
    - .gitignore
    - dandelion.yml
    - news.html
    - .git/

Seems like nothing is actually pushed to the server.

Any idea what is wrong?

scttnlsn commented 8 years ago

Looks like you may be deploying to a relative path (var/www/html = ~/var/www/html) instead of /var/www/html.

ghost commented 8 years ago

Just tried that as well but the same result; nothing is deployed to the server although I get the deployment messages in the console. Could that be a write access problem; i.e. the Dandelion script does not have sufficient rights to create and write the files on the live server?

scttnlsn commented 8 years ago

You'd typically see Dandelion throw an exception if there is an access problem. Could you try uploading the files w/ a different SFTP client to make sure it's not a server issue?

scttnlsn commented 8 years ago

Need more info to debug this. @4Digits If this is still an issue for you please re-open.