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

STAC Copy not working for new installations #464

Closed
baloola opened this issue Sep 20, 2023 · 4 comments
Closed

STAC Copy not working for new installations #464

baloola opened this issue Sep 20, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@baloola
Copy link

baloola commented Sep 20, 2023

running copy command fails, due to not finding the target file. The issue is pretty much the same as #168

To reproduce
new stactools installation, ( with new installation for dependencies -e.g docker images-), then trying copy command

Screenshots and shell session dumps

Traceback (most recent call last):                                                                                                 
  File "/usr/local/bin/stac", line 8, in <module>                                                                                  
    sys.exit(run_cli())                                                                                                            
  File "/usr/local/lib/python3.10/dist-packages/stactools/cli/cli.py", line 37, in run_cli                                         
    cli(prog_name="stac")
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/stactools/cli/commands/copy.py", line 108, in copy_command
    copy_catalog(
  File "/usr/local/lib/python3.10/dist-packages/stactools/core/copy.py", line 297, in copy_catalog
    catalog.save(catalog_type, dest_directory)
  File "/usr/local/lib/python3.10/dist-packages/pystac/catalog.py", line 962, in save
    item.save_object(
  File "/usr/local/lib/python3.10/dist-packages/pystac/stac_object.py", line 476, in save_object
    stac_io.save_json(dest_href, self.to_dict(include_self_link=include_self_link))
  File "/usr/local/lib/python3.10/dist-packages/pystac/stac_io.py", line 260, in save_json
    self.write_text(dest, txt)
  File "/usr/local/lib/python3.10/dist-packages/stactools/core/io/__init__.py", line 94, in write_text
    return self.write_text_to_href(href, txt, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/stactools/core/io/__init__.py", line 112, in write_text_to_href
    with fsspec.open(href, "w", **kwargs) as destination:
  File "/usr/local/lib/python3.10/dist-packages/fsspec/core.py", line 102, in __enter__
    f = self.fs.open(self.path, mode=mode)
  File "/usr/local/lib/python3.10/dist-packages/fsspec/spec.py", line 1309, in open
    f = self._open(
  File "/usr/local/lib/python3.10/dist-packages/fsspec/implementations/local.py", line 180, in _open
    return LocalFileOpener(path, mode, fs=self, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/fsspec/implementations/local.py", line 298, in __init__
    self._open()
  File "/usr/local/lib/python3.10/dist-packages/fsspec/implementations/local.py", line 303, in _open
    self.f = open(self.path, mode=self.mode)
FileNotFoundError: [Errno 2] No such file or directory: '/out/SENTINEL2_L2A_MOSAIC_120/SENTINEL2_L2A_MOSAIC_120.json'

Additional context
I did confirm that using fsspec version 2023.9.0 the issue does not happen, while installing lates release (2023.9.1) will cause the issue.

@baloola baloola added the bug Something isn't working label Sep 20, 2023
@jsignell
Copy link
Member

I think this is solved by #463 so should be fixed in the next release.

@gadomski
Copy link
Member

Hey, looks like we should release! I'll cook one up.

@gadomski
Copy link
Member

Release v0.5.2: https://github.com/stac-utils/stactools/releases/tag/v0.5.2. @baloola can you update and check to see if your issue is fixed?

@baloola
Copy link
Author

baloola commented Sep 20, 2023

@gadomski I've tested the new release on a docker image( ubuntu:22.04), and on a github workflow instance, and both works just fine.
thank a lot :)

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

3 participants