wiktorn / Overpass-API

Overpass API docker image
MIT License
133 stars 47 forks source link

403 error on trying to use the interpreter #90

Closed momo-p closed 2 years ago

momo-p commented 2 years ago

Hi I'm currently trying to run this to my k8s, everything work fine but every time i try to use the interpreter it result a 403 My attempt:

$ curl "http://10.42.0.140/api/intepreter?data=[out:json];node(1);out;"
403 Forbidden

The logs:

Click To Expand ``` /app/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/flush_patch.sh Patching /app/bin/init_osm3s.sh with custom --flush-size Starting supervisord process 2022-04-07 11:23:32,281 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message. 2022-04-07 11:23:32,285 INFO supervisord started with pid 1 2022-04-07 11:23:33,287 INFO spawned: 'overpass_dispatch' with pid 10 2022-04-07 11:23:33,289 INFO spawned: 'nginx' with pid 11 2022-04-07 11:23:33,291 INFO spawned: 'fcgiwrap' with pid 12 2022-04-07 11:23:33,292 INFO spawned: 'update_overpass' with pid 13 2022-04-07 11:23:33,295 INFO spawned: 'dispatcher_areas' with pid 14 2022-04-07 11:23:33,296 INFO spawned: 'areas_rules' with pid 15 /app/bin / 2022-04-07 11:23:33 INFO: Using replication server at https://planet.openstreetmap.org/replication/day/ 2022-04-07 11:23:33 DEBUG: Using given sequence ID 3494 2022-04-07 11:23:33 DEBUG: Starting download at ID 3495 (max 100 MB) Empty version, skipping file 2022-04-07 11:23:34,456 INFO success: overpass_dispatch entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2022-04-07 11:23:34,456 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2022-04-07 11:23:34,456 INFO success: fcgiwrap entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2022-04-07 11:23:34,456 INFO success: update_overpass entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2022-04-07 11:23:34,456 INFO success: dispatcher_areas entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2022-04-07 11:23:34,456 INFO success: areas_rules entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) Update finished with status code: 3 10.42.0.1 - - [07/Apr/2022:11:23:40 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" The data included in this document is from www.openstreetmap.org. The data is made available under ODbL. After 0h0m15s: in "recurse", part 0, on line 26. Stack: 0 of 0 85 of 0 0 of 0 10.42.0.1 - - [07/Apr/2022:11:23:50 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" 10.42.0.1 - - [07/Apr/2022:11:24:00 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" After 0h0m30s: in "make-area", part 0, on line 29. Stack: 0 of 0 173 of 0 10.42.0.1 - - [07/Apr/2022:11:24:10 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" After 0h0m45s: in "recurse", part 0, on line 26. Stack: 0 of 0 263 of 0 0 of 0 10.42.0.1 - - [07/Apr/2022:11:24:20 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" 10.42.0.1 - - [07/Apr/2022:11:24:30 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" After 0h1m0s: in "make-area", part 0, on line 29. Stack: 0 of 0 357 of 0 2022-04-07 11:24:34 INFO: Using replication server at https://planet.openstreetmap.org/replication/day/ 2022-04-07 11:24:34 DEBUG: Using given sequence ID 3494 2022-04-07 11:24:34 DEBUG: Starting download at ID 3495 (max 100 MB) Empty version, skipping file Update finished with status code: 3 10.42.0.1 - - [07/Apr/2022:11:24:40 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" After 0h1m15s: in "recurse", part 0, on line 26. Stack: 0 of 0 452 of 0 0 of 0 10.42.0.1 - - [07/Apr/2022:11:24:50 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" 10.42.0.1 - - [07/Apr/2022:11:25:00 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" After 0h1m30s: in "recurse", part 0, on line 26. Stack: 0 of 0 545 of 0 0 of 0 10.42.0.1 - - [07/Apr/2022:11:25:10 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" After 0h1m45s: in "recurse", part 0, on line 26. Stack: 0 of 0 633 of 0 0 of 0 10.42.0.1 - - [07/Apr/2022:11:25:20 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" 10.42.0.1 - - [07/Apr/2022:11:25:30 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" After 0h2m0s: in "recurse", part 0, on line 26. Stack: 0 of 0 722 of 0 0 of 0 2022-04-07 11:25:35 INFO: Using replication server at https://planet.openstreetmap.org/replication/day/ 2022-04-07 11:25:35 DEBUG: Using given sequence ID 3494 2022-04-07 11:25:35 DEBUG: Starting download at ID 3495 (max 100 MB) Empty version, skipping file Update finished with status code: 3 10.42.0.1 - - [07/Apr/2022:11:25:40 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" After 0h2m15s: in "recurse", part 0, on line 26. Stack: 0 of 0 807 of 0 0 of 0 10.42.0.1 - - [07/Apr/2022:11:25:50 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" 10.42.0.1 - - [07/Apr/2022:11:26:00 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" After 0h2m30s: in "recurse", part 0, on line 26. Stack: 0 of 0 899 of 0 0 of 0 10.42.0.1 - - [07/Apr/2022:11:26:10 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" After 0h2m45s: in "recurse", part 0, on line 26. Stack: 0 of 0 988 of 0 0 of 0 10.42.0.1 - - [07/Apr/2022:11:26:20 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" 10.42.0.1 - - [07/Apr/2022:11:26:30 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" After 0h3m0s: in "recurse", part 0, on line 26. Stack: 0 of 0 1080 of 0 0 of 0 2022-04-07 11:26:36 INFO: Using replication server at https://planet.openstreetmap.org/replication/day/ 2022-04-07 11:26:36 DEBUG: Using given sequence ID 3494 2022-04-07 11:26:36 DEBUG: Starting download at ID 3495 (max 100 MB) Empty version, skipping file Update finished with status code: 3 10.42.0.1 - - [07/Apr/2022:11:26:40 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" After 0h3m15s: in "recurse", part 0, on line 26. Stack: 0 of 0 1170 of 0 0 of 0 10.42.0.1 - - [07/Apr/2022:11:26:50 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" 10.42.0.1 - - [07/Apr/2022:11:27:00 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" After 0h3m30s: in "recurse", part 0, on line 26. Stack: 0 of 0 1260 of 0 0 of 0 10.42.0.1 - - [07/Apr/2022:11:27:10 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" After 0h3m45s: in "recurse", part 0, on line 26. Stack: 0 of 0 1343 of 0 0 of 0 10.42.0.1 - - [07/Apr/2022:11:27:20 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" 10.42.0.1 - - [07/Apr/2022:11:27:30 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" After 0h4m0s: in "recurse", part 0, on line 26. Stack: 0 of 0 1433 of 0 0 of 0 2022-04-07 11:27:37 INFO: Using replication server at https://planet.openstreetmap.org/replication/day/ 2022-04-07 11:27:37 DEBUG: Using given sequence ID 3494 2022-04-07 11:27:37 DEBUG: Starting download at ID 3495 (max 100 MB) Empty version, skipping file Update finished with status code: 3 10.42.0.1 - - [07/Apr/2022:11:27:40 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" After 0h4m15s: in "recurse", part 0, on line 26. Stack: 0 of 0 1526 of 0 0 of 0 10.42.0.1 - - [07/Apr/2022:11:27:50 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" 10.42.0.1 - - [07/Apr/2022:11:28:00 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" After 0h4m30s: in "recurse", part 0, on line 26. Stack: 0 of 0 1617 of 0 0 of 0 10.42.0.1 - - [07/Apr/2022:11:28:10 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" After 0h4m45s: in "recurse", part 0, on line 26. Stack: 0 of 0 1708 of 0 0 of 0 10.42.0.1 - - [07/Apr/2022:11:28:20 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" 10.42.0.1 - - [07/Apr/2022:11:28:30 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" After 0h5m0s: in "recurse", part 0, on line 26. Stack: 0 of 0 1801 of 0 0 of 0 2022-04-07 11:28:38 INFO: Using replication server at https://planet.openstreetmap.org/replication/day/ 2022-04-07 11:28:38 DEBUG: Using given sequence ID 3494 2022-04-07 11:28:38 DEBUG: Starting download at ID 3495 (max 100 MB) Empty version, skipping file Update finished with status code: 3 10.42.0.1 - - [07/Apr/2022:11:28:40 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" After 0h5m15s: in "recurse", part 0, on line 26. Stack: 0 of 0 1895 of 0 0 of 0 10.42.0.1 - - [07/Apr/2022:11:28:50 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" Cannot get script name, are DOCUMENT_ROOT and SCRIPT_NAME (or SCRIPT_FILENAME) set and is the script executable? 10.42.0.1 - - [07/Apr/2022:11:29:00 +0000] "GET /api/intepreter?data=[out:json];node(1);out; HTTP/1.1" 403 25 "-" "curl/7.64.0" 10.42.0.1 - - [07/Apr/2022:11:29:00 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" After 0h5m30s: in "recurse", part 0, on line 26. Stack: 0 of 0 1989 of 0 0 of 0 10.42.0.1 - - [07/Apr/2022:11:29:10 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" After 0h5m45s: in "recurse", part 0, on line 26. Stack: 0 of 0 2079 of 0 0 of 0 10.42.0.1 - - [07/Apr/2022:11:29:20 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" 10.42.0.1 - - [07/Apr/2022:11:29:30 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" After 0h6m0s: in "recurse", part 0, on line 26. Stack: 0 of 0 2220 of 0 0 of 0 2022-04-07 11:29:39 INFO: Using replication server at https://planet.openstreetmap.org/replication/day/ 2022-04-07 11:29:39 DEBUG: Using given sequence ID 3494 2022-04-07 11:29:39 DEBUG: Starting download at ID 3495 (max 100 MB) Empty version, skipping file Update finished with status code: 3 10.42.0.1 - - [07/Apr/2022:11:29:40 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" After 0h6m15s: in "recurse", part 0, on line 27. Stack: 0 of 0 3979 of 0 0 of 0 10.42.0.1 - - [07/Apr/2022:11:29:50 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" 10.42.0.1 - - [07/Apr/2022:11:30:00 +0000] "GET /api/status HTTP/1.1" 200 154 "-" "kube-probe/1.22" ```

My overpass.yaml:

apiVersion: v1
data:
  flush_patch.sh: |-
    #!/bin/sh

    # Add custom flush to reduce initial memory usage
    echo "Patching /app/bin/init_osm3s.sh with custom --flush-size"
    sed -i.bck '$s/$/ --flush-size=1/' /app/bin/init_osm3s.sh
kind: ConfigMap
metadata:
  name: overpass-flush-patch
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: osm-overpass
spec:
  replicas: 1
  selector:
    matchLabels:
      app: osm-overpass
  template:
    metadata:
      labels:
        app: osm-overpass
    spec:
      containers:
      - name: osm-overpass
        image: wiktorn/overpass-api:latest
        ports:
        - containerPort: 80
        env:
        - name: OVERPASS_META
          value: "no"
        - name: OVERPASS_MODE
          value: "init"
        - name: OVERPASS_PLANET_URL
          value: "https://download.geofabrik.de/asia/vietnam-latest.osm.bz2"
        - name: OVERPASS_DIFF_URL
          value: "https://planet.openstreetmap.org/replication/day/"
        - name: OVERPASS_RULES_LOAD
          value: "10"
        - name: USE_OAUTH_COOKIE_CLIENT
          value: "no"
        readinessProbe:
          httpGet:
            path: /api/status
            port: 80
        volumeMounts:
        - mountPath: /db
          name: overpass-volume
        - mountPath: /docker-entrypoint-initdb.d
          name: flush-patch
      volumes:
      - persistentVolumeClaim:
          claimName: overpass-volume
        name: overpass-volume
      - configMap:
          defaultMode: 484
          name: overpass-flush-patch
        name: flush-patch
wiktorn commented 2 years ago

There is a typo in your URL, you send request to: api/intepreter when you should use api/interpreter (first r is missing in your URL)