{"action":"created","issue":{"url":"https://api.github.com/repos/fabsx00/joern/issues/43","labels_url":"https://api.github.com/repos/fabsx00/joern/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/fabsx00/joern/issues/43/comments","events_url":"https://api.github.com/repos/fabsx00/joern/issues/43/events","html_url":"https://github.com/fabsx00/joern/issues/43","id":54386804,"number":43,"title":"Does not appear to work with Neo4j-2.1.6","user":{"login":"pmarkowsky","id":1851972,"avatar_url":"https://avatars.githubusercontent.com/u/1851972?v=3","gravatar_id":"","url":"https://api.github.com/users/pmarkowsky","html_url":"https://github.com/pmarkowsky","followers_url":"https://api.github.com/users/pmarkowsky/followers","following_url":"https://api.github.com/users/pmarkowsky/following{/other_user}","gists_url":"https://api.github.com/users/pmarkowsky/gists{/gist_id}","starred_url":"https://api.github.com/users/pmarkowsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmarkowsky/subscriptions","organizations_url":"https://api.github.com/users/pmarkowsky/orgs","repos_url":"https://api.github.com/users/pmarkowsky/repos","events_url":"https://api.github.com/users/pmarkowsky/events{/privacy}","received_events_url":"https://api.github.com/users/pmarkowsky/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-01-14T22:33:32Z","updated_at":"2015-01-14T23:20:06Z","closed_at":"2015-01-14T23:20:06Z","body":"I'm attempting to containerize joern, as I'd like to make it super easy to install and use out of the box.\r\n\r\nWhen attempting to follow the tutorial in my container, built with the Dockerfile below I keep running into an error indicating that the database created by joren is corrupted. This error appears in neo4j's console.log when attempting to start the neo4j-server with the org.neo4j.server.database.location set to my own .jorenIndex directory.\r\n\r\n<pre>\r\n2015-01-14 21:58:52.962+0000 INFO  [API] Setting startup timeout to: 120000ms based on -1\r\nDetected incorrectly shut down database, performing recovery..\r\n</pre>\r\n\r\nSteps to reproduce\r\n\r\nBuild the joern container\r\n1.) run docker build --tag=joern-0.3.1 . from a directory with the attached Dockerfile\r\n\r\nThis uses neo4j's PPA to install the server from packages the current version is 2.1.6 (as it is hard to find exact packages / downloads for 2.1.5)\r\n\r\n2.) run the container\r\n\r\ndocker run -it --privileged --name joern joern-0.3.1 /bin/bash\r\n\r\n3.) inside the contianer from the root prompt up your file via ulimit -n 65535\r\n\r\nThis is to work around an dockers settings and also why we need to use --privileged.\r\n\r\n4.) cd to the $JOERN dirctory (/opt/joern-0.3.1) and \r\n4a.) create subdir named tutorial\r\n4b.) download vlc-2.1.4 to that directory \r\n4c.) cd to /opt/joren-0.3.1 and run ./joren tutorial/vlc-2.1.4 to create the .jorenIndex in /opt/joern-0.3.1\r\n\r\n5.) Edit /etc/neo4j/neo4j-server.properties to point to /opt/joern-0.3.1/.jorenIndex/\r\n\r\nnamely make these changes\r\n<pre>\r\n#location of the database directory\r\n#org.neo4j.server.database.location=data/graph.db\r\norg.neo4j.server.database.location=/opt/joern-0.3.1/.joernIndex/\r\n</pre>\r\n\r\n6.) Attempt to start neo4j via services command service neo4j-service start\r\n\r\nThis will fail like the following:\r\n<pre>\r\nroot@6ae06dfe9067:/opt/joern-0.3.1# service neo4j-service start\r\nUsing additional JVM arguments:  -server -XX:+DisableExplicitGC -Dorg.neo4j.server.properties=conf/neo4j-server.properties -Djava.util.logging.config.file=conf/logging.properties -Dlog4j.configuration=file:conf/log4j.properties -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:-OmitStackTraceInFastThrow\r\nStarting Neo4j Server...WARNING: not changing user\r\nprocess [692]... waiting for server to be ready.. Failed to start within 120 seconds.\r\nNeo4j Server may have failed to start, please check the logs.\r\n</pre>\r\n\r\n7.) check /var/log/neo4j/console.log to see the aforementioned error message.\r\n\r\nSince I can't attach the Dockerfile in a ticket below are its contents.\r\n\r\n<pre>\r\nFROM ubuntu:latest\r\nMAINTAINER Pete Markowsky <peterm@vodun.org>\r\nRUN apt-get update && apt-get install -y wget unzip git && apt-get clean\r\n#Add the official neo4j PPA\r\nRUN wget -O - http://debian.neo4j.org/neotechnology.gpg.key | apt-key add -\r\nRUN echo 'deb http://debian.neo4j.org/repo stable/' > /etc/apt/sources.list.d/neo4j.list \r\n# install packages\r\nRUN apt-get update && apt-get upgrade -y && apt-get install -y openjdk-7-jdk python-dev python-setuptools python-pip graphviz libgraphviz-dev neo4j ant python-pygraphviz python-pip && apt-get clean\r\n# install joern \r\nRUN cd /opt/ && wget https://github.com/fabsx00/joern/archive/0.3.1.tar.gz && tar xfzv 0.3.1.tar.gz\r\nRUN cd /opt/joern-0.3.1 && wget http://mlsec.org/joern/lib/lib.tar.gz && tar xfzv lib.tar.gz\r\nRUN cd /opt/joern-0.3.1 && ant\r\n# Install gremlin plugin\r\nRUN cd /tmp && wget -O neo4j-gremlin.zip http://mlsec.org/joern/lib/neo4j-gremlin-plugin-2.1-SNAPSHOT-server-plugin.zip && unzip neo4j-gremlin.zip -d /usr/share/neo4j/plugins/gremlin-plugin\r\n#install joern tools\r\nRUN cd /tmp/ && git clone https://github.com/fabsx00/joern-tools && cd joern-tools && python2 setup.py install\r\n</pre>\r\n"},"comment":{"url":"https://api.github.com/repos/fabsx00/joern/issues/comments/70012748","html_url":"https://github.com/fabsx00/joern/issues/43#issuecomment-70012748","issue_url":"https://api.github.com/repos/fabsx00/joern/issues/43","id":70012748,"user":{"login":"pmarkowsky","id":1851972,"avatar_url":"https://avatars.githubusercontent.com/u/1851972?v=3","gravatar_id":"","url":"https://api.github.com/users/pmarkowsky","html_url":"https://github.com/pmarkowsky","followers_url":"https://api.github.com/users/pmarkowsky/followers","following_url":"https://api.github.com/users/pmarkowsky/following{/other_user}","gists_url":"https://api.github.com/users/pmarkowsky/gists{/gist_id}","starred_url":"https://api.github.com/users/pmarkowsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmarkowsky/subscriptions","organizations_url":"https://api.github.com/users/pmarkowsky/orgs","repos_url":"https://api.github.com/users/pmarkowsky/repos","events_url":"https://api.github.com/users/pmarkowsky/events{/privacy}","received_events_url":"https://api.github.com/users/pmarkowsky/received_events","type":"User","site_admin":false},"created_at":"2015-01-14T23:20:06Z","updated_at":"2015-01-14T23:20:06Z","body":"Ugh, permissions were the issue. Sorry about that.\r\n\r\nI'll need to update the Dockerfile to set the umask or something.\r\n\r\n<pre>\r\nroot@ea06fb7fc19d:/opt/joern-0.3.1#  service neo4j-service start\r\n...output snipped...\r\nProcess [313]... waiting for server to be ready.... OK.\r\nhttp://localhost:7474/ is ready.\r\nroot@ea06fb7fc19d:/opt/joern-0.3.1# echo 'g.v(0).out()' | joern-lookup -g\r\n\r\n(n2351381 {filepath:\"/opt/joern-0.3.1/tutorial/vlc-2.1.4/test\",type:\"Directory\"})\r\n(n2010797 {filepath:\"/opt/joern-0.3.1/tutorial/vlc-2.1.4/src\",type:\"Directory\"})\r\n...snipped...\r\n</pre>\r\n\r\nBut that said the Dockerfile works to produce a container with an installed version of joern e.g. \r\nyou just need to do the following.\r\n\r\n<pre>\r\ndocker build --tag=joren-0.3.1 .\r\n</pre>\r\n\r\nI'll try to clean up what I have and submit a PR."}}