Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Neo4j installation is buggy #823

Closed
olance opened this issue Jun 5, 2015 · 5 comments
Closed

Neo4j installation is buggy #823

olance opened this issue Jun 5, 2015 · 5 comments

Comments

@olance
Copy link
Contributor

olance commented Jun 5, 2015

I've just updated to 5.0.0.rc.2 to use the fixed rake tasks and found two issues with the install task:

When I first run bundle exec rake protected_neo4j_install[community-2.2.2,test] it installs Neo4j in db/neo4j/test/. I get all files directly under the test folder.

If I run the rake task a second time, everything runs again but this time I end up with a neo4j-community-2.2.2 folder inside db/neo4j/test/ and all newly installed files within this new folder.

Subsequent runs will fail with error:

mv: rename neo4j-community-2.2.2 to db/neo4j/test/neo4j-community-2.2.2: Directory not empty
rake aborted!
Unable to run: mv neo4j-community-2.2.2 db/neo4j/test

A way to fix this could be to remove the test directory before trying to move the extracted archive.
I do not have time right now to fork/PR but I have fixed the problem locally for UNIX systems (starting line 113 of neo4j_server.rake):

    else
      system_or_fail("tar -xvf #{downloaded_file}")
      system_or_fail("rm -rf #{install_location(args)}")
      system_or_fail("mv neo4j-#{edition} #{install_location(args)}")
      system_or_fail("rm #{downloaded_file}")
      puts 'Neo4j Installed in to neo4j directory.'
    end

Other issues

  • Well first, this fix would shamelessly overwrite everything in an existing DB folder without warning... but as I can tell from how the task works, that was already not a problem (?).
  • When the archive already exists in the project's root folder, installation will fail with error:
tar: Option -f requires an argument
Usage:
  List:    tar -tf <archive-filename>
  Extract: tar -xf <archive-filename>
  Create:  tar -cf <archive-filename> [filenames...]
  Help:    tar --help
rake aborted!
Unable to run: tar -xvf

That's because download_neo4j_unless_exists will return nil when the file already exists instead of returning the name of the (already) downloaded file.

@cheerfulstoic
Copy link
Contributor

Good catch, thanks! We could certainly do this, though we'd probably want a prompt asking the user to verify that they're OK with the old directory being deleted. Maybe showing the size of the data/graph.db directory.

Or maybe there could be a separate command to remove the installation. It would be nice if you could run a command to update the installation of Neo4j as I've often wanted to do that and I end up doing it manually

@olance
Copy link
Contributor Author

olance commented Jun 6, 2015

Well the current behaviour would already overwrite everything if the mv bug wasn't there so I guess that would be acceptable as a first quick fix until something better is done?

@cheerfulstoic
Copy link
Contributor

I started working on this, but I was so frustrated by the state of the rake tasks that I extracted the code into classes and then extracted it into a separate gem:

https://github.com/neo4jrb/neo4j-rake_tasks

I haven't done this ticket yet, but it should be much easier when I'm done ;)

@olance
Copy link
Contributor Author

olance commented Jul 10, 2015

Ah, good idea! I found the rake tasks code a bit messy indeed ^_^

But sometimes I look at the code I have written some years ago and well...

@cheerfulstoic
Copy link
Contributor

Moved to neo4jrb/neo4j-rake_tasks#4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants