Graph version mismatch detected with the same jar file

72 views
Skip to first unread message

Alexandru Mihai

unread,
Jan 14, 2015, 5:13:38 AM1/14/15
to opentripp...@googlegroups.com
Hi,

First of all thank you for your contributions to this opensource software - the quick introduction allowed me to test it successfully pretty quickly.
When I started modifying the code and rebuilding, I got into trouble.

The only change I did was to OpenStreetMapGraphBuilderImpl.java to enable staticBikeRental to true, in order to use OSM static data. In the POM file I set the version to 0.13.0. I committed the changes locally.

c:\workspace\workspaceOTPv13\workspaceOTPv13\otp>git describe
opentripplanner-0.13.0-150-g34cc72e

c:\workspace\workspaceOTPv13\workspaceOTPv13\otp>git rev-parse HEAD
34cc72e16ec48bd1be161255b4232d1d5aac3169 

I built opentripplanner from eclipse which resulted in otp-0.13.0.jar. Using this jar I generate the Graph.obj file. Using the same jar I launch the application under cygwin(so that the path /var/otp/graphs makes sense) and have the below error:

$ /cygdrive/c/runtime/jdk1.7.0_21/bin/java -Dlog4j.debug -Duser.country=FR -Duser.language=fr -Xmx1G -jar otp-0.13.0.jar --server
10:51:15.420 INFO (GraphScanner.java:83) Attempting to automatically register routerIds []
10:51:15.424 INFO (GraphScanner.java:84) Graph files will be sought in paths relative to \var\otp\graphs
10:51:15.426 INFO (GraphService.java:176) Registering new router ''
10:51:15.428 INFO (InputStreamGraphSource.java:223) Loading graph...
10:51:15.447 INFO (MavenVersion.java:53) Parsed Maven artifact version: 0.13.0 => MavenVersion(0, 13, 0, , 34cc72e16ec48bd1be161255b4232d1d5aac3169) UID=13000
10:51:16.462 INFO (Graph.java:714) Graph version: MavenVersion(0, 13, 0, , b41c113b7adf680b28d753068bab86432a0c9f56)
10:51:16.462 INFO (Graph.java:715) OTP version:   MavenVersion(0, 13, 0, , 34cc72e16ec48bd1be161255b4232d1d5aac3169)
10:51:16.463 ERROR (Graph.java:726) Commit mismatch in non-SNAPSHOT version. This implies a problem with the build or release process.
10:51:16.463 ERROR (InputStreamGraphSource.java:228) Exception while loading graph ''.
java.lang.RuntimeException: Graph version mismatch detected.
        at org.opentripplanner.routing.graph.Graph.load(Graph.java:670)
        at org.opentripplanner.routing.impl.InputStreamGraphSource.loadGraph(InputStreamGraphSource.java:225)
        at org.opentripplanner.routing.impl.InputStreamGraphSource.reload(InputStreamGraphSource.java:146)
        at org.opentripplanner.routing.services.GraphService.registerGraph(GraphService.java:186)
        at org.opentripplanner.routing.impl.GraphScanner.startup(GraphScanner.java:88)
        at org.opentripplanner.standalone.OTPConfigurator.makeGraphService(OTPConfigurator.java:122)
        at org.opentripplanner.standalone.OTPConfigurator.getGraphService(OTPConfigurator.java:129)
        at org.opentripplanner.standalone.OTPConfigurator.getServer(OTPConfigurator.java:87)
        at org.opentripplanner.standalone.OTPConfigurator.serverFromParameters(OTPConfigurator.java:251)
        at org.opentripplanner.standalone.OTPMain.main(OTPMain.java:84)
10:51:16.465 WARN (InputStreamGraphSource.java:156) Unable to load data for router ''.
10:51:16.466 WARN (GraphService.java:188) Can't register router ID '', no graph.

I tried debugging from Eclipse and from what I can see, the Graph.obj is written with the proper maven.version data; when it's read, however, it has another version ... (still investigating)
Any suggestions will be much appreciated.
Thank you.

Cheers,
Alex

Marko Burjek

unread,
Jan 26, 2015, 12:01:51 PM1/26/15
to OpenTripPlanner Developers
I *think* the problem is changing version in pom.xml. I changed local commits many times and have succesfully loaded graph with different commit.

--
You received this message because you are subscribed to the Google Groups "OpenTripPlanner Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opentripplanner...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

andrew byrd

unread,
Jan 26, 2015, 12:50:40 PM1/26/15
to opentripp...@googlegroups.com
Yes, your key error message here is:
ERROR (Graph.java:726) Commit mismatch in non-SNAPSHOT version. This
implies a problem with the build or release process.

OTP detected that you were running a release version of OTP, but the
commit ID of the copy of OTP that generated the graph is not the same as
the commit ID of the copy of OTP you are loading it into. You'll need to
either rebuild the graph with your new modified code or change the
version in the POM to a SNAPSHOT (i.e. development) version. If you do
the latter, you should be able to make small tweaks to the code and keep
using your old graph.

-Andrew

vvavepacket

unread,
Nov 8, 2015, 8:43:19 AM11/8/15
to OpenTripPlanner Developers, alex2...@gmail.com
I'm new to OTP. Where do we specifically append the SNAPSHOT? I tried appending the '-SNAPSHOT' in pom.xml, but it still shows the same error. Thanks

Mark Stosberg

unread,
May 8, 2016, 5:19:11 PM5/8/16
to OpenTripPlanner Developers, alex2...@gmail.com

I have the same problem and question: How exactly do I modify pom.xml to reflect that I'm using a snapshot release?

Here's some context for why I'm interested: We are using the 0.15.0 release and aren't quite ready to upgrade.

However, building OTP is *really* slow because a repository is offline that is referenced in pom.xml.

There's a simple fix that's already in 0.19.0, which is to remove the entry from pom.xml:


All I tried to do with to cherry-pick the fix listed there to the 0.15.0 branch so I could build that OTP in under an hour.

Releasing 0.15.1 wit this backported patch would also be a welcome solution. 

    Mark

Andrew Byrd

unread,
May 8, 2016, 5:39:31 PM5/8/16
to Mark Stosberg, OpenTripPlanner Developers, alex2...@gmail.com
Hi Mark,

On 08 May 2016, at 04:47, Mark Stosberg <ma...@rideamigos.com> wrote:
I have the same problem and question: How exactly do I modify pom.xml to reflect that I'm using a snapshot release?

The build process is controlled by the file pom.xml in the root of the repository. Just change the section <version>0.x.y</version> to reflect the desired version number. You will need to specify a new snapshot release number, in this case 0.15.1-SNAPSHOT. Then when you rebuild OTP it will have that version number and create graphs marked with that version number.

All I tried to do with to cherry-pick the fix listed there to the 0.15.0 branch so I could build that OTP in under an hour.

It should work fine to cherry-pick a change onto 0.15.0 without changing the version number. It will just require you to rebuild the graph with the newly built OTP.

However, if you’re making modifications to the code ideally you should not leave the version number at 0.15.0, because that is a release version number and should represent a certain state of the project frozen in time. Release version numbers are expected to correspond to one specific commit, not a series of different commits. By convention all modifications are made on snapshot versions.

-Andrew

Mark Stosberg

unread,
May 9, 2016, 3:48:18 PM5/9/16
to Andrew Byrd, OpenTripPlanner Developers, alex2...@gmail.com
Andrew,

Thanks for the prompt and clear answer. 

I figured out the other piece of my problem. I had two twin OTP servers that were sharing graphs. Things broken when I updated automation to use git cherry-pick when building OTP on the machines. This resulted in the twins having identical code, but differing SHAs. So, graphs built on one quit running on the other. 

A workaround I found was to put the commit on a branch of our own work and use *that* for the checkout. This avoided running `git cherry-pick` on each twin, and restored a stable, shared SHA between them. 

On your advice, I'll consider updating the version in our pom.xml file to 0.15.1-SNAPSHOT as well. 

If anyone else needs the patched 0.15 branch, it's here:


Again, a formal backport of the patch to 0.15.1 would be welcome, but one day we'll get our system updated to 0.19.0

Thanks,

     Mark
Reply all
Reply to author
Forward
0 new messages