Skip to content

Unknown vehicle 'bike' in profile: Default vehicle profiles not generated?  #2758

Closed

Description

@larsschwarz

I installed the Routing API server as per the docs and modified the config-example.yml by replacing car with bike here:

graph.flag_encoders: bike

According to the inline comments this should be fine ("More options: foot,hike,bike,bike2,mtb,racingbike,motorcycle,wheelchair (comma separated)")

I also replaced the default car profile with

profiles:
    - name: bike
      vehicle: bike
      weighting: fastest

and added

profiles_ch:
    - profile: bike

Running

java -Ddw.graphhopper.datareader.file=oldenburg.osm.pbf -jar *.jar server config-example.yml

however returns

[main] ERROR io.dropwizard.cli.ServerCommand - Unable to start server, shutting down
java.lang.IllegalArgumentException: Unknown vehicle 'bike' in profile: name=bike|vehicle=bike|weighting=fastest|turnCosts=false|hints={}. Available vehicles: car

running the same command with import instead of server returns

Unknown vehicle 'bike' in profile: name=bike|vehicle=bike|weighting=fastest|turnCosts=false|hints={}. Available vehicles: car

I tried the docs, but I cannot seem to find an option to generate that profile, even guessing by the inline comments bike seems to be a standard profile included?

Seems like for older version of Graphhopper this was done by running ./graphhopper.sh import <> instead?

It would be really helpful if vehicle types mentioned in the example config would at least return a more dedicated error response or maybe even trigger the required import/generation automatically?

Activity

  1. karussell commented on Feb 17, 2023

    @karussell
    Member

    Once you start GraphHopper a folder at graph.location is created and filled (probably you did this with the car config). If you change the configuration you either have to change graph.location or remove the folder. Can you try if this fixes the problem you have?

    Also make sure you are using the latest version 6.2 - I just updated the readme as an older 6.0 was still there.

    ./graphhopper.sh import <>

    You can still use this import command when you replace server with import in the java command. Also have a look into deploy.md.

  2. otbutz commented on Feb 17, 2023

    @otbutz
    Contributor

    Shouldn't this trigger an error if the graph doesn't fit to the configuration? At least for encoded values we're checking for consistency.

  3. karussell commented on Feb 17, 2023

    @karussell
    Member

    Indeed, that would also give a better error description. But I was able to reproduce the mentioned error message for 6.2 (when changing from car to bike without a folder removal).

  4. larsschwarz commented on Feb 17, 2023

    @larsschwarz
    Author

    Changed the graph.location folder and restarted the server. Works fine now. Thanks.

    However a more dedicated error response would be helpful, especially because these are default config values.

  5. easbar commented on Feb 18, 2023

    @easbar
    Member

    Yes, this is because we run checkProfilesConsistency, for the loaded EncodingManager, which gets the 'car' vehicle from the -gh folder as it is loaded from disk. We have another check, that makes sure the profiles in the config file match the ones in the -gh folder, but this only runs afterwards. I think we only need to change the order of the checks.

  6. karussell commented on Feb 18, 2023

    @karussell
    Member

    Thanks @easbar !

  7. added a commit that references this issue on Mar 21, 2023
    6eb36cc
  8. added a commit that references this issue on Jun 21, 2023
    b3825b7
  9. added a commit that references this issue on Oct 27, 2023
    7a0960e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions