maptiler / tileserver-gl

Vector and raster maps with GL styles. Server side rendering by MapLibre GL Native. Map tile server for MapLibre GL JS, Android, iOS, Leaflet, OpenLayers, GIS via WMTS, etc.
https://tileserver.readthedocs.io/en/latest/
Other
2.24k stars 639 forks source link

no such file or directory, stat #1405

Closed 2803media closed 3 weeks ago

2803media commented 3 weeks ago

I need you help,

I install the npm version (so not the docker version) and the install is ok:

root@host6-vm107:/home/openmaptiles# tileserver-gl -v
5.0.0
root@host6-vm107:/home/openmaptiles# node -v
v20.18.0

I have this folder structure:

root@host6-vm107:/home/openmaptiles#

tree -L 2
.
├── android-chrome-192x192.png
├── android-chrome-512x512.png
├── apple-touch-icon.png
├── build
│   ├── mapping.yaml
│   ├── openmaptiles.tm2source
│   ├── sql
│   └── style
├── cache
│   ├── coords
│   ├── coords_index
│   ├── coords_rel_index
│   ├── nodes
│   ├── relations
│   ├── ways
│   ├── ways_index
│   └── wikidata-cache.json
├── check.sh
├── config.json
├── CONTRIBUTING.md
├── data
│   ├── tiles.mbtiles
├── docker-compose-MINGW64.yml
├── docker-compose.yml
├── favicon-16x16.png
├── favicon-32x32.png
├── favicon.ico
├── layers
│   ├── aerodrome_label
│   ├── aeroway
│   ├── boundary
│   ├── building
│   ├── housenumber
│   ├── landcover
│   ├── landuse
│   ├── mountain_peak
│   ├── park
│   ├── place
│   ├── poi
│   ├── transportation
│   ├── transportation_name
│   ├── water
│   ├── water_name
│   └── waterway
├── openmaptiles.yaml
├── style
│   ├── config.json
│   ├── icons
│   ├── README.md
│   └── style-header.json
└── update.sh

and this config.json

{
  "options": {
    "paths": {
      "root": "/home/openmaptiles/",
      "fonts": "data/fonts",
      "sprites": "build/style",
      "styles": "build/style",
      "mbtiles": "data"
    },
    "formatQuality": {
      "jpeg": 90,
      "webp": 90
    },
    "maxScaleFactor": 3,
    "maxSize": 4096,
    "pbfAlias": "pbf",
    "serveAllFonts": false,
    "serveAllStyles": false,
    "serveStaticMaps": true,
    "allowRemoteMarkerIcons": true,
    "tileMargin": 0
  },
  "styles": {
    "OSM": {
      "style": "style.json",
      "tilejson": {
        "type": "overlay"
      }
    },
    "dark": {
      "style": "dark.json",
      "tilejson": {
        "type": "overlay"
      }
    },
    "light": {
      "style": "light.json",
      "tilejson": {
        "type": "overlay"
      }
    },
    "labels3": {
      "style": "labels3.json",
      "tilejson": {
        "type": "overlay"
      }
    },
    "white": {
      "style": "white.json",
      "tilejson": {
        "type": "overlay"
      }
    }
  },
  "data": {
    "openmaptiles": {
      "mbtiles": "tiles.mbtiles"
    }
  }
}

and this style light.json (extract of it)

{
  "version": 8,
  "name": "Light",
  "metadata": {
    "mapbox:autocomposite": false,
    "mapbox:groups": {
      "101da9f13b64a08fa4b6ac1168e89e5f": {
        "collapsed": false,
        "name": "Places"
      },
      "a14c9607bc7954ba1df7205bf660433f": {"name": "Boundaries"},
      "b6371a3f2f5a9932464fa3867530a2e5": {
        "collapsed": false,
        "name": "Transportation"
      }
    },
    "mapbox:type": "template",
    "openmaptiles:mapbox:owner": "openmaptiles",
    "openmaptiles:mapbox:source:url": "mapbox://openmaptiles.4qljc88t",
    "openmaptiles:version": "3.x",
    "maputnik:renderer": "mbgljs"
  },
  "sources": {
    "openmaptiles": {
      "type": "vector",
      "url": "mbtiles:///data/tiles.mbtiles"
    }
  },
  "glyphs": "{fontstack}/{range}.pbf",

And when I run the tileserver-gl server I have this error:

root@host6-vm107:/home/openmaptiles# tileserver-gl -c config.json -p 8081
Starting tileserver-gl v5.0.0
Using specified config file from config.json
Starting server
Listening at http://[::]:8081/
ENOENT: no such file or directory, stat '/data/tiles.mbtiles'

But the file really exist:

root@host6-vm107:/home/openmaptiles# ls -l data/tiles.mbtiles
-rw-r--r-- 1 nobody nogroup 4399840256 oct.  15 00:15 data/tiles.mbtiles

I certainly missed something but I'm stuck and don't why this confid doesn't work... Thanks for a clue ;)

2803media commented 3 weeks ago

finally I started from scratch

{
  "options": {
    "paths": {
      "root": ".",
      "styles": "styles",
      "fonts": "fonts",
      "mbtiles": "data"
    },
    "formatOptions": {
      "jpeg": 90,
      "webp": 90
    },
    "maxScaleFactor": 3,
    "maxSize": 4096,
    "pbfAlias": "pbf",
    "serveAllFonts": false,
    "serveAllStyles": false,
    "serveStaticMaps": true,
    "allowRemoteMarkerIcons": true,
    "tileMargin": 0,
    "frontPage": true
  },
  "styles": {
    "light": {
      "style": "light.json",
      "tilejson": {
        "type": "overlay"
      }
    },
    "dark": {
      "style": "dark.json",
      "tilejson": {
        "type": "overlay"
      }
    },
    "labels": {
      "style": "labels.json",
      "tilejson": {
        "type": "overlay"
      }
    },
    "white": {
      "style": "white.json",
      "tilejson": {
        "type": "overlay"
      }
    },
    "maptiler": {
      "style": "basic.json",
      "tilejson": {
        "type": "overlay"
      }
    },
    "positron": {
      "style": "positron.json",
      "tilejson": {
        "type": "overlay"
      }
    }
  },
  "data": {
    "openmaptiles": {
      "mbtiles": "tiles.mbtiles"
    }
  }
}
{
    "version": 8,
    "name": "Light",
    "metadata": {
      "mapbox:autocomposite": false,
      "mapbox:groups": {
        "101da9f13b64a08fa4b6ac1168e89e5f": {
          "collapsed": false,
          "name": "Places"
        },
        "a14c9607bc7954ba1df7205bf660433f": {"name": "Boundaries"},
        "b6371a3f2f5a9932464fa3867530a2e5": {
          "collapsed": false,
          "name": "Transportation"
        }
      },
      "mapbox:type": "template",
      "openmaptiles:mapbox:owner": "openmaptiles",
      "openmaptiles:mapbox:source:url": "mapbox://openmaptiles.4qljc88t",
      "openmaptiles:version": "3.x",
      "maputnik:renderer": "mbgljs"
    },
    "sources": {
      "openmaptiles": {
        "type": "vector",
        "url": "mbtiles://tiles.mbtiles"
      }
    },
    "glyphs": "{fontstack}/{range}.pbf",
    "layers": [
      {
        "id": "background",
        "type": "background",
        "minzoom": 0,
        "layout": {"visibility": "visible"},
        "paint": {"background-color": "rgba(255, 255, 255, 1)"}
      },
├── config.json
├── data
│   ├── tiles.mbtiles
├── fonts
│   ├── Noto Sans Bold
│   ├── Noto Sans Italic
│   ├── Noto Sans Regular
│   ├── Open Sans Bold
│   ├── Open Sans Bold Italic
│   ├── Open Sans Extra Bold
│   ├── Open Sans Extra Bold Italic
│   ├── Open Sans Italic
│   ├── Open Sans Light
│   ├── Open Sans Light Italic
│   ├── Open Sans Regular
│   ├── Open Sans Semibold
│   ├── Open Sans Semibold Italic
│   ├── PT Sans Bold
│   ├── PT Sans Bold Italic
│   ├── PT Sans Caption Regular
│   ├── PT Sans Caption Web Bold
│   ├── PT Sans Italic
│   ├── PT Sans Narrow Bold
│   ├── PT Sans Narrow Regular
│   ├── PT Sans Regular
│   ├── Roboto Black
│   ├── Roboto Black Italic
│   ├── Roboto Bold
│   ├── Roboto Bold Italic
│   ├── Roboto Condensed Bold
│   ├── Roboto Condensed Bold Italic
│   ├── Roboto Condensed Italic
│   ├── Roboto Condensed Light
│   ├── Roboto Condensed Light Italic
│   ├── Roboto Condensed Regular
│   ├── Roboto Italic
│   ├── Roboto Light
│   ├── Roboto Light Italic
│   ├── Roboto Medium
│   ├── Roboto Medium Italic
│   ├── Roboto Regular
│   ├── Roboto Thin
│   └── Roboto Thin Italic
└── styles
    ├── basic.json
    ├── dark.json
    ├── labels.json
    ├── light.json
    ├── positron.json
    ├── sprite@2x.json
    ├── sprite@2x.png
    ├── sprite.json
    ├── sprite.png
    └── white.json

and it's working with this command:

root@host6-vm107:/home/openmaptiles# xvfb-run --server-args="-screen 0 1024x768x24" tileserver-gl -c config.json -p 8080