scttnlsn / dandelion

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

Invalid Revision #114

Closed duser0 closed 9 years ago

duser0 commented 9 years ago

Hi

I had dandelion setup and it seemed to be working okay. But then I found after a few deployments, it wasn't actually deploying the latest revision despite saying so i.e. the files weren't updating.

So I deleted the repo and created a fresh repo and removed the .revision file from the server. Now when I try and deploy it says 'Invalid revision: x' (x being the revision number). Same thing happens even when I specify the revision number in the new repo (do I have to tell Dandelion to switch repos or something?). Even tried adding a new blank .revision file now, and still no luck.

I'm using v.0.4.6... So I thought I'd try and update to the latest version of Dandelion, but then I get this error:


gem update dandelion Updating installed gems Updating dandelion Building native extensions. This could take a while... ERROR: Error installing dandelion: ERROR: Failed to build gem native extension.

/Users/J/.rvm/rubies/ruby-2.0.0-p353/bin/ruby extconf.rb

checking for cmake... no ERROR: CMake is required to build Rugged. * extconf.rb failed * Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

Provided configuration options: --with-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/Users/J/.rvm/rubies/ruby-2.0.0-p353/bin/ruby

Gem files will remain installed in /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/rugged-0.21.2 for inspection. Results logged to /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/rugged-0.21.2/ext/rugged/gem_make.out Gems updated: rugged


It's strange as it's all working fine with another repo and server setup. Not a ruby dev (evidently), so any help would be much appreciated!

Thanks

p.s. Also is there any way to deploy from scratch again? That would be very helpful.

scttnlsn commented 9 years ago

Try running brew install ckmake before installing Dandelion.

Dandelion will look for the closest Git repository root (i.e. directory containing a .git directory) from your current working directory. Are you inside your project directory structure when running dandelion deploy? Please try running git show <revision> to check if the revision is actually invalid or if this is a bug in Dandelion. I suspect Dandelion may still be reading the old .revision file which now contains an invalid revision.

If you remove the .revision file from the server then Dandelion will re-deploy everything to the remote server.

duser0 commented 9 years ago

Thanks for getting back... When I run git show , it comes up with the correct and latest revision for the new repo.

I'm definitely in the project directory when running. Strange as I had already removed the .revision file and had no luck before adding a blank .revision file. That's what totally stopped it running and gave me the invalid error. I removed the revision file and had the exact same issue, (when I moved repos I deleted the old .git folder and replaced it with a completely fresh one too).

I tried running brew install ckmake and it threw an error and realised there was a typo and tried brew install cmake instead, which is now installed.

When updating Dandelion it says the following, which I assume means it has installed okay?


gem update dandelion Updating installed gems Updating dandelion Building native extensions. This could take a while... Successfully installed rugged-0.21.2 Fetching: dandelion-0.4.9.gem (100%) ! The 'dandelion' gem is installed but you may need to install additional ! gems depending on the adapters you intend to use. ! ! Running 'dandelion status' in your project directory will indicate which ! additional gems need to be installed. Successfully installed dandelion-0.4.9 Parsing documentation for dandelion-0.4.9 Installing ri documentation for dandelion-0.4.9 Installing darkfish documentation for dandelion-0.4.9 Parsing documentation for rugged-0.21.2 unable to convert "\xCF" from ASCII-8BIT to UTF-8 for lib/rugged/rugged.bundle, skipping Installing ri documentation for rugged-0.21.2 Installing darkfish documentation for rugged-0.21.2 Gems updated: dandelion rugged


Thanks for your time and help so far!

p.s. Stupid question coming up... How can I remove Dandelion cleanly so I can reinstall it?

duser0 commented 9 years ago

Stranger still, I setup dandelion in different repo (deploying to same server but different files and repo).

And it said it deployed everything, listed all the files out, but nothing updated on the server... :-s

duser0 commented 9 years ago

OK, now when I tried to push a submodule up within this other repo (let's call it Repo B) which as far as I can tell should just committing some more files (never used submodules until today), it threw up this error.

Not sure if it's because of the submodule... Regardless the initial commit still didn't deploy anything to the server.


/Users/J/.rvm/gems/ruby-2.0.0-p353/gems/rugged-0.21.2/lib/rugged/repository.rb:99:in lookup': Object not found - failed to find pack entry (32295aaaf7264581e0cb30d3351cfe1dc234e2e1) (Rugged::OdbError) from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/rugged-0.21.2/lib/rugged/repository.rb:99:inlookup' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/tree.rb:19:in block in data' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/tree.rb:14:ineach' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/tree.rb:14:in data' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/changeset.rb:27:inblock (2 levels) in each' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/change.rb:12:in call' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/change.rb:12:indata' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/deployer.rb:49:in deploy_change!' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/deployer.rb:13:inblock in deploy_changeset!' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/changeset.rb:28:in block in each' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/diff.rb:41:inblock in each' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/diff.rb:37:in each' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/diff.rb:37:ineach' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/changeset.rb:20:in each' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/deployer.rb:9:indeploy_changeset!' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/command/deploy.rb:55:in deploy_changeset!' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/command/deploy.rb:30:inexecute!' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/cli.rb:73:in execute!' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/bin/dandelion:8:in<top (required)>' from /Users/J/.rvm/gems/ruby-2.0.0-p353/bin/dandelion:23:in load' from /Users/J/.rvm/gems/ruby-2.0.0-p353/bin/dandelion:23:in

' from /Users/J/.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in eval' from /Users/J/.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in
'

scttnlsn commented 9 years ago

Yeah, sorry that was a typo. brew install cmake is what I meant. Glad you got it installed. Are you deploying multiple projects to the same remote destination? If so you'll need to set the revision_file in your config to something unique for each project or the deploys will step on each others' toes.

What version of Git are you using? I'll try and reproduce this locally. What Dandelion adapter are you using?

duser0 commented 9 years ago

Aha! i just added...

revision_file: .revision-a revision_file: .revision-b

... for the two respective repo's A and B respectively, created the equivalent files and that seems to be running the deployment. The files are listed and there's no more 'invalid revision' error. Just ran dandelion status too and the remote revision matches the local HEAD revision.

However, just had a look at the server and the files don't seem to have deployed :-s. Hoping I'm not doing something indescribably stupid?...

git version: 1.7.12.4 adapter: sftp

Thanks!

duser0 commented 9 years ago

Also, just took a look at the new revision files and they appear to be empty, so looks like nothing actually happened.

Now when I try and deploy again, it says there are no changes to deploy and running dandelion status just shows them as matching.

duser0 commented 9 years ago

Turned out there were two things going on...

The repo suddenly appeared to be empty this morning, after commits being pushed yesterday, no idea how that happened.

Also, I irritatingly forgot the forward slash before the path in dandelion.yml

Thanks so much for your time and help!

duser0 commented 9 years ago

Spoke too soon.

It seems that a forward slash is already prepended to the path... But without adding one it doesn't deploy.

Looking at another repo now and getting the error below. This repo contains a submodule repository and it's only when it tries to write those files that it fails it seems (directory name 'b')...

Thanks

Skipping file: .gitignore Writing file: .gitmodules Writing file: .htaccess Writing file: README.md Writing file: b /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/rugged-0.21.2/lib/rugged/repository.rb:99:inlookup': Object not found - failed to find pack entry (522356140889d83bc5ff02d4cbfdb65b70f6e014) (Rugged::OdbError) from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/rugged-0.21.2/lib/rugged/repository.rb:99:in lookup' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/tree.rb:19:inblock in data' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/tree.rb:14:in each' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/tree.rb:14:indata' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/changeset.rb:27:in block (2 levels) in each' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/change.rb:12:incall' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/change.rb:12:in data' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/deployer.rb:49:indeploy_change!' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/deployer.rb:13:in block in deploy_changeset!' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/changeset.rb:28:inblock in each' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/diff.rb:58:in block in each' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/diff.rb:57:ineach' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/diff.rb:57:in each' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/changeset.rb:20:ineach' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/deployer.rb:9:in deploy_changeset!' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/command/deploy.rb:55:indeploy_changeset!' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/command/deploy.rb:30:in execute!' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/lib/dandelion/cli.rb:73:inexecute!' from /Users/J/.rvm/gems/ruby-2.0.0-p353/gems/dandelion-0.4.9/bin/dandelion:8:in <top (required)>' from /Users/J/.rvm/gems/ruby-2.0.0-p353/bin/dandelion:23:inload' from /Users/J/.rvm/gems/ruby-2.0.0-p353/bin/dandelion:23:in <main>' from /Users/J/.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:ineval' from /Users/J/.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in <main>'

duser0 commented 9 years ago

Fixed by following this: https://github.com/scttnlsn/dandelion/issues/37

Basically excluded the submodule folder within dandelion.yml, and then added another dandelion.yml file within the submodule folder and set that to deploy to the target subfolder on the server instead.

Just need to deploy twice one for each dandelion folder :)

Thanks for your time!