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

HTTPError: 500 Server Error: INTERNAL SERVER ERROR for url: http://localhost:5713/api/metadata?&filename=e%3A%2Fsongmingyang%2F20250117_SAM2%2Fsegment-geospatial-main%2Fdocs%2Fexamples%2Fsatellite.tif #386

Open
UCASSMY opened this issue Jan 17, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@UCASSMY
Copy link

UCASSMY commented Jan 17, 2025


HTTPError Traceback (most recent call last)
Cell In[6], line 2
1 m.layers[-1].visible = False
----> 2 m.add_raster(image, layer_name="Image")
3 m

File d:\songmingyang\anaconda\envs\sam\Lib\site-packages\leafmap\leafmap.py:2360, in Map.add_raster(self, source, indexes, colormap, vmin, vmax, nodata, attribution, layer_name, layer_index, zoom_to_layer, visible, opacity, array_args, client_args, **kwargs)
2357 if isinstance(source, np.ndarray) or isinstance(source, xr.DataArray):
2358 source = array_to_image(source, **array_args)
-> 2360 tile_layer, tile_client = get_local_tile_layer(
2361 source,
2362 indexes=indexes,
2363 colormap=colormap,
2364 vmin=vmin,
2365 vmax=vmax,
2366 nodata=nodata,
2367 opacity=opacity,
2368 attribution=attribution,
2369 layer_name=layer_name,
2370 client_args=client_args,
2371 return_client=True,
2372 **kwargs,
2373 )
2374 tile_layer.visible = visible
2376 self.add(tile_layer, index=layer_index)

File d:\songmingyang\anaconda\envs\sam\Lib\site-packages\leafmap\common.py:2999, in get_local_tile_layer(source, port, debug, indexes, colormap, vmin, vmax, nodata, attribution, tile_format, layer_name, client_args, return_client, quiet, **kwargs)
2997 else:
2998 if tile_format == "ipyleaflet":
-> 2999 tile_layer = get_leaflet_tile_layer(
3000 tile_client,
3001 port=port,
3002 debug=debug,
3003 indexes=indexes,
3004 colormap=colormap,
3005 vmin=vmin,
3006 vmax=vmax,
3007 nodata=nodata,
3008 attribution=attribution,
3009 name=layer_name,
3010 **kwargs,
3011 )
3012 else:
3013 tile_layer = get_folium_tile_layer(
3014 tile_client,
3015 port=port,
(...)
3025 **kwargs,
3026 )

File d:\songmingyang\anaconda\envs\sam\Lib\site-packages\localtileserver\widgets.py:99, in get_leaflet_tile_layer(source, port, debug, indexes, colormap, vmin, vmax, nodata, attribution, **kwargs)
94 class BoundTileLayer(TileLayer, LocalTileServerLayerMixin):
95 # jupyter-widgets/ipyleaflet#888
96 # ipython/traitlets#626 (comment)
97 bounds = Union((Tuple(),), default_value=None, allow_none=True).tag(sync=True, o=True)
---> 99 source, created = get_or_create_tile_client(
100 source,
101 port=port,
102 debug=debug,
103 )
104 url = source.get_tile_url(
105 indexes=indexes,
106 colormap=colormap,
(...)
110 client=True,
111 )
112 if attribution is None:

File d:\songmingyang\anaconda\envs\sam\Lib\site-packages\localtileserver\client.py:590, in get_or_create_tile_client(source, port, debug)
588 source.shutdown()
589 del source
--> 590 raise e
591 return source, _internally_created

File d:\songmingyang\anaconda\envs\sam\Lib\site-packages\localtileserver\client.py:584, in get_or_create_tile_client(source, port, debug)
582 try:
583 r = requests.get(source.create_url("api/metadata"))
--> 584 r.raise_for_status()
585 except requests.HTTPError as e:
586 # Make sure to destroy the server and its thread if internally created.
587 if _internally_created:

File d:\songmingyang\anaconda\envs\sam\Lib\site-packages\requests\models.py:1024, in Response.raise_for_status(self)
1019 http_error_msg = (
1020 f"{self.status_code} Server Error: {reason} for url: {self.url}"
1021 )
1023 if http_error_msg:
-> 1024 raise HTTPError(http_error_msg, response=self)

HTTPError: 500 Server Error: INTERNAL SERVER ERROR for url: http://localhost:5713/api/metadata?&filename=e%3A%2Fsongmingyang%2F20250117_SAM2%2Fsegment-geospatial-main%2Fdocs%2Fexamples%2Fsatellite.tif

@UCASSMY UCASSMY added the bug Something isn't working label Jan 17, 2025
@UCASSMY
Copy link
Author

UCASSMY commented Jan 17, 2025


HTTPError Traceback (most recent call last)
Cell In[8], line 2
1 m.layers[-1].visible = False
----> 2 m.add_raster(image, layer_name="Image")
3 m

File d:\songmingyang\anaconda\envs\sam\Lib\site-packages\leafmap\leafmap.py:2384, in Map.add_raster(self, source, indexes, colormap, vmin, vmax, nodata, attribution, layer_name, layer_index, zoom_to_layer, visible, opacity, array_args, client_args, **kwargs)
2381 if isinstance(source, np.ndarray) or isinstance(source, xr.DataArray):
2382 source = common.array_to_image(source, **array_args)
-> 2384 tile_layer, tile_client = common.get_local_tile_layer(
2385 source,
2386 indexes=indexes,
2387 colormap=colormap,
2388 vmin=vmin,
2389 vmax=vmax,
2390 nodata=nodata,
2391 opacity=opacity,
2392 attribution=attribution,
2393 layer_name=layer_name,
2394 client_args=client_args,
2395 return_client=True,
2396 **kwargs,
2397 )
2398 tile_layer.visible = visible
2400 self.add(tile_layer, index=layer_index)

File d:\songmingyang\anaconda\envs\sam\Lib\site-packages\leafmap\common.py:2999, in get_local_tile_layer(source, port, debug, indexes, colormap, vmin, vmax, nodata, attribution, tile_format, layer_name, client_args, return_client, quiet, **kwargs)
2997 else:
2998 if tile_format == "ipyleaflet":
-> 2999 tile_layer = get_leaflet_tile_layer(
3000 tile_client,
3001 port=port,
3002 debug=debug,
3003 indexes=indexes,
3004 colormap=colormap,
3005 vmin=vmin,
3006 vmax=vmax,
3007 nodata=nodata,
3008 attribution=attribution,
3009 name=layer_name,
3010 **kwargs,
3011 )
3012 else:
3013 tile_layer = get_folium_tile_layer(
3014 tile_client,
3015 port=port,
(...)
3025 **kwargs,
3026 )

File d:\songmingyang\anaconda\envs\sam\Lib\site-packages\localtileserver\widgets.py:99, in get_leaflet_tile_layer(source, port, debug, indexes, colormap, vmin, vmax, nodata, attribution, **kwargs)
94 class BoundTileLayer(TileLayer, LocalTileServerLayerMixin):
95 # jupyter-widgets/ipyleaflet#888
96 # ipython/traitlets#626 (comment)
97 bounds = Union((Tuple(),), default_value=None, allow_none=True).tag(sync=True, o=True)
---> 99 source, created = get_or_create_tile_client(
100 source,
101 port=port,
102 debug=debug,
103 )
104 url = source.get_tile_url(
105 indexes=indexes,
106 colormap=colormap,
(...)
110 client=True,
111 )
112 if attribution is None:

File d:\songmingyang\anaconda\envs\sam\Lib\site-packages\localtileserver\client.py:590, in get_or_create_tile_client(source, port, debug)
588 source.shutdown()
589 del source
--> 590 raise e
591 return source, _internally_created

File d:\songmingyang\anaconda\envs\sam\Lib\site-packages\localtileserver\client.py:584, in get_or_create_tile_client(source, port, debug)
582 try:
583 r = requests.get(source.create_url("api/metadata"))
--> 584 r.raise_for_status()
585 except requests.HTTPError as e:
586 # Make sure to destroy the server and its thread if internally created.
587 if _internally_created:

File d:\songmingyang\anaconda\envs\sam\Lib\site-packages\requests\models.py:1024, in Response.raise_for_status(self)
1019 http_error_msg = (
1020 f"{self.status_code} Server Error: {reason} for url: {self.url}"
1021 )
1023 if http_error_msg:
-> 1024 raise HTTPError(http_error_msg, response=self)

HTTPError: 500 Server Error: INTERNAL SERVER ERROR for url: http://localhost:14938/api/metadata?&filename=e%3A%5Csongmingyang%5C20250117_SAM2%5Csegment-geospatial-main%5Cdocs%5Cexamples%5Csatellite.tif

@UCASSMY
Copy link
Author

UCASSMY commented Jan 17, 2025

Hey Sir. How can i do to fix this bug?

@UCASSMY
Copy link
Author

UCASSMY commented Jan 17, 2025

[2025-01-17 21:28:18,880] ERROR in app: Exception on /api/metadata [GET]
Traceback (most recent call last):
File "rasterio\crs.pyx", line 592, in rasterio.crs.CRS.from_epsg
File "rasterio\_err.pyx", line 289, in rasterio._err.exc_wrap_int
rasterio._err.CPLE_AppDefinedError: PROJ: proj_create_from_database: d:\songmingyang\anaconda\envs\sam\Lib\site-packages\osgeo\data\proj\proj.db contains DATABASE.LAYOUT.VERSION.MINOR = 2 whereas a number >= 4 is expected. It comes from another PROJ installation.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "d:\songmingyang\anaconda\envs\sam\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File "d:\songmingyang\anaconda\envs\sam\Lib\site-packages\flask\app.py", line 865, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "d:\songmingyang\anaconda\envs\sam\Lib\site-packages\flask_restx\api.py", line 402, in wrapper
resp = resource(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "d:\songmingyang\anaconda\envs\sam\Lib\site-packages\flask\views.py", line 110, in view
return current_app.ensure_sync(self.dispatch_request)(**kwargs) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "d:\songmingyang\anaconda\envs\sam\Lib\site-packages\flask_restx\resource.py", line 41, in dispatch_request
resp = meth(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "d:\songmingyang\anaconda\envs\sam\Lib\site-packages\flask_caching_init_.py", line 426, in decorated_function
...
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "rasterio\crs.pyx", line 852, in rasterio.crs.CRS.from_string
File "rasterio\crs.pyx", line 596, in rasterio.crs.CRS.from_epsg
rasterio.errors.CRSError: The EPSG code is unknown. PROJ: proj_create_from_database: d:\songmingyang\anaconda\envs\sam\Lib\site-packages\osgeo\data\proj\proj.db contains DATABASE.LAYOUT.VERSION.MINOR = 2 whereas a number >= 4 is expected. It comes from another PROJ installation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant