FsspecStore glob fails with "Last-Modified Header missing from response"

オープン
#438 コメント 3 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
google-cloud, python
領域
backend, cloud

調査の方向性

obstore/fsspec.py、特に FsspecStore.glob と _info から始め、報告された呼び出しを公開 GCS バケットに対して再現します。glob が空のパスを head_async に渡す理由を追跡します。glob がバケットルートを処理する際に、Last-Modified がないことによるエラーを発生させず、それでも一致するオブジェクトを返すようになれば完了です。

索引モデルが issue の本文から書いたものです。

説明

fsspec
[nav] In [21]: from obstore.fsspec import FsspecStore
          ...: FsspecStore("gs").glob("gs://gcp-public-data-landsat/*.csv.gz")
---------------------------------------------------------------------------
GenericError                              Traceback (most recent call last)
Input In [21], in <cell line: 0>()
      1 from obstore.fsspec import FsspecStore
----> 2 FsspecStore("gs").glob("gs://gcp-public-data-landsat/*.csv.gz")

File ~/model312/.venv/lib/python3.13/site-packages/fsspec/asyn.py:118, in sync_wrapper.<locals>.wrapper(*args, **kwargs)
    115 @functools.wraps(func)
    116 def wrapper(*args, **kwargs):
    117     self = obj or args[0]
--> 118     return sync(self.loop, func, *args, **kwargs)

File ~/model312/.venv/lib/python3.13/site-packages/fsspec/asyn.py:103, in sync(loop, func, timeout, *args, **kwargs)
    101     raise FSTimeoutError from return_result
    102 elif isinstance(return_result, BaseException):
--> 103     raise return_result
    104 else:
    105     return return_result

File ~/model312/.venv/lib/python3.13/site-packages/fsspec/asyn.py:56, in _runner(event, coro, result, timeout)
     54     coro = asyncio.wait_for(coro, timeout=timeout)
     55 try:
---> 56     result[0] = await coro
     57 except Exception as ex:
     58     result[0] = ex

File ~/model312/.venv/lib/python3.13/site-packages/fsspec/asyn.py:804, in AsyncFileSystem._glob(self, path, maxdepth, **kwargs)
    801     else:
    802         depth = None
--> 804 allpaths = await self._find(
    805     root, maxdepth=depth, withdirs=True, detail=True, **kwargs
    806 )
    808 pattern = glob_translate(path + ("/" if ends_with_sep else ""))
    809 pattern = re.compile(pattern)

File ~/model312/.venv/lib/python3.13/site-packages/fsspec/asyn.py:846, in AsyncFileSystem._find(self, path, maxdepth, withdirs, **kwargs)
    842 detail = kwargs.pop("detail", False)
    844 # Add the root directory if withdirs is requested
    845 # This is needed for posix glob compliance
--> 846 if withdirs and path != "" and await self._isdir(path):
    847     out[path] = await self._info(path)
    849 # async for?

File ~/model312/.venv/lib/python3.13/site-packages/fsspec/asyn.py:677, in AsyncFileSystem._isdir(self, path)
    675 async def _isdir(self, path):
    676     try:
--> 677         return (await self._info(path))["type"] == "directory"
    678     except OSError:
    679         return False

File ~/model312/.venv/lib/python3.13/site-packages/obstore/fsspec.py:488, in FsspecStore._info(self, path, **_kwargs)
    485 store = self._construct_store(bucket)
    487 try:
--> 488     head = await obs.head_async(store, path_no_bucket)
    489     return {
    490         # Required of `info`: (?)
    491         "name": head["path"],
   (...)
    497         "version": head["version"],
    498     }
    499 except FileNotFoundError:

GenericError: Generic GCS error: Last-Modified Header missing from response

Debug source:
Generic {
    store: "GCS",
    source: Header {
        source: MissingLastModified,
    },
}

Looks like glob is trying to get access the root bucket "object" which isn't really there?

[ins] In [22]: %debug
> /Users/brett/model312/.venv/lib/python3.13/site-packages/obstore/fsspec.py(488)_info()
    486
    487         try:
--> 488             head = await obs.head_async(store, path_no_bucket)
    489             return {
    490                 # Required of `info`: (?)

ipdb> store
GCSStore(bucket="gcp-public-data-landsat")
ipdb> path_no_bucket
''
主要言語
Python
スター
842
フォーク
50
平均マージ
9時間
マージ済み PR(30日)
13

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

developmentseed/obstore のほかの issue

developmentseed/obstore の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。