Setting up an own instance of openpoiservice

Hello there,

I’m trying to set up an own instance of OpenPOIService as a docker container following these instructions:

At this point I get stuck:

docker exec -it container_name /ops_venv/bin/python manage.py import_data

I executed:

sudo docker exec -it <container_id> /ops_venv/bin/python manage.py import-data

…and get this message:

Found directory: /deploy/app/osm
INFO:main:Starting to import OSM data…[‘/deploy/app/osm/bremen-latest.osm.pbf’, ‘/deploy/app/osm/bremen-tests.osm.pbf’]
INFO:openpoiservice.server.db_import.parser:Starting to read /deploy/app/osm/bremen-latest.osm.pbf
INFO:openpoiservice.server.db_import.parser:Parsing and importing nodes…
Traceback (most recent call last):
File “manage.py”, line 60, in
cli()
File “/ops_venv/lib/python3.6/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/ops_venv/lib/python3.6/site-packages/flask/cli.py”, line 380, in main
return AppGroup.main(self, *args, **kwargs)
File “/ops_venv/lib/python3.6/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/ops_venv/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/ops_venv/lib/python3.6/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/ops_venv/lib/python3.6/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/ops_venv/lib/python3.6/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/ops_venv/lib/python3.6/site-packages/flask/cli.py”, line 257, in decorator
return __ctx.invoke(f, *args, **kwargs)
File “/ops_venv/lib/python3.6/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “manage.py”, line 56, in import_data
parser.run_import(osm_files)
File “/deploy/app/openpoiservice/server/utils/decorators.py”, line 105, in timed
result = method(*args, **kw)
File “/deploy/app/openpoiservice/server/db_import/parser.py”, line 76, in run_import
parse_file(osm_file)
File “/deploy/app/openpoiservice/server/utils/decorators.py”, line 51, in wrapper
raise ex_type(message)
KeyError: ‘('concurrent_workers',) (in subprocess)\n File “/deploy/app/openpoiservice/server/utils/decorators.py”, line 26, in process_func\n ret = func(*args, **kwargs)\n File “/deploy/app/openpoiservice/server/db_import/parser.py”, line 68, in parse_file\n parse_import(osm_file)\n File “/deploy/app/openpoiservice/server/db_import/parser.py”, line 25, in parse_import\n nodes = OSMParser(concurrency=ops_settings['concurrent_workers'], nodes_callback=osm_importer.parse_nodes)\n’

Any idea what I could do?

Tanky in advance for your support,

Kathrin

Greetings @Katzentier - sorry, I have to add this to the documentation: could you please add a key concurrent_workers to ops_settings.yml and set it to 1 and retry?

The key concurrent_workers is set to 4 at the moment, changed it to 1.

Now, the error message changed to:

File “manage.py”, line 60, in
cli()
File “/ops_venv/lib/python3.6/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/ops_venv/lib/python3.6/site-packages/flask/cli.py”, line 380, in main
return AppGroup.main(self, *args, **kwargs)
File “/ops_venv/lib/python3.6/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/ops_venv/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/ops_venv/lib/python3.6/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/ops_venv/lib/python3.6/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/ops_venv/lib/python3.6/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/ops_venv/lib/python3.6/site-packages/flask/cli.py”, line 257, in decorator
return __ctx.invoke(f, *args, **kwargs)
File “/ops_venv/lib/python3.6/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “manage.py”, line 56, in import_data
parser.run_import(osm_files)
File “/deploy/app/openpoiservice/server/utils/decorators.py”, line 105, in timed
result = method(*args, **kw)
File “/deploy/app/openpoiservice/server/db_import/parser.py”, line 76, in run_import
parse_file(osm_file)
File “/deploy/app/openpoiservice/server/utils/decorators.py”, line 51, in wrapper
raise ex_type(message)
TypeError: init() missing 2 required positional arguments: ‘params’ and ‘orig’

Any idea about the 2nd error message?

@Katzentier sorry, I missed this message. I am not sure what is going on here, you are trying to import data now, right?

Right, I’m trying to import OSM data.

I’m trying to reproduce this or to actually find what’s not working here, so far nothing. I think you’ll have to dig a little deeper yourself. Sorry that I can’t help as of now.

Hello. I am trying to setup on on Prem openpoiservice using the GitHub instructions. I was wondering since we are running on Prem, do we still need an API key from openrouteservice?

Thanks.

No, those are server dependent limitations. Since you’re hosting on your own server, it has nothing to do with openrouteservice servers. You can implement your own API gateway though if you want, I can only recommend Tyk.

How do I configure that?

Sorry, I have a API gateway, WSO2 API manager. How do I configure OPS to not use OSR’s API service?

There’s no configuration for that, because it’s just not happening at all:

You set up OPS, it’s on localhost. There’s nowhere a reference to ORS servers.

So, this should work on the server where you set it up:

curl -X POST \
  http://127.0.0.1:5000/pois \
  -H 'content-type: application/json' \
  -d '{
	"request": "list"
}'

Which client are you requesting from? All our SDK’s obviously default to ORS servers.

We tried from the swagger UI and it said we needed a key. We were also trying from postman but we didn’t have the syntax correct. I will try with curl. Thanks for your help.