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

RemoteDataset.explore_and_add_remote seems to be not working #1260

Open
MichaelBuessemeyer opened this issue Feb 26, 2025 · 1 comment
Open
Labels

Comments

@MichaelBuessemeyer
Copy link
Contributor

Context

  • Affected library: webknossos

With the current version of wklibs I cannot add a remote dataset via RemoteDataset.explore_and_add_remote as this leads to a crash. The reason for the crash is that the code tries to load info for the dataset which should be created by the route before the dataset itself is created.

For testing this can be used:

with wk.webknossos_context(
    token="secretSampleUserToken", url="http://localhost:9000"
):
     wk.RemoteDataset.explore_and_add_remote("gs://fafb-ffn1-20200412/segmentation", "remote_adding", "Datasets")

Expected Behavior

The code should succeed and the local running wk instance should have a new dataset added called "remote_adding".

Current Behavior

The wklibs crash with the following stack trace:

Traceback (most recent call last):
  File "<libs>/webknossos/webknossos/client/api_client/_abstract_api_client.py", line 241, in _assert_good_response
    response.raise_for_status()
  File "<voxelytics>/.venv/lib/python3.11/site-packages/httpx/_models.py", line 763, in raise_for_status
    raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '404 Not Found' for url 'http://localhost:9000/api/v9/datasets/disambiguate/sample_organization/remote_adding/toId'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<libs>/webknossos/test_remote_layer.py", line 57, in <module>
    main()
  File "<libs>/webknossos/test_remote_layer.py", line 12, in main
    wk.RemoteDataset.explore_and_add_remote("gs://fafb-ffn1-20200412/segmentation", "remote_adding", "Datasets")
  File "<libs>/webknossos/webknossos/dataset/dataset.py", line 3263, in explore_and_add_remote
    cls._parse_remote(dataset_name)
  File "<libs>/webknossos/webknossos/dataset/dataset.py", line 727, in _parse_remote
    dataset_id = cls._disambiguate_remote(dataset_name, organization_id)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<libs>/webknossos/webknossos/dataset/dataset.py", line 611, in _disambiguate_remote
    dataset_id := current_context.api_client_with_auth.dataset_id_from_name(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<libs>/webknossos/webknossos/client/api_client/wk_api_client.py", line 77, in dataset_id_from_name
    return self._get_json(route, ApiDatasetId).id
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<libs>/webknossos/webknossos/client/api_client/_abstract_api_client.py", line 37, in _get_json
    response = self._get(route, query)
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "<libs>/webknossos/webknossos/client/api_client/_abstract_api_client.py", line 116, in _get
    return self._request("GET", route, query, timeout_seconds=timeout_seconds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<libs>/webknossos/webknossos/client/api_client/_abstract_api_client.py", line 207, in _request
    self._assert_good_response(response)
  File "<libs>/webknossos/webknossos/client/api_client/_abstract_api_client.py", line 243, in _assert_good_response
    raise UnexpectedStatusError(response) from e
webknossos.client.api_client.errors.UnexpectedStatusError: An error occurred while performing a GET request for URL http://localhost:9000/api/v9/datasets/disambiguate/sample_organization/remote_adding/toId.
If this is unexpected, please double-check your WEBKNOSSOS URL and credentials.
Got response status 404 with body: {"messages":[{"error":"Dataset remote_adding does not exist or could not be accessed"}]}

Your Environment for bug

  • Linux ubuntu
  • newest wklibs version
  • python venv version 3.11
MichaelBuessemeyer referenced this issue Feb 26, 2025
* Start implementing support for renameable datasets.

* WIP support deprecated urls and open_remote_dataset requests.

* Fix issues and update test cassettes.

* Update changelog and fix remaining tests.

* WIP adapt parsing remote dataset urls.

* Fix regex for new dataset urls.

* Remove comments and reformat timestamp.

* Update webknossos/Changelog.md

Co-authored-by: Norman Rzepka <[email protected]>

---------

Co-authored-by: Norman Rzepka <[email protected]>
@MichaelBuessemeyer
Copy link
Contributor Author

Please see my following post: 0efedee#r153039757

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

No branches or pull requests

1 participant