{"action":"created","issue":{"url":"https://api.github.com/repos/graphhopper/graphhopper/issues/315","labels_url":"https://api.github.com/repos/graphhopper/graphhopper/issues/315/labels{/name}","comments_url":"https://api.github.com/repos/graphhopper/graphhopper/issues/315/comments","events_url":"https://api.github.com/repos/graphhopper/graphhopper/issues/315/events","html_url":"https://github.com/graphhopper/graphhopper/issues/315","id":56195841,"number":315,"title":"Exception when using MMAP_STORE_SYNC in Linux (Ubuntu)","user":{"login":"milesizzo","id":10804668,"avatar_url":"https://avatars.githubusercontent.com/u/10804668?v=3","gravatar_id":"","url":"https://api.github.com/users/milesizzo","html_url":"https://github.com/milesizzo","followers_url":"https://api.github.com/users/milesizzo/followers","following_url":"https://api.github.com/users/milesizzo/following{/other_user}","gists_url":"https://api.github.com/users/milesizzo/gists{/gist_id}","starred_url":"https://api.github.com/users/milesizzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/milesizzo/subscriptions","organizations_url":"https://api.github.com/users/milesizzo/orgs","repos_url":"https://api.github.com/users/milesizzo/repos","events_url":"https://api.github.com/users/milesizzo/events{/privacy}","received_events_url":"https://api.github.com/users/milesizzo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-02T04:50:47Z","updated_at":"2015-02-02T08:28:24Z","closed_at":null,"body":"I'm attempting to run the Graphhopper service on an Ubuntu server installation (14.04.1 LTS - Trusty Tahr). I've imported an OSM file from here: http://download.bbbike.org/osm/bbbike/Melbourne/ (Melbourne.osm.pbf) successfully.\r\n\r\nJava version:\r\n```\r\nmgi@ubuntu:~/gh/latest$ java -version\r\njava version \"1.8.0_31\"\r\nJava(TM) SE Runtime Environment (build 1.8.0_31-b13)\r\nJava HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)\r\n```\r\n\r\nMaven version:\r\n```\r\nmgi@ubuntu:~/gh/latest$ mvn --version\r\nApache Maven 3.0.5\r\nMaven home: /usr/share/maven\r\nJava version: 1.8.0_31, vendor: Oracle Corporation\r\nJava home: /usr/lib/jvm/java-8-oracle/jre\r\nDefault locale: en_AU, platform encoding: UTF-8\r\nOS name: \"linux\", version: \"3.13.0-40-generic\", arch: \"amd64\", family: \"unix\"\r\n```\r\n\r\nconfig.properties:\r\n```\r\n#################\r\n### OSMReader ###\r\n\r\ngraph.dataaccess=RAM_STORE\r\n#graph.dataaccess=MMAP_STORE_SYNC\r\n\r\n# Default: use contraction hierarchies to speed things up. requires more RAM/disc space for holding the graph\r\n# Use chWeighting=no to disable it (more flexibility while querying)\r\n# Java API usage is: GraphHopper.setCHWeighting(\"fastest\")\r\nprepare.chWeighting=fastest\r\n\r\n# increase from 1 to 5, to reduce way geometry e.g. for android\r\nosmreader.wayPointMaxDistance=1\r\n\r\n# Possible options: car,foot,bike,bike2,mtb,racingbike,motorcycle (comma separated)\r\n# When using two or three option together remeber to set \"prepare.chWeighting=no\" above.\r\n# bike2 takes elevation data into account (like up-hill is slower than down-hill)\r\n# and requires enabling graph.elevation.provider below, e.g. see #169\r\ngraph.flagEncoders=car\r\n\r\n# to enable turn restrictions for car do\r\n# graph.flagEncoders=car|turnCosts=true\r\n\r\n# if you want to reduce storage size and you don't need instructions for a path uncomment this\r\n# osmreader.instructions=false\r\n\r\n# To populate your graph with elevation data use SRTM, default is noop\r\n# graph.elevation.provider=srtm\r\n# default location for cache is used /tmp/srtm\r\n# graph.elevation.cachedir=./srtmprovider/\r\n# If you have a slow disk or plenty of RAM change the default MMAP to\r\n# graph.elevation.dataaccess=RAM_STORE\r\n\r\n# Location index lookup. Advanced customization. Resolution is in meter, the search specifies the 'radius' in number of tiles.\r\n# E.g. decrease resolution for a faster lookup and increase region search for a more dynamic search and less 'location not found' results\r\n# index.highResolution=300\r\n# index.maxRegionSearch=4\r\n\r\n# if you want to support jsonp response type you need to add it explicitely here:\r\n#web.jsonpAllowed=true\r\n```\r\n\r\nThis runs fine as expected, and on the first run it builds the `Melbourne.osm-gh` directory.\r\n\r\nSince I'm going to be eventually working with the full planet data, I need to run in MMAP mode (my dev machine doesn't have enough RAM). So I changed the config.properties `graph.dataaccess` option to be `MMAP_STORE_SYNC`. Upon running I get the following exception:\r\n\r\n```\r\nmgi@ubuntu:~/gh/latest$ ./graphhopper.sh web Melbourne.osm-gh\r\n## using java 1.8.0_31 (64bit) from\r\n## using existing osm file Melbourne.osm-gh\r\n## existing jar found tools/target/graphhopper-tools-0.4-SNAPSHOT-jar-with-dependencies.jar\r\n## now web. JAVA_OPTS=-Xmx4g -Xms4g\r\nFeb 02, 2015 3:38:28 PM com.google.inject.internal.MessageProcessor visit\r\nINFO: An exception was caught and reported. Message: java.io.IOException: Invalid argument\r\njava.lang.IllegalStateException: Couldn't load graph\r\n        at com.graphhopper.http.DefaultModule.configure(DefaultModule.java:82)\r\n        at com.google.inject.AbstractModule.configure(AbstractModule.java:59)\r\n        at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223)\r\n        at com.google.inject.AbstractModule.install(AbstractModule.java:118)\r\n        at com.graphhopper.http.GHServer$1.configure(GHServer.java:114)\r\n        at com.google.inject.AbstractModule.configure(AbstractModule.java:59)\r\n        at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223)\r\n        at com.google.inject.spi.Elements.getElements(Elements.java:101)\r\n        at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:133)\r\n        at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:103)\r\n        at com.google.inject.Guice.createInjector(Guice.java:95)\r\n        at com.google.inject.Guice.createInjector(Guice.java:72)\r\n        at com.google.inject.Guice.createInjector(Guice.java:62)\r\n        at com.graphhopper.http.GHServer.start(GHServer.java:62)\r\n        at com.graphhopper.http.GHServer.main(GHServer.java:48)\r\nCaused by: java.lang.RuntimeException: Couldn't map buffer 0 of 3 at position 100 for 3145628 bytes with offset 100, new fileLength:3145828\r\n        at com.graphhopper.storage.MMapDataAccess.mapIt(MMapDataAccess.java:160)\r\n        at com.graphhopper.storage.MMapDataAccess.loadExisting(MMapDataAccess.java:244)\r\n        at com.graphhopper.storage.SynchedDAWrapper.loadExisting(SynchedDAWrapper.java:141)\r\n        at com.graphhopper.storage.GraphHopperStorage.loadExisting(GraphHopperStorage.java:1379)\r\n        at com.graphhopper.GraphHopper.load(GraphHopper.java:720)\r\n        at com.graphhopper.GraphHopper.importOrLoad(GraphHopper.java:564)\r\n        at com.graphhopper.http.DefaultModule.createGraphHopper(DefaultModule.java:56)\r\n        at com.graphhopper.http.DefaultModule.configure(DefaultModule.java:69)\r\n        ... 14 more\r\nCaused by: java.io.IOException: Invalid argument\r\n        at sun.nio.ch.FileChannelImpl.map0(Native Method)\r\n        at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:893)\r\n        at com.graphhopper.storage.MMapDataAccess.newByteBuffer(MMapDataAccess.java:178)\r\n        at com.graphhopper.storage.MMapDataAccess.mapIt(MMapDataAccess.java:152)\r\n        ... 21 more\r\n```\r\n\r\nAny help would be greatly appreciated, I have been researching this error for a few days now."},"comment":{"url":"https://api.github.com/repos/graphhopper/graphhopper/issues/comments/72421136","html_url":"https://github.com/graphhopper/graphhopper/issues/315#issuecomment-72421136","issue_url":"https://api.github.com/repos/graphhopper/graphhopper/issues/315","id":72421136,"user":{"login":"karussell","id":129644,"avatar_url":"https://avatars.githubusercontent.com/u/129644?v=3","gravatar_id":"","url":"https://api.github.com/users/karussell","html_url":"https://github.com/karussell","followers_url":"https://api.github.com/users/karussell/followers","following_url":"https://api.github.com/users/karussell/following{/other_user}","gists_url":"https://api.github.com/users/karussell/gists{/gist_id}","starred_url":"https://api.github.com/users/karussell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karussell/subscriptions","organizations_url":"https://api.github.com/users/karussell/orgs","repos_url":"https://api.github.com/users/karussell/repos","events_url":"https://api.github.com/users/karussell/events{/privacy}","received_events_url":"https://api.github.com/users/karussell/received_events","type":"User","site_admin":false},"created_at":"2015-02-02T08:28:24Z","updated_at":"2015-02-02T08:28:24Z","body":"Please check as emux said, that the files are found. E.g. the command\nshould point the graphhopper script to the original osm file:\n\n./graphhopper.sh web your-file.pbf\nor\n./graphhopper.sh web your-file.osm\n\ninstead of\n\n|./graphhopper.sh web Melbourne.osm-gh|\n\nPeter\n\nOn 02.02.2015 05:50, milesizzo wrote:\n>\n> I'm attempting to run the Graphhopper service on an Ubuntu server\n> installation (14.04.1 LTS - Trusty Tahr). I've imported an OSM file\n> from here: http://download.bbbike.org/osm/bbbike/Melbourne/\n> (Melbourne.osm.pbf) successfully.\n>\n> Java version:\n>\n> |mgi@ubuntu:~/gh/latest$ java -version\n> java version \"1.8.0_31\"\n> Java(TM) SE Runtime Environment (build 1.8.0_31-b13)\n> Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)\n> |\n>\n> Maven version:\n>\n> |mgi@ubuntu:~/gh/latest$ mvn --version\n> Apache Maven 3.0.5\n> Maven home: /usr/share/maven\n> Java version: 1.8.0_31, vendor: Oracle Corporation\n> Java home: /usr/lib/jvm/java-8-oracle/jre\n> Default locale: en_AU, platform encoding: UTF-8\n> OS name: \"linux\", version: \"3.13.0-40-generic\", arch: \"amd64\", family: \"unix\"\n> |\n>\n> config.properties:\n>\n> |#################\n> ### OSMReader ###\n>\n> graph.dataaccess=RAM_STORE\n> #graph.dataaccess=MMAP_STORE_SYNC\n>\n> # Default: use contraction hierarchies to speed things up. requires more RAM/disc space for holding the graph\n> # Use chWeighting=no to disable it (more flexibility while querying)\n> # Java API usage is: GraphHopper.setCHWeighting(\"fastest\")\n> prepare.chWeighting=fastest\n>\n> # increase from 1 to 5, to reduce way geometry e.g. for android\n> osmreader.wayPointMaxDistance=1\n>\n> # Possible options: car,foot,bike,bike2,mtb,racingbike,motorcycle (comma separated)\n> # When using two or three option together remeber to set \"prepare.chWeighting=no\" above.\n> # bike2 takes elevation data into account (like up-hill is slower than down-hill)\n> # and requires enabling graph.elevation.provider below, e.g. see #169\n> graph.flagEncoders=car\n>\n> # to enable turn restrictions for car do\n> # graph.flagEncoders=car|turnCosts=true\n>\n> # if you want to reduce storage size and you don't need instructions for a path uncomment this\n> # osmreader.instructions=false\n>\n> # To populate your graph with elevation data use SRTM, default is noop\n> # graph.elevation.provider=srtm\n> # default location for cache is used /tmp/srtm\n> # graph.elevation.cachedir=./srtmprovider/\n> # If you have a slow disk or plenty of RAM change the default MMAP to\n> # graph.elevation.dataaccess=RAM_STORE\n>\n> # Location index lookup. Advanced customization. Resolution is in meter, the search specifies the 'radius' in number of tiles.\n> # E.g. decrease resolution for a faster lookup and increase region search for a more dynamic search and less 'location not found' results\n> # index.highResolution=300\n> # index.maxRegionSearch=4\n>\n> # if you want to support jsonp response type you need to add it explicitely here:\n> #web.jsonpAllowed=true\n> |\n>\n> This runs fine as expected, and on the first run it builds the\n> |Melbourne.osm-gh| directory.\n>\n> Since I'm going to be eventually working with the full planet data, I\n> need to run in MMAP mode (my dev machine doesn't have enough RAM). So\n> I changed the config.properties |graph.dataaccess| option to be\n> |MMAP_STORE_SYNC|. Upon running I get the following exception:\n>\n> |mgi@ubuntu:~/gh/latest$ ./graphhopper.sh web Melbourne.osm-gh\n> ## using java 1.8.0_31 (64bit) from\n> ## using existing osm file Melbourne.osm-gh\n> ## existing jar found tools/target/graphhopper-tools-0.4-SNAPSHOT-jar-with-dependencies.jar\n> ## now web. JAVA_OPTS=-Xmx4g -Xms4g\n> Feb 02, 2015 3:38:28 PM com.google.inject.internal.MessageProcessor visit\n> INFO: An exception was caught and reported. Message: java.io.IOException: Invalid argument\n> java.lang.IllegalStateException: Couldn't load graph\n>         at com.graphhopper.http.DefaultModule.configure(DefaultModule.java:82)\n>         at com.google.inject.AbstractModule.configure(AbstractModule.java:59)\n>         at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223)\n>         at com.google.inject.AbstractModule.install(AbstractModule.java:118)\n>         at com.graphhopper.http.GHServer$1.configure(GHServer.java:114)\n>         at com.google.inject.AbstractModule.configure(AbstractModule.java:59)\n>         at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223)\n>         at com.google.inject.spi.Elements.getElements(Elements.java:101)\n>         at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:133)\n>         at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:103)\n>         at com.google.inject.Guice.createInjector(Guice.java:95)\n>         at com.google.inject.Guice.createInjector(Guice.java:72)\n>         at com.google.inject.Guice.createInjector(Guice.java:62)\n>         at com.graphhopper.http.GHServer.start(GHServer.java:62)\n>         at com.graphhopper.http.GHServer.main(GHServer.java:48)\n> Caused by: java.lang.RuntimeException: Couldn't map buffer 0 of 3 at position 100 for 3145628 bytes with offset 100, new fileLength:3145828\n>         at com.graphhopper.storage.MMapDataAccess.mapIt(MMapDataAccess.java:160)\n>         at com.graphhopper.storage.MMapDataAccess.loadExisting(MMapDataAccess.java:244)\n>         at com.graphhopper.storage.SynchedDAWrapper.loadExisting(SynchedDAWrapper.java:141)\n>         at com.graphhopper.storage.GraphHopperStorage.loadExisting(GraphHopperStorage.java:1379)\n>         at com.graphhopper.GraphHopper.load(GraphHopper.java:720)\n>         at com.graphhopper.GraphHopper.importOrLoad(GraphHopper.java:564)\n>         at com.graphhopper.http.DefaultModule.createGraphHopper(DefaultModule.java:56)\n>         at com.graphhopper.http.DefaultModule.configure(DefaultModule.java:69)\n>         ... 14 more\n> Caused by: java.io.IOException: Invalid argument\n>         at sun.nio.ch.FileChannelImpl.map0(Native Method)\n>         at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:893)\n>         at com.graphhopper.storage.MMapDataAccess.newByteBuffer(MMapDataAccess.java:178)\n>         at com.graphhopper.storage.MMapDataAccess.mapIt(MMapDataAccess.java:152)\n>         ... 21 more\n> |\n>\n> Any help would be greatly appreciated, I have been researching this\n> error for a few days now.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/graphhopper/graphhopper/issues/315>.\n>"}}