drolbr / Overpass-API

A database engine to query the OpenStreetMap data.
http://overpass-api.de
GNU Affero General Public License v3.0
692 stars 90 forks source link

0.7.57.1 release includes debug output #665

Closed santifa closed 1 year ago

santifa commented 2 years ago

I've tried a setup serving overpass-api over HTTPS with Apache which lead to strange errors.

Serving Overpass over HTTP works fine and returns correct results. Wrapping the default Apache config (the one provided by the installation guide) with TLS the output contains read statements from the overpass interpreter itself.

Apache config:

 <VirtualHost *:443>
  ServerAdmin <some-admin>
  ServerName <some-name>

  ErrorLog /var/log/apache2/overpass/error.log
  CustomLog /var/log/apache2/overpass/access.log combined

  SSLEngine on
  SSLCertificateFile "/etc/letsencrypt/live/salt.overpass.fqdn/fullchain.pem"
  SSLCertificateKeyFile "/etc/letsencrypt/live/salt.overpass.fqdn/privkey.pem"

  ExtFilterDefine gzip mode=output cmd=/bin/gzip  
  DocumentRoot /home/<user>/overpass-api/html/

  <Directory "/home/<user>/overpass-api/html/">
      AllowOverride None
      Require all granted
  </Directory>

  # This directive indicates that whenever someone types http://www.mydomain.com/api/
  # Apache2 should refer to what is in the local directory [YOUR_EXEC_DIR]/cgi-bin/
  ScriptAlias /api/ /home/<user>/overpass-api/cgi-bin/

  # This specifies some directives specific to the directory: [YOUR_EXEC_DIR]/cgi-bin/
  <Directory "/home/<user>/overpass-api/cgi-bin/">
      AllowOverride None
      Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
      # For Apache 2.2:
      #  Order allow,deny
      # For Apache >= 2.4:
      Require all granted
      #SetOutputFilter gzip
      #Header set Content-Encoding gzip
  </Directory>
</VirtualHost>

The result is something like:

{
  "version": 0.6,
  "generator": "Overpass API 0.7.57.1 74a55df1",
  "osm3s": {
    "timestamp_osm_base": "",
    "copyright": "The data included in this document is from www.openstreetmap.org. The data is made available under ODbL."
  },
  "elements": [

16384   21419   /home/calimoto/overpass-api/db/node_tags_global.bin
read_block /home/calimoto/overpass-api/db/node_tags_global.bin 7fa7f716af80
read_block /home/calimoto/overpass-api/db/node_tags_global.bin 7fa7f716afd0
read_block /home/calimoto/overpass-api/db/node_tags_global.bin 7fa7f716b020
4000    5b69    /home/calimoto/overpass-api/db/nodes.bin
read_block /home/calimoto/overpass-api/db/nodes.bin 2655846260dced
read_block /home/calimoto/overpass-api/db/nodes.bin 2655886260dd18
read_block /home/calimoto/overpass-api/db/nodes.bin 26558d6260dd3a
read_block /home/calimoto/overpass-api/db/nodes.bin 2655926260dd67
read_block /home/calimoto/overpass-api/db/nodes.bin 2655976260dd73
read_block /home/calimoto/overpass-api/db/nodes.bin 26559c6260ddab
read_block /home/calimoto/overpass-api/db/nodes.bin 2655a16260ddf0
read_block /home/calimoto/overpass-api/db/nodes.bin 2655dd6260def5
read_block /home/calimoto/overpass-api/db/nodes.bin 2655e16260df1f
<Many more line>
{
  "type": "node",
  "id": e0368dc0,
  "lat": 51.9393183,
  "lon": 15.5054381,
  "tags": {
    "addr:city": "Zielona Góra",
    "addr:housenumber": "6;4",
    "addr:street": "Stefana Żeromskiego",
    "amenity": "ice_cream",
    "name": "Wytwórnia Lodów Naturalnych",
    "source": "UM Zielona Góra"
  }
},
<And so on>

This seems like a mixture of real JSON output and statements for overpass itself.

mmd-osm commented 2 years ago

Looks like some debug code slipped in 0.7.57.1. Can you try again with osm-3s_v0.7.57.2.tar.gz?

  if (index)
    std::cout<<"read_block "<<index->get_data_file_name()<<' '<<std::hex<<*(uint64*)(&it.block_it->index)<<'\n';
santifa commented 2 years ago

Yes, but only in few of hours.

santifa commented 2 years ago

The version osm-3s_v0.7.57.2.tar.gz seems to work correctly without these debug symbols.

mmd-osm commented 2 years ago

So maybe change the title of this issue from "TLS Support" to "0.7.57.1 release includes debug output"