Coder Social home page Coder Social logo

Comments (7)

AlanLongYu avatar AlanLongYu commented on August 20, 2024 7

Yes I have the trouble too! I want to import some csv data to graph.db ,but always display error.
Because the docker run a instance of neo4j which I can access it about http://localhost:7474/
but how can I stop the process rather than simply stop the container.

/var/lib/neo4j # neo4j-admin import --nodes=import/movies.csv --database graph.db
Neo4j version: 3.5.5
Importing the contents of these files into /data/databases/graph.db:
Nodes:
/var/lib/neo4j/import/movies.csv

Available resources:
Total machine memory: 3.86 GB
Free machine memory: 895.90 MB
Max heap memory : 491.00 MB
Processors: 1
Configured max memory: 3.04 GB
High-IO: false

IMPORT FAILED in 18047d 12h 53m 50s 261ms.
Data statistics is not available.
Peak memory usage: 0.00 B
Import error: org.neo4j.io.pagecache.impl.FileLockException: This file is locked by another process, please ensure you don't have another Neo4j process or tool using it: '/data/databases/graph.db/neostore'.'
Caused by:org.neo4j.io.pagecache.impl.FileLockException: This file is locked by another process, please ensure you don't have another Neo4j process or tool using it: '/data/databases/graph.db/neostore'.'
org.neo4j.kernel.impl.store.UnderlyingStorageException: org.neo4j.io.pagecache.impl.FileLockException: This file is locked by another process, please ensure you don't have another Neo4j process or tool using it: '/data/databases/graph.db/neostore'.'
at org.neo4j.kernel.impl.store.NeoStores.verifyRecordFormat(NeoStores.java:217)
at org.neo4j.kernel.impl.store.NeoStores.(NeoStores.java:144)
at org.neo4j.kernel.impl.store.StoreFactory.openNeoStores(StoreFactory.java:129)
at org.neo4j.kernel.impl.store.StoreFactory.openAllNeoStores(StoreFactory.java:93)
at org.neo4j.unsafe.impl.batchimport.store.BatchingNeoStores.instantiateStores(BatchingNeoStores.java:237)
at org.neo4j.unsafe.impl.batchimport.store.BatchingNeoStores.createNew(BatchingNeoStores.java:181)
at com.neo4j.unsafe.impl.batchimport.RestartableParallelBatchImporter.fastForwardToLastCompletedState(RestartableParallelBatchImporter.java:190)
at com.neo4j.unsafe.impl.batchimport.RestartableParallelBatchImporter.doImport(RestartableParallelBatchImporter.java:113)
at org.neo4j.tooling.ImportTool.doImport(ImportTool.java:585)
at org.neo4j.commandline.dbms.CsvImporter.doImport(CsvImporter.java:128)
at org.neo4j.commandline.dbms.ImportCommand.execute(ImportCommand.java:236)
at org.neo4j.commandline.admin.AdminTool.execute(AdminTool.java:127)
at org.neo4j.commandline.admin.AdminTool.main(AdminTool.java:51)
Suppressed: java.lang.IllegalStateException: VM pause monitor is not started
at org.neo4j.util.Preconditions.checkState(Preconditions.java:142)
at org.neo4j.kernel.monitoring.VmPauseMonitor.stop(VmPauseMonitor.java:71)
at org.neo4j.unsafe.impl.batchimport.staging.OnDemandDetailsExecutionMonitor.done(OnDemandDetailsExecutionMonitor.java:128)
at org.neo4j.unsafe.impl.batchimport.staging.MultiExecutionMonitor.done(MultiExecutionMonitor.java:82)
at org.neo4j.unsafe.impl.batchimport.staging.MultiExecutionMonitor.done(MultiExecutionMonitor.java:82)
at org.neo4j.unsafe.impl.batchimport.ImportLogic.close(ImportLogic.java:520)
at com.neo4j.unsafe.impl.batchimport.RestartableParallelBatchImporter.doImport(RestartableParallelBatchImporter.java:118)
... 5 more
Caused by: org.neo4j.io.pagecache.impl.FileLockException: This file is locked by another process, please ensure you don't have another Neo4j process or tool using it: '/data/databases/graph.db/neostore'.'
at org.neo4j.io.pagecache.impl.SingleFilePageSwapper.acquireLock(SingleFilePageSwapper.java:227)
at org.neo4j.io.pagecache.impl.SingleFilePageSwapper.(SingleFilePageSwapper.java:178)
at org.neo4j.io.pagecache.impl.SingleFilePageSwapperFactory.createPageSwapper(SingleFilePageSwapperFactory.java:66)
at org.neo4j.io.pagecache.impl.muninn.MuninnPagedFile.(MuninnPagedFile.java:149)
at org.neo4j.io.pagecache.impl.muninn.MuninnPageCache.map(MuninnPageCache.java:408)
at org.neo4j.kernel.impl.store.MetaDataStore.getRecord(MetaDataStore.java:285)
at org.neo4j.kernel.impl.store.NeoStores.verifyRecordFormat(NeoStores.java:198)
... 12 more

WARNING Import failed. The store files in /data/databases/graph.db are left as they are, although they are likely in an unusable state. Starting a database on these store files will likely fail or observe inconsistent records so start at your own risk or delete the store manually
unexpected error: org.neo4j.io.pagecache.impl.FileLockException: This file is locked by another process, please ensure you don't have another Neo4j process or tool using it: '/data/databases/graph.db/neostore'.'

from docker-neo4j.

nicorikken avatar nicorikken commented on August 20, 2024 1

Same issue here, using it in Kubernetes. For now I use a workaround:

  1. Start the container with a custom command to ensure it is remains running: tail -f /dev/null
  2. Exec into the container and run the admin commands.
  3. Stop the container and restart it with the default command.

To solve the use-case of imports I'm now working on using a Kubernetes initContainer to seed the database using a previously registered dump.

from docker-neo4j.

spacecowboy avatar spacecowboy commented on August 20, 2024

If you're going to the trouble of making your own docker image to use supervisord I'd heavily recommend that you run neo4j directly instead of the entrypoint script. Then you wouldn't have to fight the setting code.

So something like

[program:neo4j]
command=/var/lib/neo4j/bin/neo4j console
stopsignal=INT

from docker-neo4j.

streamnsight avatar streamnsight commented on August 20, 2024

using supervisord in a docker container is not the way to go: if you process dies, the container dies. Just restart the container. Docker provides the --restart always flag for this purpose.

from docker-neo4j.

Rohithzr avatar Rohithzr commented on August 20, 2024

@spacecowboy I am in a situation where I want to restore a graph.db folder from a different machine. The process needs me to unbind the cluster-state. But because I am running docker containers, stopping the process will simply stop the container.

from docker-neo4j.

acarl005 avatar acarl005 commented on August 20, 2024

@nicorikken I have the same problem, but a different solution in Kubernetes. I used a Job and created a modified image from the Neo4j image. I mounted a Persistent Volume to this container on /data. From this, I ran neo4j-admin on the data, saving the ingested data to the volume. I then created a Deployment for a fresh, unmodified Neo4j image and mounted this volume to it, so it contained the ingested data.

from docker-neo4j.

tuwid avatar tuwid commented on August 20, 2024

@Rohithzr This would count as an administrative procedure and needs to be done by set of cli parameters where you can import your new graph from the other directory without restarting the main process. The proper solution wouldn't be to make this kind of workaround to keep the container always running, would be to add the proper functionality in neo4j for import from a directory / NFS

Having said that you could override the entrypoint to start neo4j &; and to tail -f somke log file

from docker-neo4j.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.