osm-fr / osmose-frontend

Part of osmose that shows results on the website http://osmose.openstreetmap.fr
GNU General Public License v3.0
41 stars 38 forks source link

osmose-menu.sql.bz2 no more available #395

Closed frodrigo closed 2 years ago

frodrigo commented 2 years ago

The menu dump is no more available http://osmose.openstreetmap.fr/export/osmose-menu.sql.bz2

Used by docker.

amenk commented 2 years ago

Will it be made available again?

My current workaround is to comment it out in docker-compose.yml

#      - type: bind
#        source: ./osmose-menu.sql
#        target: /osmose-menu.sql

The causes an error on the web map in the left part "TypeError: Failed to fetch" which is probably related.

amenk commented 2 years ago

When trying to fetching the CSV (after successfully posting to send-update) like this:

 curl --request POST --form source='import-ethiopia' --form code='dev' --form content=@wiki.xml http://localhost:20009/control/send-update -v

(wiki.xml from https://wiki.openstreetmap.org/wiki/Osmose, sources + sources_password manually created in the database)

I am getting an error which might be related to the menu.

My items table looks like this -- I have no clue what to put into the menu column

image

``` api_1 | INFO: 192.168.48.1:50012 - "GET /0.3/issues.csv?zoom=12&item=xxxx&level=1&limit=500&bbox=2.555351257324219%2C46.812044148959885%2C3.003387451171875%2C47.020525094958174 HTTP/1.1" 500 Internal Server Error api_1 | ERROR: Exception in ASGI application api_1 | Traceback (most recent call last): api_1 | File "/usr/local/lib/python3.8/site-packages/uvicorn/protocols/http/h11_impl.py", line 403, in run_asgi api_1 | result = await app(self.scope, self.receive, self.send) api_1 | File "/usr/local/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__ api_1 | return await self.app(scope, receive, send) api_1 | File "/usr/local/lib/python3.8/site-packages/fastapi/applications.py", line 269, in __call__ api_1 | await super().__call__(scope, receive, send) api_1 | File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 124, in __call__ api_1 | await self.middleware_stack(scope, receive, send) api_1 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 184, in __call__ api_1 | raise exc api_1 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 162, in __call__ api_1 | await self.app(scope, receive, _send) api_1 | File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 93, in __call__ api_1 | raise exc api_1 | File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__ api_1 | await self.app(scope, receive, sender) api_1 | File "/usr/local/lib/python3.8/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__ api_1 | raise e api_1 | File "/usr/local/lib/python3.8/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__ api_1 | await self.app(scope, receive, send) api_1 | File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 670, in __call__ api_1 | await route.handle(scope, receive, send) api_1 | File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 418, in handle api_1 | await self.app(scope, receive, send) api_1 | File "/usr/local/lib/python3.8/site-packages/fastapi/applications.py", line 269, in __call__ api_1 | await super().__call__(scope, receive, send) api_1 | File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 124, in __call__ api_1 | await self.middleware_stack(scope, receive, send) api_1 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 184, in __call__ api_1 | raise exc api_1 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 162, in __call__ api_1 | await self.app(scope, receive, _send) api_1 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/cors.py", line 84, in __call__ api_1 | await self.app(scope, receive, send) api_1 | File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 93, in __call__ api_1 | raise exc api_1 | File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__ api_1 | await self.app(scope, receive, sender) api_1 | File "/usr/local/lib/python3.8/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__ api_1 | raise e api_1 | File "/usr/local/lib/python3.8/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__ api_1 | await self.app(scope, receive, send) api_1 | File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 670, in __call__ api_1 | await route.handle(scope, receive, send) api_1 | File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 266, in handle api_1 | await self.app(scope, receive, send) api_1 | File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 65, in app api_1 | response = await func(request) api_1 | File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 227, in app api_1 | raw_response = await run_endpoint_function( api_1 | File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 160, in run_endpoint_function api_1 | return await dependant.call(**values) api_1 | File "/data/project/osmose/frontend/./api/issues.py", line 321, in issues_csv api_1 | title, issues = await _issues(db, langs, params) api_1 | File "/data/project/osmose/frontend/./api/issues.py", line 231, in _issues api_1 | items = await query_meta._items_menu(db, langs) api_1 | File "/data/project/osmose/frontend/./modules/query_meta.py", line 19, in _items_menu api_1 | return list( api_1 | File "/data/project/osmose/frontend/./modules/query_meta.py", line 21, in api_1 | lambda x: {"item": x["item"], "menu": i10n_select(x["menu"], langs)}, api_1 | File "/data/project/osmose/frontend/./modules/utils.py", line 117, in i10n_select api_1 | return {"auto": list(translations.values())[0]} api_1 | AttributeError: 'list' object has no attribute 'values' ```
amenk commented 2 years ago
docker$ docker-compose exec api sh
# python menu_update.py

seems to help with the menu column, but the error on fetching the CSV pretty much stays the same

frodrigo commented 2 years ago

Using the test docker compose fille should accepts any upload.

When using no configured menu you can see any item by adding to url useDevItem=all or using advenced filters.

Note the API framework is currently be changed, and only a part is currently migrated. I hope the docker setup is still valid. I will recheck.

Le mar. 16 août 2022, 20:41, Alexander Menk @.***> a écrit :

docker$ docker-compose exec api sh

python menu_update.py

seems to help

— Reply to this email directly, view it on GitHub https://github.com/osm-fr/osmose-frontend/issues/395#issuecomment-1217010994, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANT5DWONANI7NLYINZZRTDVZPOHFANCNFSM56S3MHLQ . You are receiving this because you authored the thread.Message ID: @.***>

frodrigo commented 2 years ago

@jocelynj the export dir was named dump. So rename it export (as in apache config and cron script). But it sill not working. Can you look at it, please.

The directory does not have the good name. But also the cron exporting the dump probably not working.

jocelynj commented 2 years ago

The issue was caused by the switch from wsgi to Proxy in apache config.

I've fixed it by telling apache to not use the proxy for /export directory:

        ProxyPassMatch ^/export !
        ProxyPass / http://127.0.0.1:8000/
        ProxyPassReverse / http://127.0.0.1:8000/