Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reproducing TileOutsideBounds errors #130

Closed
kylebarron opened this issue Oct 3, 2020 · 7 comments
Closed

Reproducing TileOutsideBounds errors #130

kylebarron opened this issue Oct 3, 2020 · 7 comments

Comments

@kylebarron
Copy link
Member

kylebarron commented Oct 3, 2020

I did this exact set of instructions (twice), and was able to reproduce a TileOutsideBounds error

Clone repo

git clone https://github.com/developmentseed/titiler
cd titiler

Build docker image:

docker build --tag titiler-lambda:latest . -f Dockerfiles/lambda/Dockerfile --no-cache

Extract package.zip locally

docker run --name titiler-lambda --volume $(pwd)/:/local -it titiler-lambda:latest bash -c 'cp /tmp/package.zip /local/package.zip'

Install serverless-offline

yarn add serverless-offline
# or
npm install serverless-offline

Paste the following into serverless.yml locally in the titiler folder (as an aside, I'd consider adding a page in the docs for deploying with Serverless framework basically with these steps)..

Content
service: titiler-lambda-sls

plugins:
  - serverless-offline

custom:
  serverless-offline:
    useChildProcesses: true
    allowCache: true
    useDocker: true

provider:
  name: aws
  runtime: python3.7
  stage: ${opt:stage, 'dev'}
  region: "us-west-2"

  deploymentBucket: ${opt:bucket}
  httpApi:
    cors: true

  # Add Tags to resources
  stackTags:
    Project: titiler

  apiGateway:
    binaryMediaTypes:
      - "*/*"
    minimumCompressionSize: 1

  # Add other buckets here if needed
  iamRoleStatements:
    - Effect: "Allow"
      Action:
        - "s3:GetObject"
        - "s3:HeadObject"
        - "s3:PutObject"
      Resource:
        - "arn:aws:s3:::${self:provider.deploymentBucket}*"

    - Effect: "Allow"
      Action:
        - "s3:GetObject"
        - "s3:HeadObject"
      Resource:
        - "arn:aws:s3:::*"

package:
  artifact: package.zip

functions:
  app:
    handler: handler.handler
    memorySize: 3008
    timeout: 10
    environment:
      # Necessary since NAIP bucket is requester-pays
      AWS_REQUEST_PAYER: requester
      AWS_ACCOUNT_ID: ${env:AWS_ACCOUNT_ID}
      AWS_ACCESS_KEY_ID: ${env:AWS_ACCESS_KEY_ID}
      AWS_SECRET_ACCESS_KEY: ${env:AWS_SECRET_ACCESS_KEY}
      AWS_REGION: ${env:AWS_REGION}
      CACHE_CONTROL: ${opt:cache-control, 'public,max-age=3600'}
      CPL_TMPDIR: /tmp
      CPL_VSIL_CURL_ALLOWED_EXTENSIONS: .tif,.TIF
      GDAL_CACHEMAX: 25%
      # https://github.com/OSGeo/gdal/issues/909#issuecomment-420036545
      GDAL_DISABLE_READDIR_ON_OPEN: EMPTY_DIR
      GDAL_HTTP_MERGE_CONSECUTIVE_RANGES: YES
      GDAL_HTTP_MULTIPLEX: YES
      GDAL_HTTP_VERSION: 2
      MAX_THREADS: 1
      PYTHONWARNINGS: ignore
      VSI_CACHE: TRUE
      VSI_CACHE_SIZE: 536870912
    events:
      - httpApi:
          path: /{proxy+}
          method: "*"

Start serverless-offline

export AWS_ACCOUNT_ID=...
export AWS_ACCESS_KEY_ID=...
export AWS_SECRET_ACCESS_KEY=...
export AWS_REGION=...

sls offline --bucket some-bucket-of-yours

Go to this address: (note this may take a little while to load the first time because serverless-offline does something with docker in the background). This is pulling from a mosaic that should be fully public.

http://localhost:3000/dev/mosaicjson/tiles/16/12406/25717.npy?url=s3%3A%2F%2Ftmp-us-west-2-kylebarron%2Ftmp%2Fnaip-analytic-mosaic.json.gz&scale=1&return_mask=True

And I get:

{"detail":"Tile 16/12406/25717 is outside image bounds"}
@kylebarron
Copy link
Member Author

And if you look at the server in the terminal, it reproduces exactly what I see in the cloudwatch logs:
image

@kylebarron
Copy link
Member Author

If you can't reproduce this, then it seems the only thing that could be different is the pip install... Here's my docker log:

Step 1/15 : FROM lambci/lambda:build-python3.7
build-python3.7: Pulling from lambci/lambda
f9fc003cec10: Pull complete
9f0ae58b25e8: Pull complete
4429b5677e62: Pull complete
7f5c735db749: Pull complete
f7305caee0d0: Pull complete
8cbe99acc571: Pull complete
Digest: sha256:04e22057e5f23aa1cf5e5b843d7dc9795d5a90393afe384319bfd60941242c02
Status: Downloaded newer image for lambci/lambda:build-python3.7
 ---> 0a0cb5d12cbe
Step 2/15 : WORKDIR /tmp
 ---> Running in 7dca63dbf818
Removing intermediate container 7dca63dbf818
 ---> 600048290b04
Step 3/15 : COPY README.md /app/README.md
 ---> 46ba97d776ba
Step 4/15 : COPY titiler/ /app/titiler/
 ---> 7b8008901b76
Step 5/15 : COPY setup.py /app/setup.py
 ---> 0f9f70e31fd0
Step 6/15 : RUN pip install /app/.["lambda"] -t /var/task --no-binary numpy,pydantic
 ---> Running in 1a3669ae8d05
Processing /app
Collecting brotli-asgi>=1.0.0
  Downloading brotli-asgi-1.0.0.tar.gz (4.4 kB)
Collecting email-validator
  Downloading email_validator-1.1.1-py2.py3-none-any.whl (17 kB)
Collecting fastapi==0.60.1
  Downloading fastapi-0.60.1-py3-none-any.whl (49 kB)
Collecting jinja2
  Using cached Jinja2-2.11.2-py2.py3-none-any.whl (125 kB)
Collecting python-dotenv
  Downloading python_dotenv-0.14.0-py2.py3-none-any.whl (17 kB)
Collecting rio-color
  Downloading rio_color-1.0.0-cp37-cp37m-manylinux1_x86_64.whl (121 kB)
Collecting rio-cogeo~=2.0a5
  Downloading rio-cogeo-2.0a8.tar.gz (16 kB)
Collecting rio-tiler>=2.0b9
  Downloading rio-tiler-2.0b14.post2.tar.gz (122 kB)
Collecting rio-tiler-crs<3.1,>=3.0b4
  Downloading rio-tiler-crs-3.0b6.tar.gz (11 kB)
Collecting cogeo-mosaic<3.1,>=3.0a10
  Downloading cogeo-mosaic-3.0a11.tar.gz (21 kB)
Collecting mangum>=0.10.0
  Downloading mangum-0.10.0-py3-none-any.whl (10 kB)
Collecting starlette>=0.13.4
  Downloading starlette-0.13.8-py3-none-any.whl (60 kB)
Collecting brotli>=1.0.7
  Downloading Brotli-1.0.9-cp37-cp37m-manylinux1_x86_64.whl (357 kB)
Collecting idna>=2.0.0
  Using cached idna-2.10-py2.py3-none-any.whl (58 kB)
Collecting dnspython>=1.15.0
  Downloading dnspython-2.0.0-py3-none-any.whl (208 kB)
Collecting pydantic<2.0.0,>=0.32.2
  Downloading pydantic-1.6.1.tar.gz (123 kB)
Collecting MarkupSafe>=0.23
  Using cached MarkupSafe-1.1.1-cp37-cp37m-manylinux1_x86_64.whl (27 kB)
Collecting rasterio>=1.0a11
  Downloading rasterio-1.1.7-cp37-cp37m-manylinux1_x86_64.whl (18.1 MB)
Collecting click
  Using cached click-7.1.2-py2.py3-none-any.whl (82 kB)
Collecting rio-mucho
  Downloading rio_mucho-1.0.0-py3-none-any.whl (5.8 kB)
Collecting numpy~=1.15
  Downloading numpy-1.19.2.zip (7.3 MB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'
Collecting supermercado
  Downloading supermercado-0.1.1-py3-none-any.whl (8.1 kB)
Collecting mercantile~=1.1
  Downloading mercantile-1.1.6-py3-none-any.whl (13 kB)
Collecting attrs
  Using cached attrs-20.2.0-py2.py3-none-any.whl (48 kB)
Collecting boto3
  Downloading boto3-1.15.11.tar.gz (97 kB)
Collecting numexpr
  Downloading numexpr-2.7.1-cp37-cp37m-manylinux1_x86_64.whl (162 kB)
Collecting requests
  Using cached requests-2.24.0-py2.py3-none-any.whl (61 kB)
Collecting morecantile>=1.1.0
  Downloading morecantile-1.3.0.post1.tar.gz (20 kB)
Collecting pygeos>=0.7
  Downloading pygeos-0.8-cp37-cp37m-manylinux1_x86_64.whl (1.6 MB)
Collecting cachetools
  Downloading cachetools-4.1.1-py3-none-any.whl (10 kB)
Collecting typing-extensions
  Downloading typing_extensions-3.7.4.3-py3-none-any.whl (22 kB)
Collecting affine
  Downloading affine-2.3.0-py2.py3-none-any.whl (15 kB)
Collecting cligj>=0.5
  Downloading cligj-0.5.0-py3-none-any.whl (5.7 kB)
Collecting snuggs>=1.4.1
  Downloading snuggs-1.4.7-py3-none-any.whl (5.4 kB)
Collecting click-plugins
  Downloading click_plugins-1.1.1-py2.py3-none-any.whl (7.5 kB)
Collecting botocore<1.19.0,>=1.18.11
  Downloading botocore-1.18.11-py2.py3-none-any.whl (6.7 MB)
Collecting jmespath<1.0.0,>=0.7.1
  Using cached jmespath-0.10.0-py2.py3-none-any.whl (24 kB)
Collecting s3transfer<0.4.0,>=0.3.0
  Using cached s3transfer-0.3.3-py2.py3-none-any.whl (69 kB)
Collecting certifi>=2017.4.17
  Using cached certifi-2020.6.20-py2.py3-none-any.whl (156 kB)
Collecting chardet<4,>=3.0.2
  Using cached chardet-3.0.4-py2.py3-none-any.whl (133 kB)
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1
  Using cached urllib3-1.25.10-py2.py3-none-any.whl (127 kB)
Collecting pyparsing>=2.1.6
  Using cached pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
Collecting python-dateutil<3.0.0,>=2.1
  Using cached python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)
Collecting six>=1.5
  Using cached six-1.15.0-py2.py3-none-any.whl (10 kB)
Skipping wheel build for pydantic, due to binaries being disabled for it.
Building wheels for collected packages: titiler, brotli-asgi, rio-cogeo, rio-tiler, rio-tiler-crs, cogeo-mosaic, numpy, boto3, morecantile
  Building wheel for titiler (setup.py): started
  Building wheel for titiler (setup.py): finished with status 'done'
  Created wheel for titiler: filename=titiler-0.1.0a6-py3-none-any.whl size=38845 sha256=ee0ea484fcd2e3ed108ea47b83ded5e94dbfd7940b4a0082499b05c8d632d1b4
  Stored in directory: /tmp/pip-ephem-wheel-cache-6haabtk8/wheels/90/c9/1b/d2f1956f0bc095b0c25eac5d30a69f0db4be675033bac3fd0c
  Building wheel for brotli-asgi (setup.py): started
  Building wheel for brotli-asgi (setup.py): finished with status 'done'
  Created wheel for brotli-asgi: filename=brotli_asgi-1.0.0-py3-none-any.whl size=3464 sha256=51adaccf44b7415c7a2a43e7dfcaa761b4303e3c4cf56ce0cf2a406dff1b6a8b
  Stored in directory: /root/.cache/pip/wheels/5e/02/8a/4560f49995d5083f5f26817ea52934a8dbc52cbf74a0d09ab5
  Building wheel for rio-cogeo (setup.py): started
  Building wheel for rio-cogeo (setup.py): finished with status 'done'
  Created wheel for rio-cogeo: filename=rio_cogeo-2.0a8-py3-none-any.whl size=16192 sha256=f8ca95cd4eaeccbc89030f85a84d379e6797d5b78fafeef1586fe49ccfdf2fe4
  Stored in directory: /root/.cache/pip/wheels/6f/70/76/add408a571102499ca87c9312729543c1656ac98a09354dede
  Building wheel for rio-tiler (setup.py): started
  Building wheel for rio-tiler (setup.py): finished with status 'done'
  Created wheel for rio-tiler: filename=rio_tiler-2.0b14.post2-py3-none-any.whl size=187038 sha256=7e043e2961af8b484593a4ba3e413a738fdbe98caaabcad82ac2921c9d809ec0
  Stored in directory: /root/.cache/pip/wheels/c2/b6/68/1d93969cd0d17931567b45d18b96d0312822da29e60feba7f3
  Building wheel for rio-tiler-crs (setup.py): started
  Building wheel for rio-tiler-crs (setup.py): finished with status 'done'
  Created wheel for rio-tiler-crs: filename=rio_tiler_crs-3.0b6-py3-none-any.whl size=8712 sha256=cf5cc1b6653d4ed39f7a69a58ecac6eae7ac32956bec5b9ce8438fc4df24ad6f
  Stored in directory: /root/.cache/pip/wheels/43/6b/df/a85be774924c055b91917e2e105196cfb2c7ec7241b9b59bbd
  Building wheel for cogeo-mosaic (setup.py): started
  Building wheel for cogeo-mosaic (setup.py): finished with status 'done'
  Created wheel for cogeo-mosaic: filename=cogeo_mosaic-3.0a11-py3-none-any.whl size=26924 sha256=c561d98f00bd530f6f3f70526a81f6b6b1b4247081590efbb38498253b14e909
  Stored in directory: /root/.cache/pip/wheels/3e/4a/bb/485fe4d230d64bc1acc3705103844bf0f47694abf50c610ba1
  Building wheel for numpy (PEP 517): started
  Building wheel for numpy (PEP 517): still running...
  Building wheel for numpy (PEP 517): finished with status 'done'
  Created wheel for numpy: filename=numpy-1.19.2-cp37-cp37m-linux_x86_64.whl size=14527575 sha256=90bc766180177ea3dcb7a5558002618d76dd240ae7a6ffd1ac2d7cb0f1884cd9
  Stored in directory: /root/.cache/pip/wheels/4e/32/e3/11920446cbac93b90e0259320c3ebcf8be782977d7251ec45b
  Building wheel for boto3 (setup.py): started
  Building wheel for boto3 (setup.py): finished with status 'done'
  Created wheel for boto3: filename=boto3-1.15.11-py2.py3-none-any.whl size=127859 sha256=22945ef4348404e120cfbf075169ee7ace365a8e83b0209e5ecc77cc762b4481
  Stored in directory: /root/.cache/pip/wheels/1a/e9/43/27327b7ca7fcf3cd55e1cce78c70a9eae2bbab67001b73fcfb
  Building wheel for morecantile (setup.py): started
  Building wheel for morecantile (setup.py): finished with status 'done'
  Created wheel for morecantile: filename=morecantile-1.3.0.post1-py3-none-any.whl size=26552 sha256=cea1674d53289622c233adc9b816e23643d00296da279a8e9a95d126f690c08a
  Stored in directory: /root/.cache/pip/wheels/4d/77/2a/d6111f20ef285e138da8f4ad7f3fce058ae0e24c06308bf1da
Successfully built titiler brotli-asgi rio-cogeo rio-tiler rio-tiler-crs cogeo-mosaic numpy boto3 morecantile
Installing collected packages: starlette, brotli, brotli-asgi, idna, dnspython, email-validator, pydantic, fastapi, MarkupSafe, jinja2, python-dotenv, affine, click, cligj, numpy, pyparsing, snuggs, click-plugins, attrs, rasterio, rio-mucho, rio-color, mercantile, supermercado, rio-cogeo, urllib3, jmespath, six, python-dateutil, botocore, s3transfer, boto3, numexpr, certifi, chardet, requests, rio-tiler, morecantile, rio-tiler-crs, pygeos, cachetools, cogeo-mosaic, typing-extensions, mangum, titiler
    Running setup.py install for pydantic: started
    Running setup.py install for pydantic: finished with status 'done'
ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts.

We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.

fastapi 0.60.1 requires starlette==0.13.6, but you'll have starlette 0.13.8 which is incompatible.
Successfully installed MarkupSafe-1.1.1 affine-2.3.0 attrs-20.2.0 boto3-1.15.11 botocore-1.18.11 brotli-1.0.9 brotli-asgi-1.0.0 cachetools-4.1.1 certifi-2020.6.20 chardet-3.0.4 click-7.1.2 click-plugins-1.1.1 cligj-0.5.0 cogeo-mosaic-3.0a11 dnspython-2.0.0 email-validator-1.1.1 fastapi-0.60.1 idna-2.10 jinja2-2.11.2 jmespath-0.10.0 mangum-0.10.0 mercantile-1.1.6 morecantile-1.3.0.post1 numexpr-2.7.1 numpy-1.19.2 pydantic-1.6.1 pygeos-0.8 pyparsing-2.4.7 python-dateutil-2.8.1 python-dotenv-0.14.0 rasterio-1.1.7 requests-2.24.0 rio-cogeo-2.0a8 rio-color-1.0.0 rio-mucho-1.0.0 rio-tiler-2.0b14.post2 rio-tiler-crs-3.0b6 s3transfer-0.3.3 six-1.15.0 snuggs-1.4.7 starlette-0.13.8 supermercado-0.1.1 titiler-0.1.0a6 typing-extensions-3.7.4.3 urllib3-1.25.10
Removing intermediate container 1a3669ae8d05
 ---> bc98e6f2ae79
Step 7/15 : RUN cd /var/task && find . -type f -name '*.pyc' | while read f; do n=$(echo $f | sed 's/__pycache__\///' | sed 's/.cpython-[2-3][0-9]//'); cp $f $n; done;
 ---> Running in 32a3bd84f523
Removing intermediate container 32a3bd84f523
 ---> 1be44140b820
Step 8/15 : RUN cd /var/task && find . -type d -a -name '__pycache__' -print0 | xargs -0 rm -rf
 ---> Running in f4a814fdac32
Removing intermediate container f4a814fdac32
 ---> 7a9806ffe580
Step 9/15 : RUN cd /var/task && find . -type f -a -name '*.py' -print0 | xargs -0 rm -f
 ---> Running in d77e06a4b09e
Removing intermediate container d77e06a4b09e
 ---> aa125d6c2b57
Step 10/15 : RUN find /var/task -type d -a -name 'tests' -print0 | xargs -0 rm -rf
 ---> Running in 38c1682ba088
Removing intermediate container 38c1682ba088
 ---> af659e008dbb
Step 11/15 : RUN rm -rdf /var/task/numpy/doc/
 ---> Running in 93ba2094987e
Removing intermediate container 93ba2094987e
 ---> dce7c082f523
Step 12/15 : RUN rm -rdf /var/task/stack
 ---> Running in f092c1003a5a
Removing intermediate container f092c1003a5a
 ---> 6fcc8c96bce6
Step 13/15 : RUN cd /var/task && zip -r9q /tmp/package.zip *
 ---> Running in 6f903a379882
Removing intermediate container 6f903a379882
 ---> 33e6e2a09b04
Step 14/15 : COPY lambda/handler.py handler.py
 ---> fbcdd2fd0b4a
Step 15/15 : RUN zip -r9q /tmp/package.zip handler.py
 ---> Running in d1d5279b0d56
Removing intermediate container d1d5279b0d56
 ---> 2c9a312aae92
Successfully built 2c9a312aae92
Successfully tagged titiler-lambda:latest

@vincentsarago
Copy link
Member

@kylebarron

  • can you share a mosaic or a list of files for which it's failing?
  • can you run the cogeo-mosaic code itself outside the app?

@kylebarron
Copy link
Member Author

At the end of the first post I shared a link that doesn't work. That includes one x/y/z and a public mosaic

can you run the cogeo-mosaic code itself outside the app?

Hmm good question

@kylebarron
Copy link
Member Author

wow it works outside the titiler app using the same dependencies... Here's how I opened the titiler lambda docker container to test using the same code:

# export AWS credentials
dshell titiler-lambda sh

Inside docker shell:

cd /var/task
export AWS_REQUEST_PAYER="requester"
python

Inside python shell:

from cogeo_mosaic.backends import MosaicBackend
url = 's3://tmp-us-west-2-kylebarron/tmp/naip-analytic-mosaic.json.gz'
z, x, y = 16, 12406, 25717
with MosaicBackend(url) as mosaic:
    tile=mosaic.tile(x, y, z)
>>> with MosaicBackend(url) as mosaic:
...     tile=mosaic.tile(x, y, z)
...
/var/task/rio_tiler/reader.py:94: AlphaBandWarning: Alpha band was removed from the output data array
INFO:root:Tile 16/12406/25717 is outside image bounds
INFO:root:Tile 16/12406/25717 is outside image bounds
INFO:root:Tile 16/12406/25717 is outside image bounds
INFO:root:Tile 16/12406/25717 is outside image bounds
INFO:root:Tile 16/12406/25717 is outside image bounds
>>> tile
((array([[[20, 15, 23, ..., 16, 16, 16],
        [19, 10, 19, ..., 16, 16, 15],
        [23, 21, 21, ..., 16, 16, 15],
        ...,
        [12, 13, 13, ...,  0,  3,  6],
        [12, 14,  9, ...,  9, 13,  9],
        [13, 10, 14, ...,  9,  1,  8]],

       [[15, 13, 18, ..., 14, 13, 14],
        [13,  8, 14, ..., 14, 14, 14],
        [17, 16, 14, ..., 14, 14, 14],
        ...,
        [11, 13, 13, ...,  0,  3,  6],
        [12, 14,  8, ...,  9, 15,  9],
        [12,  9, 12, ...,  9,  1,  9]],

       [[16, 14, 20, ..., 15, 14, 14],
        [14,  9, 16, ..., 15, 14, 14],
        [18, 17, 15, ..., 15, 14, 14],
        ...,
        [12, 14, 13, ...,  0,  3,  7],
        [12, 15,  9, ..., 11, 15, 10],
        [13, 10, 13, ..., 10,  1, 10]]], dtype=uint8), array([[255, 255, 255, ..., 255, 255, 255],
       [255, 255, 255, ..., 255, 255, 255],
       [255, 255, 255, ..., 255, 255, 255],
       ...,
       [255, 255, 255, ...,   0, 255, 255],
       [255, 255, 255, ..., 255, 255, 255],
       [255, 255, 255, ..., 255,   0, 255]])), ['s3://naip-analytic/az/2017/60cm/rgbir_cog/36111/m_3611158_nw_12_h_20170619.tif'])

@kylebarron
Copy link
Member Author

This is all due to setting MAX_THREADS=1!!!

When I'm inside the docker shell as above and run

export AWS_REQUEST_PAYER="requester"
export CACHE_CONTROL="public,max-age=3600"
export CPL_TMPDIR="/tmp"
export CPL_VSIL_CURL_ALLOWED_EXTENSIONS=".tif,.TIF"
export GDAL_CACHEMAX="25%"
export GDAL_DISABLE_READDIR_ON_OPEN="EMPTY_DIR"
export GDAL_HTTP_MERGE_CONSECUTIVE_RANGES="YES"
export GDAL_HTTP_MULTIPLEX="YES"
export GDAL_HTTP_VERSION="2"
export MAX_THREADS="1"
export PYTHONWARNINGS="ignore"
export VSI_CACHE="TRUE"
export VSI_CACHE_SIZE="536870912"
>>> from starlette.testclient import TestClient
>>> from titiler.main import app
>>> client = TestClient(app)
>>> response = client.get("/mosaicjson/tiles/16/12406/25717.npy?url=s3%3A%2F%2Ftmp-us-west-2-kylebarron%2Ftmp%2Fnaip-analytic-mosaic.json.gz&scale=1&return_mask=True")
Tile 16/12406/25717 is outside image bounds
NoneType: None

But when you unset MAX_THREADS, it works:

unset MAX_THREADS
sh-4.2# python
Python 3.7.9 (default, Sep 24 2020, 16:54:35)
[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from starlette.testclient import TestClient
>>> from titiler.main import app
>>> client = TestClient(app)
>>> response = client.get("/mosaicjson/tiles/16/12406/25717.npy?url=s3%3A%2F%2Ftmp-us-west-2-kylebarron%2Ftmp%2Fnaip-analytic-mosaic.json.gz&scale=1&return_mask=True")
INFO:root:Tile 16/12406/25717 is outside image bounds
INFO:root:Tile 16/12406/25717 is outside image bounds
INFO:root:Tile 16/12406/25717 is outside image bounds
INFO:root:Tile 16/12406/25717 is outside image bounds
INFO:root:Tile 16/12406/25717 is outside image bounds
>>>

@vincentsarago
Copy link
Member

fixed in rio-tiler cogeotiff/rio-tiler#281

Thanks @kylebarron 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants